This commit is contained in:
ryfrd 2025-08-20 15:19:24 +01:00
parent 2a9167cb7e
commit 96573664a6
95 changed files with 4130 additions and 2328 deletions

View file

@ -1,6 +1,5 @@
baseURL = "https://nonsense.dymc.win"
title = "James' Blog"
# theme = "etch"
languageCode = "en-GB"
enableInlineShortcodes = true
pygmentsCodeFences = true
@ -12,17 +11,17 @@ pygmentsUseClasses = true
[menu]
[[menu.main]]
identifier = "--help"
name = "--help"
title = "--help"
identifier = "👋"
name = "👋"
title = "👋"
url = "/info/"
weight = 20
# [[menu.main]]
# identifier = "search"
# name = "search"
# title = "search"
# url = "/search/"
# weight = 20
[[menu.main]]
identifier = "🔎"
name = "🔎"
title = "🔎"
url = "/search/"
weight = 20
[permalinks]
posts = "/:title/"

View file

@ -2,4 +2,4 @@ This is a place to document bits and bobs I've been up to that have interested m
Expect linux and self-hosting tinkering, some novice programming, and maybe the occasional recipe.
I tend to be a fool so take anything written here with a pinch of salt :)
- [rss HERE!!](../index.xml)
[rss feed here!](../index.xml)

View file

@ -11,6 +11,7 @@ draft: false
I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with [nix-colors](https://github.com/misterio77/nix-colors) so that my neovim theme would follow color changes in home-manager.
<!--more-->
Luckily, I came across [this](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md) handy little plugin from the lovely [mini.nvim](https://github.com/echasnovski/mini.nvim) suite of plugins which lets you create your own theme with your custom colors.

View file

@ -1,6 +1,6 @@
---
title: Multi user qtile fiddling
date: 2022-12-20
date: 2022-12-20
tags:
- qtile
- python

View file

@ -9,6 +9,7 @@ draft: false
As is traditional with people hosting their own blog I'm going to do a post detailing EXACTLY how I'm hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
<!--more-->
Here is a diagram I edited to illustrate (credit to xkcd I think?).
![self-hosting](/image/self-hosting.png)

View file

@ -12,6 +12,7 @@ I'm declining cookies.
I'm getting spammed with notifications to claim a sick new overwatch skin.
There's a little channel point button twerking for me to click it.
You get the idea; it's a heavy noisy experience.
<!--more-->
As a result I set out to devise a solution which does spark joy.
I came up with a script which leans on DIY desktop staples (dunst, tofi, mpv) and the very nice cli utility [streamlink](https://github.com/streamlink/streamlink).
@ -71,7 +72,7 @@ if [[ -n "$choice" ]]; then
# get first column from selection aka stream name
meat=$(echo "$choice" | awk '{print $1}')
"${NOTIFY}" "twitch -- launching twitch.tv/$meat"
streamlink twitch.tv/"$meat" 1080p60 --player $"{PLAYER}"
streamlink twitch.tv/"$meat" 1080p60 --player "${PLAYER}"
fi
```
@ -104,3 +105,5 @@ fi
- no chat (you might want to spam LUL)
- takes a second to talk to the internet so things don't launch immediately
- have to faff with getting api key - [how to get one btw](https://dev.twitch.tv/docs/api/get-started/)
Hope you enjoyed bye

3
content/search/_index.md Normal file
View file

@ -0,0 +1,3 @@
---
layout: "search"
---

View file

@ -0,0 +1,36 @@
{{ define "main" }}
<p>This is not a very clever search. It simply looks if the content of a post contains your query. </p>
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>
<ul id="results"></ul>
<p>Alternatively, this is everything.</p>
{{ $pages := where site.RegularPages "Type" "posts" }}
{{ $years := $pages.GroupByDate "2006" }}
<ul class="tree">
{{ range $years }}
<li>
<span class="folder">{{ .Key }}</span>
<ul>
{{ $months := .Pages.GroupByDate "January" }}
{{ range $months }}
<li>
<span class="folder">{{ .Key }}</span>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ end }}

View file

@ -1,12 +1,12 @@
{{ define "main" }}
<article>
<header id="post-header">
<h3>{{ .Title }}</h3>
<h2>{{ .Title }}</h2>
<div>
{{- if isset .Params "date" -}} {{ if eq .Lastmod .Date }}
<time>{{ .Date | time.Format (i18n "post.created") }}</time>
<p>{{ .Date | time.Format (i18n "post.created") }}</p>
{{ else }}
<time>{{ .Lastmod | time.Format (i18n "post.updated") }}</time>
<p>{{ .Lastmod | time.Format (i18n "post.updated") }}</p>
{{ end }} {{- end -}}
</div>
</header>

View file

@ -1,3 +1,9 @@
{{ define "main" }}
{{ partial "results.html" . }}
{{ range first 5 (where .Site.RegularPages "Type" "in" site.Params.mainSections) }}
<article>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<p>{{ .Date.Format "Jan 2, 2006" }}</p>
<p>{{ .Summary }}</p>
</article>
{{ end }}
{{ end }}

View file

@ -1,8 +1,6 @@
<!-- <hr /> -->
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<!-- search javascript -->
<script src="/js/search.js"></script>

View file

@ -1,6 +1,5 @@
<header id="banner">
<nav class="navbar">
<div class="nav-left">
<!-- home -->
<a href="{{ .Site.BaseURL }}" class="home">🏠</a>
<!-- menu items -->
@ -9,11 +8,7 @@
title="{{ .Title }}"
>{{- .Name -}}</a
>{{ .Post }} {{- end }}
</div>
<div class="nav-right">
{{ partial "search.html" . }}
<!-- theme toggle -->
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>

View file

@ -1,5 +0,0 @@
<ul id="results">
{{ range where site.RegularPages "Type" "in" site.Params.mainSections }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>

View file

@ -1 +0,0 @@
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>

View file

@ -1 +1 @@
<script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script><h1>uhoh 404 :/</h1>
<h1>uhoh 404 :/</h1>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/achieve-peak-rice-with-nix-colors/" />
<link rel="canonical" href="https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/" />
<title>Achieve peak rice with nix-colors</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Achieve peak rice with nix-colors</h3>
<h2>Achieve peak rice with nix-colors</h2>
<div>
<time>March 13, 2023</time>
<p>March 13, 2023</p>
</div>
</header><p>As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&rsquo;. Next thing you know you&rsquo;ve discovered <a href="https://github.com/nix-community/home-manager">home-manager</a> and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.</p>
<p><a href="https://sr.ht/~misterio/nix-colors/">Nix-colors</a> lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!</p>
@ -124,12 +124,9 @@
</span></span></code></pre></div><p>That&rsquo;s it for today. Thank you to the <a href="https://github.com/Misterio77">hero</a> that made this.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/bread-dough-for-lazy-boys/" />
<link rel="canonical" href="https://nonsense.dymc.win/bread-dough-for-lazy-boys/" />
<title>Bread dough for lazy boys</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Bread dough for lazy boys</h3>
<h2>Bread dough for lazy boys</h2>
<div>
<time>January 22, 2023</time>
<p>January 22, 2023</p>
</div>
</header><h3 id="ingredienti">INGREDIENTI</h3>
<ul>
@ -71,12 +71,9 @@
</ul>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/categories/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/categories/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/categories/" />
<link rel="canonical" href="https://nonsense.dymc.win/categories/" />
<title>Categories</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,21 +2,21 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Categories on James&#39; Blog</title>
<link>http://localhost:1313/categories/</link>
<link>https://nonsense.dymc.win/categories/</link>
<description>Recent content in Categories on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<atom:link href="http://localhost:1313/categories/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/categories/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -80,7 +80,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -111,22 +111,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -204,18 +204,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -289,10 +288,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -335,18 +334,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -430,10 +428,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -499,10 +497,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -611,10 +609,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -710,10 +708,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -764,10 +762,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -824,10 +822,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -916,10 +914,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -962,10 +960,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1042,10 +1040,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1114,7 +1112,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1122,10 +1120,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1186,10 +1184,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1262,7 +1260,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1270,10 +1268,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1296,7 +1294,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1325,10 +1323,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1363,7 +1361,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1371,10 +1369,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1437,10 +1435,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1457,7 +1455,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1473,7 +1471,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1489,10 +1487,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -12,10 +12,19 @@ body {
color: var(--fg);
padding: 0 1rem;
/* layout */
max-width: 800px;
max-width: 700px;
margin: 0 auto;
}
body a {
color: magenta;
}
body pre {
padding:1rem;
margin-bottom: 1rem;
}
/* ===== Typography ===== */
h1, h2, h3, h4 {
line-height: 1.3;
@ -24,6 +33,7 @@ h1, h2, h3, h4 {
}
p {
margin-top: 1.3rem;
margin-bottom: 1.3rem;
}
@ -37,51 +47,73 @@ img {
/* ===== Navigation ===== */
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
flex-wrap: wrap;
/* justify-content: space-between; */
/* align-items: center; */
/* padding: 1rem 0; */
/* flex-wrap: wrap; */
}
nav a {
margin: 0.5rem;
}
.home {
font-size: 24px;
margin-right: 1.5rem;
font-size: 3rem;
text-decoration: none;
}
.home {
}
.toggle-button {
font-size: 24px;
font-size: 3rem;
border: none;
background-color: var(--bg);
cursor: pointer;
}
.toggle-button:hover {
transform: scale(1.2);
}
/* .search-container { */
/* text-align: center; */
/* } */
#search {
width: 100%;
background-color: var(--bg);
color: var(--fg);
border: 1px solid var(--fg);
padding: 1rem;
margin-bottom: 1.3rem;
}
/* #results li { */
/* list-style: none; */
/* padding: 20px; */
/* font-size: 1.2rem; */
/* } */
#results li {
list-style: none;
margin-bottom: 1rem;
}
/* archive tree */
.tree, .tree ul {
list-style: none;
margin: 0;
position: relative;
}
.tree ul {
margin-left: 0.5rem;
}
.tree li {
margin: 0;
padding: 0.25rem 0 0.25rem 1rem;
position: relative;
}
.tree li::before {
content: "";
position: absolute;
top: 0;
left: 0;
border-left: 1px solid var(--fg);
border-bottom: 1px solid var(--fg);
width: 1rem;
height: 1rem;
}
footer {
padding-bottom: 20px;
text-align: center;
padding-bottom: 2rem;
}
/* ===== Responsive ===== */

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/" />
<link rel="canonical" href="https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/" />
<title>Declarative firefox config with home-manager on nixos</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Declarative firefox config with home-manager on nixos</h3>
<h2>Declarative firefox config with home-manager on nixos</h2>
<div>
<time>October 2, 2022</time>
<p>October 2, 2022</p>
</div>
</header><p>As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found <a href="https://github.com/misterio77/nix-starter-configs">this</a> friendly githubber&rsquo;s templates to be very helpful.</p>
<p>First of all you&rsquo;ll need to enable firefox with <code>programs.firefox.enable = true;</code></p>
@ -91,12 +91,9 @@
</span></span></code></pre></div><p>Of course I am sure there are many more exciting things that could be done here but this is as far as I have got. For all avilable options you can check out <a href="https://nix-community.github.io/home-manager/options.html">this</a> or alternatively run a <code>man home-configuration.nix</code>. Hope this has been helpful :)</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/" />
<link rel="canonical" href="https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/" />
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Get the thoughts out of your head and into a digital format with this python journalling script</h3>
<h2>Get the thoughts out of your head and into a digital format with this python journalling script</h2>
<div>
<time>December 1, 2022</time>
<p>December 1, 2022</p>
</div>
</header><p>Since getting going with emacs I&rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice <a href="https://github.com/bastibe/org-journal">org-journal</a> package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&rsquo;m doing something with my text editor makes it a lot more palletable.</p>
<p>Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&rsquo;s features but allow you to use whatever editor you like with markdown.</p>
@ -89,12 +89,9 @@
</span></span></code></pre></div><p>As simple as it is, it works reasonalby well as it stands. I would though like to add the ability to customise the file format you want to use so you could have org, plain text, markdown, or whatever. I&rsquo;ve got the script set to just run with a keybinding at the moment so it fulfils the immediacy I was enjoying with org-journal. You can find the script <a href="https://gitlab.com/robbygozzarder/py">here</a> atm. BYEBYE xxx</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,40 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/" />
<link rel="canonical" href="https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/" />
<title>Handy script for a more zen twitch experience</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Handy script for a more zen twitch experience</h3>
<h2>Handy script for a more zen twitch experience</h2>
<div>
<time>August 13, 2025</time>
<p>August 13, 2025</p>
</div>
</header><p>I like to watch twitch streams.
Watching them in the browser at <code>twitch.tv</code> is generally not an experience which sparks joy though.
@ -99,7 +97,7 @@ Here it is:</p>
</span></span><span class="line"><span class="cl"> <span class="c1"># get first column from selection aka stream name</span>
</span></span><span class="line"><span class="cl"> <span class="nv">meat</span><span class="o">=</span><span class="k">$(</span><span class="nb">echo</span> <span class="s2">&#34;</span><span class="nv">$choice</span><span class="s2">&#34;</span> <span class="p">|</span> awk <span class="s1">&#39;{print $1}&#39;</span><span class="k">)</span>
</span></span><span class="line"><span class="cl"> <span class="s2">&#34;</span><span class="si">${</span><span class="nv">NOTIFY</span><span class="si">}</span><span class="s2">&#34;</span> <span class="s2">&#34;twitch -- launching twitch.tv/</span><span class="nv">$meat</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"> streamlink twitch.tv/<span class="s2">&#34;</span><span class="nv">$meat</span><span class="s2">&#34;</span> 1080p60 --player <span class="s2">$&#34;{PLAYER}&#34;</span>
</span></span><span class="line"><span class="cl"> streamlink twitch.tv/<span class="s2">&#34;</span><span class="nv">$meat</span><span class="s2">&#34;</span> 1080p60 --player <span class="s2">&#34;</span><span class="si">${</span><span class="nv">PLAYER</span><span class="si">}</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">fi</span>
</span></span></code></pre></div><h3 id="what-it-does">What it does:</h3>
<ul>
@ -130,13 +128,11 @@ Here it is:</p>
<li>takes a second to talk to the internet so things don&rsquo;t launch immediately</li>
<li>have to faff with getting api key - <a href="https://dev.twitch.tv/docs/api/get-started/">how to get one btw</a></li>
</ul>
</article>
<p>Hope you enjoyed bye</p></article>
</main>
<footer id="footer">
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,88 +1,82 @@
<!doctype html>
<html lang="en"><head>
<meta name="generator" content="Hugo 0.148.2"><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta name="generator" content="Hugo 0.148.2">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/" />
<link rel="canonical" href="https://nonsense.dymc.win/" />
<title>James&#39; Blog</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<ul id="results">
<li><a href="/handy-script-for-a-more-zen-twitch-experience/">Handy script for a more zen twitch experience</a></li>
<li><a href="/over-engineered-nixos-blog-deployment-setup/">Over-engineered (?) nixos blog deployment setup</a></li>
<li><a href="/so-you-want-to-write-a-neovim-plugin-with-lua/">So you want to write a neovim plugin with lua</a></li>
<li><a href="/making-nix-colors-talk-to-neovim/">Making nix-colors talk to neovim</a></li>
<li><a href="/vanilla-javascript-theme-toggle-for-simpletons/">Vanilla javascript theme toggle for simpletons</a></li>
<li><a href="/tailscale-caddy-and-nixos-containers/">Tailscale, caddy, and nixos containers</a></li>
<li><a href="/learning-about-qtile-widgets-with-cricket/">Learning about qtile widgets with cricket</a></li>
<li><a href="/achieve-peak-rice-with-nix-colors/">Achieve peak rice with nix-colors</a></li>
<li><a href="/translating-docker-to-nix/">Translating docker to nix?!</a></li>
<li><a href="/simple-nixos-config-for-vps-static-site/">Simple nixos config for vps static site</a></li>
<li><a href="/python-podcast-scripting/">Python podcast scripting</a></li>
<li><a href="/bread-dough-for-lazy-boys/">Bread dough for lazy boys</a></li>
<li><a href="/multi-user-qtile-fiddling/">Multi user qtile fiddling</a></li>
<li><a href="/teeny-tiny-bash-fetch-script/">Teeny tiny bash fetch script</a></li>
<li><a href="/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/">Get the thoughts out of your head and into a digital format with this python journalling script</a></li>
<li><a href="/lowkey-emacs-setup-bits-and-bobs/">Lowkey emacs setup bits and bobs</a></li>
<li><a href="/the-search-for-en-passant-checkmates-2-electric-boogaloo/">The search for en passant checkmates 2: Electric Boogaloo</a></li>
<li><a href="/the-search-for-en-passant-checkmates/">The search for en passant checkmates</a></li>
<li><a href="/declarative-firefox-config-with-home-manager-on-nixos/">Declarative firefox config with home-manager on nixos</a></li>
<li><a href="/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/">Upgrade your qtile setup with a cute dropdown terminal</a></li>
<li><a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a></li>
</ul>
<article>
<h2><a href="/handy-script-for-a-more-zen-twitch-experience/">Handy script for a more zen twitch experience</a></h2>
<p>Aug 13, 2025</p>
<p><p>I like to watch twitch streams.
Watching them in the browser at <code>twitch.tv</code> is generally not an experience which sparks joy though.
I&rsquo;m buffering.
I&rsquo;m declining cookies.
I&rsquo;m getting spammed with notifications to claim a sick new overwatch skin.
There&rsquo;s a little channel point button twerking for me to click it.
You get the idea; it&rsquo;s a heavy noisy experience.</p></p>
</article>
<article>
<h2><a href="/over-engineered-nixos-blog-deployment-setup/">Over-engineered (?) nixos blog deployment setup</a></h2>
<p>Aug 11, 2025</p>
<p><p>As is traditional with people hosting their own blog I&rsquo;m going to do a post detailing EXACTLY how I&rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.</p></p>
</article>
<article>
<h2><a href="/so-you-want-to-write-a-neovim-plugin-with-lua/">So you want to write a neovim plugin with lua</a></h2>
<p>Apr 6, 2024</p>
<p><p>I&rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&rsquo;s the <a href="https://neovim.io/doc">official neovim docs</a> which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
Beyond that, the thing I found most useful was simply reading the source of some popular plugins to get an idea of how things worked.
I would recommend sticking to plugins with a smaller scope though.</p></p>
</article>
<article>
<h2><a href="/making-nix-colors-talk-to-neovim/">Making nix-colors talk to neovim</a></h2>
<p>Aug 18, 2023</p>
<p><p>I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with <a href="https://github.com/misterio77/nix-colors">nix-colors</a> so that my neovim theme would follow color changes in home-manager.</p></p>
</article>
<article>
<h2><a href="/vanilla-javascript-theme-toggle-for-simpletons/">Vanilla javascript theme toggle for simpletons</a></h2>
<p>Jun 26, 2023</p>
<p><p>Sometimes when I&rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.</p></p>
</article>
</main>
<footer id="footer">
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

File diff suppressed because one or more lines are too long

View file

@ -1,51 +1,46 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/info/" />
<link rel="canonical" href="https://nonsense.dymc.win/info/" />
<title></title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3></h3>
<h2></h2>
<div></div>
</header><p>This is a place to document bits and bobs I&rsquo;ve been up to that have interested me.
Expect linux and self-hosting tinkering, some novice programming, and maybe the occasional recipe.
I tend to be a fool so take anything written here with a pinch of salt :)</p>
<ul>
<li><a href="../index.xml">rss HERE!!</a></li>
</ul>
<p><a href="../index.xml">rss feed here!</a></p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -17,17 +17,18 @@ document.addEventListener("DOMContentLoaded", function () {
const query = searchInput.value.trim().toLowerCase();
resultsList.innerHTML = "";
if (!query) return;
if (!query) {
return;
}
// filter out posts that don't match
const matches = index.filter(
(post) =>
post.title.toLowerCase().includes(query) ||
post.content.toLowerCase().includes(query),
);
if (matches.length === 0) {
resultsList.innerHTML = "<li>No results found.</li>";
resultsList.innerHTML = "<li>You leafed too hard :/</li>";
return;
}

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/learning-about-qtile-widgets-with-cricket/" />
<link rel="canonical" href="https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/" />
<title>Learning about qtile widgets with cricket</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Learning about qtile widgets with cricket</h3>
<h2>Learning about qtile widgets with cricket</h2>
<div>
<time>April 3, 2023</time>
<p>April 3, 2023</p>
</div>
</header><p>I&rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.</p>
<p>The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&rsquo;m sure this will interest very few people but I learnt some good stuff along the way.</p>
@ -137,12 +137,9 @@
</span></span></code></pre></div><p>Happy widget writing.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/" />
<link rel="canonical" href="https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/" />
<title>Lowkey emacs setup bits and bobs</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Lowkey emacs setup bits and bobs</h3>
<h2>Lowkey emacs setup bits and bobs</h2>
<div>
<time>November 18, 2022</time>
<p>November 18, 2022</p>
</div>
</header><p>About a month ago I was a little bored and thought I&rsquo;d give emacs a go. There&rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&rsquo;s also the quite jarring default theme which wasn&rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&rsquo;ve landed on a simple little setup that I&rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.</p>
<h3 id="aesthetic-niceties">AESTHETIC NICETIES</h3>
@ -109,12 +109,9 @@
<p><img src="/image/emacs.png" alt="emacs"></p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/making-nix-colors-talk-to-neovim/" />
<link rel="canonical" href="https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/" />
<title>Making nix-colors talk to neovim</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Making nix-colors talk to neovim</h3>
<h2>Making nix-colors talk to neovim</h2>
<div>
<time>August 18, 2023</time>
<p>August 18, 2023</p>
</div>
</header><p>I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with <a href="https://github.com/misterio77/nix-colors">nix-colors</a> so that my neovim theme would follow color changes in home-manager.</p>
@ -76,15 +76,11 @@ After moving across most of my stuff I came across the problem of how to hook th
</span></span><span class="line"><span class="cl"> <span class="p">];</span>
</span></span><span class="line"><span class="cl"> <span class="p">};</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>Happy theming!</p>
</article>
</span></span></code></pre></div><p>Happy theming!</p></article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/multi-user-qtile-fiddling/" />
<link rel="canonical" href="https://nonsense.dymc.win/multi-user-qtile-fiddling/" />
<title>Multi user qtile fiddling</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Multi user qtile fiddling</h3>
<h2>Multi user qtile fiddling</h2>
<div>
<time>December 20, 2022</time>
<p>December 20, 2022</p>
</div>
</header><p>This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using <code>xdg.configFile</code>. This is what I do with my qtile <code>config.py</code>. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.</p>
<h3 id="the-nub-of-the-problem">THE NUB OF THE PROBLEM</h3>
@ -105,12 +105,9 @@
</span></span></code></pre></div><p>Of course, there are many ways that this could all be achievd but I think it&rsquo;s quite neat having it all in my one qtile config. That&rsquo;s about it for today. lots of love x</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,43 +1,43 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/over-engineered-nixos-blog-deployment-setup/" />
<link rel="canonical" href="https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/" />
<title>Over-engineered (?) nixos blog deployment setup</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Over-engineered (?) nixos blog deployment setup</h3>
<h2>Over-engineered (?) nixos blog deployment setup</h2>
<div>
<time>August 11, 2025</time>
<p>August 11, 2025</p>
</div>
</header><p>As is traditional with people hosting their own blog I&rsquo;m going to do a post detailing EXACTLY how I&rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).</p>
I have nothing better to talk about.</p>
<p>Here is a diagram I edited to illustrate (credit to xkcd I think?).</p>
<p><img src="/image/self-hosting.png" alt="self-hosting"></p>
<p>I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
@ -116,15 +116,11 @@ That&rsquo;s the directory of the git repo that the website source lives.</p>
<li>Update the <code>rev</code> and <code>sha256</code> to the new commit (this is annoying and I&rsquo;m trying to work out a good way to automate it)</li>
<li>Rebuild vps from laptop</li>
</ul>
<p>Not necessarily faster than the old rsync method but it&rsquo;s pretty damn declarative, that&rsquo;s for sure.</p>
</article>
<p>Not necessarily faster than the old rsync method but it&rsquo;s pretty damn declarative, that&rsquo;s for sure.</p></article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/posts/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/posts/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/posts/" />
<link rel="canonical" href="https://nonsense.dymc.win/posts/" />
<title>Posts</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Posts on James&#39; Blog</title>
<link>http://localhost:1313/posts/</link>
<link>https://nonsense.dymc.win/posts/</link>
<description>Recent content in Posts on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Wed, 13 Aug 2025 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/posts/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/python-podcast-scripting/" />
<link rel="canonical" href="https://nonsense.dymc.win/python-podcast-scripting/" />
<title>Python podcast scripting</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Python podcast scripting</h3>
<h2>Python podcast scripting</h2>
<div>
<time>January 24, 2023</time>
<p>January 24, 2023</p>
</div>
</header><p>I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &lsquo;podcast-player-hopping&rsquo; without success for the last couple of months trying to find something which doesn&rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:</p>
<ul>
@ -117,12 +117,9 @@
</span></span></code></pre></div><p>Of course this slightly ramshackle approach is certainly not for everyone lol but as it stands it&rsquo;s working quite nicely for me. Lots of love and happy listening :)</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/rudimentary-local-scrobbling-with-bash/" />
<link rel="canonical" href="https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/" />
<title>Rudimentary local scrobbling with bash</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Rudimentary local scrobbling with bash</h3>
<h2>Rudimentary local scrobbling with bash</h2>
<div>
<time>September 13, 2022</time>
<p>September 13, 2022</p>
</div>
</header><p>There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&rsquo;ll be talking specifically about my setup for recording the albums I&rsquo;ve been listening to.</p>
<h3 id="lets-get-down-to-business">LET&rsquo;S GET DOWN TO BUSINESS</h3>
@ -59,12 +59,9 @@
<p>Finally, disclaimer: I am a bash amateur so I hope nothing you&rsquo;ve seen here was too upsetting. Lots of love x</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,45 +1,260 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/search/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/search/" />
<link rel="canonical" href="https://nonsense.dymc.win/search/" />
<title></title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3></h3>
<div></div>
</header><h3 id="archival-data">archival data</h3>
</article>
<p>This is not a very clever search. It simply looks if the content of a post contains your query. </p>
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>
<ul id="results"></ul>
<p>Alternatively, this is everything.</p>
<ul class="tree">
<li>
<span class="folder">2025</span>
<ul>
<li>
<span class="folder">August</span>
<ul>
<li>
<a href="/handy-script-for-a-more-zen-twitch-experience/">Handy script for a more zen twitch experience</a>
</li>
<li>
<a href="/over-engineered-nixos-blog-deployment-setup/">Over-engineered (?) nixos blog deployment setup</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<span class="folder">2024</span>
<ul>
<li>
<span class="folder">April</span>
<ul>
<li>
<a href="/so-you-want-to-write-a-neovim-plugin-with-lua/">So you want to write a neovim plugin with lua</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<span class="folder">2023</span>
<ul>
<li>
<span class="folder">August</span>
<ul>
<li>
<a href="/making-nix-colors-talk-to-neovim/">Making nix-colors talk to neovim</a>
</li>
</ul>
</li>
<li>
<span class="folder">June</span>
<ul>
<li>
<a href="/vanilla-javascript-theme-toggle-for-simpletons/">Vanilla javascript theme toggle for simpletons</a>
</li>
</ul>
</li>
<li>
<span class="folder">May</span>
<ul>
<li>
<a href="/tailscale-caddy-and-nixos-containers/">Tailscale, caddy, and nixos containers</a>
</li>
</ul>
</li>
<li>
<span class="folder">April</span>
<ul>
<li>
<a href="/learning-about-qtile-widgets-with-cricket/">Learning about qtile widgets with cricket</a>
</li>
</ul>
</li>
<li>
<span class="folder">March</span>
<ul>
<li>
<a href="/achieve-peak-rice-with-nix-colors/">Achieve peak rice with nix-colors</a>
</li>
</ul>
</li>
<li>
<span class="folder">February</span>
<ul>
<li>
<a href="/translating-docker-to-nix/">Translating docker to nix?!</a>
</li>
</ul>
</li>
<li>
<span class="folder">January</span>
<ul>
<li>
<a href="/simple-nixos-config-for-vps-static-site/">Simple nixos config for vps static site</a>
</li>
<li>
<a href="/python-podcast-scripting/">Python podcast scripting</a>
</li>
<li>
<a href="/bread-dough-for-lazy-boys/">Bread dough for lazy boys</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<span class="folder">2022</span>
<ul>
<li>
<span class="folder">December</span>
<ul>
<li>
<a href="/multi-user-qtile-fiddling/">Multi user qtile fiddling</a>
</li>
<li>
<a href="/teeny-tiny-bash-fetch-script/">Teeny tiny bash fetch script</a>
</li>
<li>
<a href="/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/">Get the thoughts out of your head and into a digital format with this python journalling script</a>
</li>
</ul>
</li>
<li>
<span class="folder">November</span>
<ul>
<li>
<a href="/lowkey-emacs-setup-bits-and-bobs/">Lowkey emacs setup bits and bobs</a>
</li>
<li>
<a href="/the-search-for-en-passant-checkmates-2-electric-boogaloo/">The search for en passant checkmates 2: Electric Boogaloo</a>
</li>
</ul>
</li>
<li>
<span class="folder">October</span>
<ul>
<li>
<a href="/the-search-for-en-passant-checkmates/">The search for en passant checkmates</a>
</li>
<li>
<a href="/declarative-firefox-config-with-home-manager-on-nixos/">Declarative firefox config with home-manager on nixos</a>
</li>
</ul>
</li>
<li>
<span class="folder">September</span>
<ul>
<li>
<a href="/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/">Upgrade your qtile setup with a cute dropdown terminal</a>
</li>
<li>
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</main>
<footer id="footer">
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

1524
public/search/index.xml Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<title>http://localhost:1313/search/</title>
<link rel="canonical" href="http://localhost:1313/search/">
<meta name="robots" content="noindex">
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=http://localhost:1313/search/">
</head>
</html>

View file

@ -0,0 +1,81 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/search/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/search/" />
<title></title>
</head>
<body><header id="banner">
<nav class="navbar">
<a href="http://localhost:1313/" class="home">🏠</a>
<a
href="/info/"
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</nav>
</header>
<main id="content">
<h2>Search</h2>
<p>This is not a very clever search. It simply looks if the content of a post contains your query. </p>
<input type="text" id="search" placeholder="leaf through the archive"/>
<ul id="results"></ul>
<h2>Everything</h2>
<h3>2023</h3>
<h4><a href="/python-podcast-scripting/">Python podcast scripting</a></h4>
<h4><a href="/bread-dough-for-lazy-boys/">Bread dough for lazy boys</a></h4>
<h3>2022</h3>
<h4><a href="/multi-user-qtile-fiddling/">Multi user qtile fiddling</a></h4>
<h4><a href="/teeny-tiny-bash-fetch-script/">Teeny tiny bash fetch script</a></h4>
<h4><a href="/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/">Get the thoughts out of your head and into a digital format with this python journalling script</a></h4>
<h4><a href="/lowkey-emacs-setup-bits-and-bobs/">Lowkey emacs setup bits and bobs</a></h4>
<h4><a href="/the-search-for-en-passant-checkmates-2-electric-boogaloo/">The search for en passant checkmates 2: Electric Boogaloo</a></h4>
<h4><a href="/the-search-for-en-passant-checkmates/">The search for en passant checkmates</a></h4>
<h4><a href="/declarative-firefox-config-with-home-manager-on-nixos/">Declarative firefox config with home-manager on nixos</a></h4>
<h4><a href="/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/">Upgrade your qtile setup with a cute dropdown terminal</a></h4>
</main>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>
<script src="/js/toggle.js"></script>
</footer>
</body>
</html>

View file

@ -0,0 +1,60 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/search/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/search/" />
<title></title>
</head>
<body><header id="banner">
<nav class="navbar">
<a href="http://localhost:1313/" class="home">🏠</a>
<a
href="/info/"
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</nav>
</header>
<main id="content">
<h2>Search</h2>
<p>This is not a very clever search. It simply looks if the content of a post contains your query. </p>
<input type="text" id="search" placeholder="leaf through the archive"/>
<ul id="results"></ul>
<h2>Everything</h2>
<h3>2022</h3>
<h4><a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a></h4>
</main>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>
<script src="/js/toggle.js"></script>
</footer>
</body>
</html>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/simple-nixos-config-for-vps-static-site/" />
<link rel="canonical" href="https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/" />
<title>Simple nixos config for vps static site</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Simple nixos config for vps static site</h3>
<h2>Simple nixos config for vps static site</h2>
<div>
<time>January 29, 2023</time>
<p>January 29, 2023</p>
</div>
</header><p>Setting up a little static site is something I&rsquo;ve done a few different times on a few different operating systems. It&rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.</p>
<p>I&rsquo;m going to go through a bit of the nixos config I&rsquo;ve got for my vps.</p>
@ -85,12 +85,9 @@
</span></span></code></pre></div><p>This means I can just rsync the updated site from my laptop to the server and it&rsquo;ll be updated within the hour. Good enough for me.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,140 +2,142 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://localhost:1313/tags/bash-script-twitch/</loc>
<loc>https://nonsense.dymc.win/tags/bash-script-twitch/</loc>
<lastmod>2025-08-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</loc>
<loc>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</loc>
<lastmod>2025-08-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/</loc>
<loc>https://nonsense.dymc.win/</loc>
<lastmod>2025-08-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/posts/</loc>
<loc>https://nonsense.dymc.win/posts/</loc>
<lastmod>2025-08-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/</loc>
<loc>https://nonsense.dymc.win/tags/</loc>
<lastmod>2025-08-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/nixos/</loc>
<loc>https://nonsense.dymc.win/tags/nixos/</loc>
<lastmod>2025-08-11T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</loc>
<loc>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</loc>
<lastmod>2025-08-11T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/lua/</loc>
<loc>https://nonsense.dymc.win/tags/lua/</loc>
<lastmod>2024-04-06T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/neovim/</loc>
<loc>https://nonsense.dymc.win/tags/neovim/</loc>
<lastmod>2024-04-06T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</loc>
<loc>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</loc>
<lastmod>2024-04-06T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/home-manager/</loc>
<loc>https://nonsense.dymc.win/tags/home-manager/</loc>
<lastmod>2023-08-18T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/making-nix-colors-talk-to-neovim/</loc>
<loc>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</loc>
<lastmod>2023-08-18T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/nix-colors/</loc>
<loc>https://nonsense.dymc.win/tags/nix-colors/</loc>
<lastmod>2023-08-18T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/css/</loc>
<loc>https://nonsense.dymc.win/tags/css/</loc>
<lastmod>2023-06-26T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/javascript/</loc>
<loc>https://nonsense.dymc.win/tags/javascript/</loc>
<lastmod>2023-06-26T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</loc>
<loc>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</loc>
<lastmod>2023-06-26T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/caddy/</loc>
<loc>https://nonsense.dymc.win/tags/caddy/</loc>
<lastmod>2023-05-16T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/self-hosting/</loc>
<loc>https://nonsense.dymc.win/tags/self-hosting/</loc>
<lastmod>2023-05-16T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/tailscale/</loc>
<loc>https://nonsense.dymc.win/tags/tailscale/</loc>
<lastmod>2023-05-16T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tailscale-caddy-and-nixos-containers/</loc>
<loc>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</loc>
<lastmod>2023-05-16T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</loc>
<loc>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</loc>
<lastmod>2023-04-03T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/python/</loc>
<loc>https://nonsense.dymc.win/tags/python/</loc>
<lastmod>2023-04-03T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/qtile/</loc>
<loc>https://nonsense.dymc.win/tags/qtile/</loc>
<lastmod>2023-04-03T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/achieve-peak-rice-with-nix-colors/</loc>
<loc>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</loc>
<lastmod>2023-03-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/docker/</loc>
<loc>https://nonsense.dymc.win/tags/docker/</loc>
<lastmod>2023-02-28T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/podman/</loc>
<loc>https://nonsense.dymc.win/tags/podman/</loc>
<lastmod>2023-02-28T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/translating-docker-to-nix/</loc>
<loc>https://nonsense.dymc.win/translating-docker-to-nix/</loc>
<lastmod>2023-02-28T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/simple-nixos-config-for-vps-static-site/</loc>
<loc>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</loc>
<lastmod>2023-01-29T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/python-podcast-scripting/</loc>
<loc>https://nonsense.dymc.win/python-podcast-scripting/</loc>
<lastmod>2023-01-24T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/bread-dough-for-lazy-boys/</loc>
<loc>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</loc>
<lastmod>2023-01-22T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/cooking/</loc>
<loc>https://nonsense.dymc.win/tags/cooking/</loc>
<lastmod>2023-01-22T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/multi-user-qtile-fiddling/</loc>
<loc>https://nonsense.dymc.win/multi-user-qtile-fiddling/</loc>
<lastmod>2022-12-20T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/bash/</loc>
<loc>https://nonsense.dymc.win/tags/bash/</loc>
<lastmod>2022-12-10T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/teeny-tiny-bash-fetch-script/</loc>
<loc>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</loc>
<lastmod>2022-12-10T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</loc>
<loc>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</loc>
<lastmod>2022-12-01T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/emacs/</loc>
<loc>https://nonsense.dymc.win/tags/emacs/</loc>
<lastmod>2022-11-18T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</loc>
<loc>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</loc>
<lastmod>2022-11-18T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/chess/</loc>
<loc>https://nonsense.dymc.win/tags/chess/</loc>
<lastmod>2022-11-08T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</loc>
<loc>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</loc>
<lastmod>2022-11-08T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/the-search-for-en-passant-checkmates/</loc>
<loc>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</loc>
<lastmod>2022-10-26T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</loc>
<loc>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</loc>
<lastmod>2022-10-02T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</loc>
<loc>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</loc>
<lastmod>2022-09-23T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/tags/music/</loc>
<loc>https://nonsense.dymc.win/tags/music/</loc>
<lastmod>2022-09-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</loc>
<loc>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</loc>
<lastmod>2022-09-13T00:00:00+00:00</lastmod>
</url><url>
<loc>http://localhost:1313/info/</loc>
<loc>https://nonsense.dymc.win/info/</loc>
</url><url>
<loc>http://localhost:1313/categories/</loc>
<loc>https://nonsense.dymc.win/search/</loc>
</url><url>
<loc>https://nonsense.dymc.win/categories/</loc>
</url>
</urlset>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/" />
<link rel="canonical" href="https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/" />
<title>So you want to write a neovim plugin with lua</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>So you want to write a neovim plugin with lua</h3>
<h2>So you want to write a neovim plugin with lua</h2>
<div>
<time>April 6, 2024</time>
<p>April 6, 2024</p>
</div>
</header><p>I&rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
@ -102,12 +102,9 @@ As a little coda, this is how you can use your fancy new plugin using <a href="h
</span></span></code></pre></div><p>Hope you&rsquo;ve enjoyed.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/bash-script-twitch/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/bash-script-twitch/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/bash-script-twitch/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/bash-script-twitch/" />
<title>Bash, Script, Twitch</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Bash, Script, Twitch on James&#39; Blog</title>
<link>http://localhost:1313/tags/bash-script-twitch/</link>
<link>https://nonsense.dymc.win/tags/bash-script-twitch/</link>
<description>Recent content in Bash, Script, Twitch on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Wed, 13 Aug 2025 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/bash-script-twitch/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/bash-script-twitch/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/bash/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/bash/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/bash/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/bash/" />
<title>Bash</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Bash on James&#39; Blog</title>
<link>http://localhost:1313/tags/bash/</link>
<link>https://nonsense.dymc.win/tags/bash/</link>
<description>Recent content in Bash on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Sat, 10 Dec 2022 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/bash/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/bash/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/caddy/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/caddy/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/caddy/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/caddy/" />
<title>Caddy</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Caddy on James&#39; Blog</title>
<link>http://localhost:1313/tags/caddy/</link>
<link>https://nonsense.dymc.win/tags/caddy/</link>
<description>Recent content in Caddy on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 16 May 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/caddy/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/caddy/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/chess/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/chess/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/chess/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/chess/" />
<title>Chess</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Chess on James&#39; Blog</title>
<link>http://localhost:1313/tags/chess/</link>
<link>https://nonsense.dymc.win/tags/chess/</link>
<description>Recent content in Chess on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 08 Nov 2022 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/chess/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/chess/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/cooking/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/cooking/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/cooking/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/cooking/" />
<title>Cooking</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Cooking on James&#39; Blog</title>
<link>http://localhost:1313/tags/cooking/</link>
<link>https://nonsense.dymc.win/tags/cooking/</link>
<description>Recent content in Cooking on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Sun, 22 Jan 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/cooking/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/cooking/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/css/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/css/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/css/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/css/" />
<title>Css</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Css on James&#39; Blog</title>
<link>http://localhost:1313/tags/css/</link>
<link>https://nonsense.dymc.win/tags/css/</link>
<description>Recent content in Css on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Mon, 26 Jun 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/css/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/css/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/docker/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/docker/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/docker/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/docker/" />
<title>Docker</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Docker on James&#39; Blog</title>
<link>http://localhost:1313/tags/docker/</link>
<link>https://nonsense.dymc.win/tags/docker/</link>
<description>Recent content in Docker on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 28 Feb 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/docker/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/docker/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/emacs/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/emacs/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/emacs/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/emacs/" />
<title>Emacs</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Emacs on James&#39; Blog</title>
<link>http://localhost:1313/tags/emacs/</link>
<link>https://nonsense.dymc.win/tags/emacs/</link>
<description>Recent content in Emacs on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Fri, 18 Nov 2022 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/emacs/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/emacs/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/home-manager/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/home-manager/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/home-manager/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/home-manager/" />
<title>Home-Manager</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Home-Manager on James&#39; Blog</title>
<link>http://localhost:1313/tags/home-manager/</link>
<link>https://nonsense.dymc.win/tags/home-manager/</link>
<description>Recent content in Home-Manager on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Fri, 18 Aug 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/home-manager/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/home-manager/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/" />
<title>Tags</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Tags on James&#39; Blog</title>
<link>http://localhost:1313/tags/</link>
<link>https://nonsense.dymc.win/tags/</link>
<description>Recent content in Tags on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Wed, 13 Aug 2025 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/javascript/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/javascript/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/javascript/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/javascript/" />
<title>Javascript</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Javascript on James&#39; Blog</title>
<link>http://localhost:1313/tags/javascript/</link>
<link>https://nonsense.dymc.win/tags/javascript/</link>
<description>Recent content in Javascript on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Mon, 26 Jun 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/javascript/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/javascript/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/lua/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/lua/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/lua/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/lua/" />
<title>Lua</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Lua on James&#39; Blog</title>
<link>http://localhost:1313/tags/lua/</link>
<link>https://nonsense.dymc.win/tags/lua/</link>
<description>Recent content in Lua on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Sat, 06 Apr 2024 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/lua/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/lua/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/music/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/music/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/music/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/music/" />
<title>Music</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Music on James&#39; Blog</title>
<link>http://localhost:1313/tags/music/</link>
<link>https://nonsense.dymc.win/tags/music/</link>
<description>Recent content in Music on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 13 Sep 2022 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/music/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/music/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/neovim/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/neovim/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/neovim/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/neovim/" />
<title>Neovim</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Neovim on James&#39; Blog</title>
<link>http://localhost:1313/tags/neovim/</link>
<link>https://nonsense.dymc.win/tags/neovim/</link>
<description>Recent content in Neovim on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Sat, 06 Apr 2024 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/neovim/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/neovim/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/nix-colors/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/nix-colors/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/nix-colors/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/nix-colors/" />
<title>Nix-Colors</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Nix-Colors on James&#39; Blog</title>
<link>http://localhost:1313/tags/nix-colors/</link>
<link>https://nonsense.dymc.win/tags/nix-colors/</link>
<description>Recent content in Nix-Colors on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Fri, 18 Aug 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/nix-colors/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/nix-colors/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/nixos/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/nixos/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/nixos/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/nixos/" />
<title>Nixos</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Nixos on James&#39; Blog</title>
<link>http://localhost:1313/tags/nixos/</link>
<link>https://nonsense.dymc.win/tags/nixos/</link>
<description>Recent content in Nixos on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Mon, 11 Aug 2025 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/nixos/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/nixos/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/podman/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/podman/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/podman/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/podman/" />
<title>Podman</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Podman on James&#39; Blog</title>
<link>http://localhost:1313/tags/podman/</link>
<link>https://nonsense.dymc.win/tags/podman/</link>
<description>Recent content in Podman on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 28 Feb 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/podman/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/podman/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/python/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/python/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/python/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/python/" />
<title>Python</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Python on James&#39; Blog</title>
<link>http://localhost:1313/tags/python/</link>
<link>https://nonsense.dymc.win/tags/python/</link>
<description>Recent content in Python on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Mon, 03 Apr 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/python/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/python/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/qtile/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/qtile/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/qtile/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/qtile/" />
<title>Qtile</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Qtile on James&#39; Blog</title>
<link>http://localhost:1313/tags/qtile/</link>
<link>https://nonsense.dymc.win/tags/qtile/</link>
<description>Recent content in Qtile on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Mon, 03 Apr 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/qtile/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/qtile/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/self-hosting/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/self-hosting/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/self-hosting/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/self-hosting/" />
<title>Self-Hosting</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Self-Hosting on James&#39; Blog</title>
<link>http://localhost:1313/tags/self-hosting/</link>
<link>https://nonsense.dymc.win/tags/self-hosting/</link>
<description>Recent content in Self-Hosting on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 16 May 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/self-hosting/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/self-hosting/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,31 +1,31 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/tags/tailscale/index.xml" title="James' Blog">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link rel="alternate" type="application/rss+xml" href="https://nonsense.dymc.win/tags/tailscale/index.xml" title="James' Blog">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tags/tailscale/" />
<link rel="canonical" href="https://nonsense.dymc.win/tags/tailscale/" />
<title>Tailscale</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
@ -71,12 +71,9 @@
<a href="/rudimentary-local-scrobbling-with-bash/">Rudimentary local scrobbling with bash</a>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -2,22 +2,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Tailscale on James&#39; Blog</title>
<link>http://localhost:1313/tags/tailscale/</link>
<link>https://nonsense.dymc.win/tags/tailscale/</link>
<description>Recent content in Tailscale on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<lastBuildDate>Tue, 16 May 2023 00:00:00 +0000</lastBuildDate>
<atom:link href="http://localhost:1313/tags/tailscale/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="https://nonsense.dymc.win/tags/tailscale/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<link>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<guid>https://nonsense.dymc.win/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
@ -81,7 +81,7 @@ Here it is:&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
@ -112,22 +112,22 @@ Here it is:&lt;/p&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
&lt;p&gt;Hope you enjoyed bye&lt;/p&gt;</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
I have nothing better to talk about.&lt;/p&gt;
&lt;p&gt;Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -205,18 +205,17 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
&lt;li&gt;Update the &lt;code&gt;rev&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; to the new commit (this is annoying and I&amp;rsquo;m trying to work out a good way to automate it)&lt;/li&gt;
&lt;li&gt;Rebuild vps from laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;
</description>
&lt;p&gt;Not necessarily faster than the old rsync method but it&amp;rsquo;s pretty damn declarative, that&amp;rsquo;s for sure.&lt;/p&gt;</description>
</item>
<item>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -290,10 +289,10 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -336,18 +335,17 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;
</description>
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy theming!&lt;/p&gt;</description>
</item>
<item>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -431,10 +429,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -500,10 +498,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -612,10 +610,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<link>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<guid>https://nonsense.dymc.win/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -711,10 +709,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -765,10 +763,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -825,10 +823,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<link>https://nonsense.dymc.win/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<guid>https://nonsense.dymc.win/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
@ -917,10 +915,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<link>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<guid>https://nonsense.dymc.win/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -963,10 +961,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -1043,10 +1041,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1115,7 +1113,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1123,10 +1121,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1187,10 +1185,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<link>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1263,7 +1261,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1271,10 +1269,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1297,7 +1295,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1326,10 +1324,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<link>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<guid>https://nonsense.dymc.win/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1364,7 +1362,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
@ -1372,10 +1370,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1438,10 +1436,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1458,7 +1456,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1474,7 +1472,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1490,10 +1488,10 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/tailscale-caddy-and-nixos-containers/" />
<link rel="canonical" href="https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers/" />
<title>Tailscale, caddy, and nixos containers</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Tailscale, caddy, and nixos containers</h3>
<h2>Tailscale, caddy, and nixos containers</h2>
<div>
<time>May 16, 2023</time>
<p>May 16, 2023</p>
</div>
</header><p>For a little while now I&rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity <a href="https://tailscale.com/">tailscale</a> brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.</p>
<p>When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across <a href="https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380">this</a>. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.</p>
@ -94,12 +94,9 @@
<p>As well as solving the multiple services problem, separating services onto their own hosts is nice if you want to <a href="https://tailscale.com/kb/1084/sharing/">share</a> a particular service with someone else. I personaly feel happier just sharing one container running jellyfin rather than the whole host with multiple things on it. Anyway thanks for listening to my TED talk.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/teeny-tiny-bash-fetch-script/" />
<link rel="canonical" href="https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/" />
<title>Teeny tiny bash fetch script</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Teeny tiny bash fetch script</h3>
<h2>Teeny tiny bash fetch script</h2>
<div>
<time>December 10, 2022</time>
<p>December 10, 2022</p>
</div>
</header><p>This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&rsquo;t really try that hard with the portability). I didn&rsquo;t think much about performance; I&rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">declare</span> -A <span class="nv">fetch</span><span class="o">=(</span>
@ -105,12 +105,9 @@
<p><img src="/image/golazo.png" alt="golazo"></p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/" />
<link rel="canonical" href="https://nonsense.dymc.win/the-search-for-en-passant-checkmates-2-electric-boogaloo/" />
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>The search for en passant checkmates 2: Electric Boogaloo</h3>
<h2>The search for en passant checkmates 2: Electric Boogaloo</h2>
<div>
<time>November 8, 2022</time>
<p>November 8, 2022</p>
</div>
</header><p>Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:</p>
<ul>
@ -80,12 +80,9 @@
</span></span></code></pre></div><p>I don&rsquo;t doubt it could be done more elegantly but it works I guess. Next time, we&rsquo;ll deal with working out what a list containing an en passant checkmate would look like.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/the-search-for-en-passant-checkmates/" />
<link rel="canonical" href="https://nonsense.dymc.win/the-search-for-en-passant-checkmates/" />
<title>The search for en passant checkmates</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>The search for en passant checkmates</h3>
<h2>The search for en passant checkmates</h2>
<div>
<time>October 26, 2022</time>
<p>October 26, 2022</p>
</div>
</header><p>The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.</p>
<p>First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&rsquo;t think of any obvious way to get completely random players on the site, I used the API&rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&gt;</p>
@ -71,12 +71,9 @@
<p><img src="/image/output.webp" alt="image alt text"></p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/translating-docker-to-nix/" />
<link rel="canonical" href="https://nonsense.dymc.win/translating-docker-to-nix/" />
<title>Translating docker to nix?!</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Translating docker to nix?!</h3>
<h2>Translating docker to nix?!</h2>
<div>
<time>February 28, 2023</time>
<p>February 28, 2023</p>
</div>
</header><p>In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&rsquo;t be beat. I&rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&rsquo;ve been playing around with the nixos approach to managing docker containers.</p>
<h3 id="nix---docker-compose---docker-run">nix -&gt; docker compose -&gt; docker run</h3>
@ -79,12 +79,9 @@
<p>One final note: nix provides the option to choose between docker and podman with <code>virtualisation.oci-containers.containers.backend</code>. This defaults to podman.</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/" />
<link rel="canonical" href="https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/" />
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Upgrade your qtile setup with a cute dropdown terminal</h3>
<h2>Upgrade your qtile setup with a cute dropdown terminal</h2>
<div>
<time>September 23, 2022</time>
<p>September 23, 2022</p>
</div>
</header><p>I didn&rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">libqtile.config</span> <span class="kn">import</span> <span class="n">Dropdown</span><span class="p">,</span> <span class="n">Scratchpad</span>
@ -77,12 +77,9 @@
</span></span></code></pre></div><p>Anyway, hope this was useful, happy configurating :)</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -1,38 +1,38 @@
<!doctype html>
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="http://localhost:1313/favicon.ico">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/" />
<link rel="canonical" href="https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/" />
<title>Vanilla javascript theme toggle for simpletons</title>
</head>
<body><header id="banner">
<nav class="navbar">
<div class="nav-left">
<a href="http://localhost:1313/" class="home">~ 🏠</a>
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="--help"
>--help</a
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
</div>
<div class="nav-right">
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h3>Vanilla javascript theme toggle for simpletons</h3>
<h2>Vanilla javascript theme toggle for simpletons</h2>
<div>
<time>June 26, 2023</time>
<p>June 26, 2023</p>
</div>
</header><p>Sometimes when I&rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.</p>
<p>Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.</p>
@ -112,12 +112,9 @@
</span></span></code></pre></div><p>Hope you&rsquo;ve enjoyed. Toggle toggle toggle!</p>
</article>
</main>
<footer id="footer">
<p>-----------------</p>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>

View file

@ -12,10 +12,19 @@ body {
color: var(--fg);
padding: 0 1rem;
/* layout */
max-width: 800px;
max-width: 700px;
margin: 0 auto;
}
body a {
color: magenta;
}
body pre {
padding:1rem;
margin-bottom: 1rem;
}
/* ===== Typography ===== */
h1, h2, h3, h4 {
line-height: 1.3;
@ -24,6 +33,7 @@ h1, h2, h3, h4 {
}
p {
margin-top: 1.3rem;
margin-bottom: 1.3rem;
}
@ -37,51 +47,73 @@ img {
/* ===== Navigation ===== */
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
flex-wrap: wrap;
/* justify-content: space-between; */
/* align-items: center; */
/* padding: 1rem 0; */
/* flex-wrap: wrap; */
}
nav a {
margin: 0.5rem;
}
.home {
font-size: 24px;
margin-right: 1.5rem;
font-size: 3rem;
text-decoration: none;
}
.home {
}
.toggle-button {
font-size: 24px;
font-size: 3rem;
border: none;
background-color: var(--bg);
cursor: pointer;
}
.toggle-button:hover {
transform: scale(1.2);
}
/* .search-container { */
/* text-align: center; */
/* } */
#search {
width: 100%;
background-color: var(--bg);
color: var(--fg);
border: 1px solid var(--fg);
padding: 1rem;
margin-bottom: 1.3rem;
}
/* #results li { */
/* list-style: none; */
/* padding: 20px; */
/* font-size: 1.2rem; */
/* } */
#results li {
list-style: none;
margin-bottom: 1rem;
}
/* archive tree */
.tree, .tree ul {
list-style: none;
margin: 0;
position: relative;
}
.tree ul {
margin-left: 0.5rem;
}
.tree li {
margin: 0;
padding: 0.25rem 0 0.25rem 1rem;
position: relative;
}
.tree li::before {
content: "";
position: absolute;
top: 0;
left: 0;
border-left: 1px solid var(--fg);
border-bottom: 1px solid var(--fg);
width: 1rem;
height: 1rem;
}
footer {
padding-bottom: 20px;
text-align: center;
padding-bottom: 2rem;
}
/* ===== Responsive ===== */

View file

@ -17,17 +17,18 @@ document.addEventListener("DOMContentLoaded", function () {
const query = searchInput.value.trim().toLowerCase();
resultsList.innerHTML = "";
if (!query) return;
if (!query) {
return;
}
// filter out posts that don't match
const matches = index.filter(
(post) =>
post.title.toLowerCase().includes(query) ||
post.content.toLowerCase().includes(query),
);
if (matches.length === 0) {
resultsList.innerHTML = "<li>No results found.</li>";
resultsList.innerHTML = "<li>You leafed too hard :/</li>";
return;
}