Initial commit

This commit is contained in:
ekkie 2023-04-16 22:27:27 +02:00
commit 944a48c1ba
16 changed files with 400 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
resources/_gen
public
.hugo_build.lock

6
archetypes/blog.md Normal file
View File

@ -0,0 +1,6 @@
---
title: {{ replace .Name "-" " " }}
draft: true
date: {{ .Date }}
---

5
archetypes/default.md Normal file
View File

@ -0,0 +1,5 @@
---
title: {{ replace .Name "-" " " }}
draft: false
---

90
assets/style.sass Normal file
View File

@ -0,0 +1,90 @@
$bg: black
$fg: #e9c
$fg-link: #e2c
$fg-link-hover: #c1b
$fg-btn-hover: #e6b
body
margin: auto
padding: 1em
max-width: 64em
font-family: "courier new", monospace
color: $fg
background: $bg
word-wrap: break-word
a
text-decoration: none
color: $fg-link
font-weight: bold
&:hover
color: $fg-link-hover
h1
font-family: monospace
main
padding-top: 5px
padding-bottom: 5px
footer
text-align: center
pre, :not(pre) > code
background: $fg
color: $bg
border: solid $fg
border-radius: 0.25em
border-width: 0.2em 0.5em
pre
border-width: 0.5em 1em
input, textarea, button
background: $fg
color: $bg
border: solid $fg
border-radius: 0.25em
display: block
margin: 1em auto
max-width: 100%
button
border-radius: 1em
&:hover
background-color: $fg-btn-hover
border-color: $fg-btn-hover
nav
overflow: hidden
background-color: $fg
color: $bg
width: 100%
border-radius: 0.25em
a
float: left
display: block
color: $bg
text-align: center
padding: 14px
text-decoration: none
&:hover
background-color: $fg-btn-hover
color: $bg
article
padding: 0 1.5em
margin: 4em 0
border: dashed 1px
position: relative
.fancyboi
&::before
content: "$ "
@media (prefers-reduced-motion: no-preference)
@keyframes flash
50%
opacity: 0
@keyframes reveal
from
width: 2em
to
width: 100%
overflow: hidden
white-space: nowrap
animation: reveal 8s linear
text-overflow: ""
&::after
content: ""
animation: flash 1s step-end infinite

19
config.yaml Normal file
View File

@ -0,0 +1,19 @@
baseURL: http://tilde.club/~ekkie/
languageCode: en-us
title: catdeer haven
disableKinds:
- RSS
- sitemap
markup:
goldmark:
renderer:
unsafe: true
menu:
nav:
- name: ~tilde.club~
url: https://tilde.club/
weight: -2
- name: ~ekkie
pageRef: /
weight: -1
taxonomies: []

11
content/_index.md Normal file
View File

@ -0,0 +1,11 @@
---
title: ekkie the catdeer
draft: false
---
hello i'm ekkie the gay furry catdeer nerd.
i work as a sysadmin and spend most of my free time doing nerdy stuff on linux, playing video games, and/or doing my current hyperfixation.
**pronouns:** he/him
**other info:** tbd

7
content/blog/_index.md Normal file
View File

@ -0,0 +1,7 @@
---
title: catdeer's feels
linktitle: blog
draft: false
menu: nav
---
this is my blog sometimes new stuff appears here

View File

@ -0,0 +1,9 @@
---
title: Hello, world
draft: false
date: 2023-03-24T15:35:00+02:00
---
Hello. This is my first entry in the feels engine. I'm mostly writing this just to see what the feels engine's generated html looks like, so I adjust my style.css properly.
Unfortunately, this means that there isn't much content here, feel free to move along. <3 <3 <3

View File

@ -0,0 +1,94 @@
---
title: Weechat, but with a sane config
draft: false
date: 2023-03-25T10:35:00+02:00
---
I really like weechat. Out of all the common terminal IRC clients, it's the most intuitive and easy to use if you've set it up right. I'd argue it even holds its own against common GUI clients, like Hexchat.
However, when only considering default configuration, weechat feels clunky at best, especially when you join multiple servers. The buflist turns into a disorganized mess, the, by default, server buffers are a pain to scroll through, and even though it has such a modern-looking UI, mouse support is disabled by default.
What's worse is that weechat's config is questionable at best. When launching weechat, its entire default config is written to the user's config dir. All of it, spread out over multiple files. There are so many options that finding the right option for what you want to do becomes so difficult, asking chatgpt and/or weechat veterans often times the much more preferable option, over digging through weechat's pages upon pages of documentation.
I've used weechat many times over the years, and I know how useable it can be, but with its cryptic configs, I'm never able to remember the most essential lines in need of change. This has lead me to again and again use irssi over weechat, if only because I can't remember that weechat's shortcut to enter the "bare" mode to comfortably click/copy links or is `Alt + l` (lowercase L).
## Options in need of change
To not only make it easier for myself, but for others too, to setup weechat once again without having to lug around a tar of config files just for your irc client, I'll summarize the options that I find most important here.
### /set weechat.look.mouse on
In my opinion, one of the most baffling default options. Mouse support, even when enabled, only adds features. Being able to just click on a channel you want to switch to, like you're used to from discord or slack, is a feature I can't live without.
### /set irc.look.server_buffer independent
The default of having server buffers merged looks to me like some sort of legacy feature, since irssi has the same behaviour. However, not only does my brain work better with having a seperate buffer for each server, it's also very much necessary for the next two options:
### /set irc.look.new_channel_position near_server
### /set irc.look.new_pv_position near_server
These two options are very important to me: If you join a new channel, or a new PM buffer is opened, it'll be put under the server buffer it belongs to. Suddenly, by changing only 3 options, 2 of them being basically the same, the weechat buflist mirrors the tree-like list in, for example, hexchat, without installing any sort of plugin. Weechat is even smart enough to keep channel buffers above PM buffers!
## Options in less of a need of change
These options are far less necessary, in part even just purely aesthetic, but I still like them very much.
### /set buflist.format.buffer " ${indent}${format_nick_prefix}${color_hotlist}${format_name} "
This option determines how the entries in the buflist are formated. I've made 2 changes from the default here:
1. Remove the buffer number. I only use `Alt + Arrows` and the mouse to switch channels, so having the numbers displayed is distracting for me at best.
2. Add a space at the front and back. I have big screens, so I can use some screen real-estate to make the buflist feel a little less cramped.
### /set buflist.format.indent " ╰"
Oooo, fancy unicode~ This option is used to indent channels and PMs in the buflist. It's just two spaces by default. I've decided to add this little rounded corner from unicode's box-drawing characters to further solidify the "tree like list" feel of my buflist.
### /set irc.server_default.ipv6 off
This one is a little weird. I mostly use weechat in a screen session on tilde.club, and while doing some first testing, connecting to libera.chat produced some... weird results with this set to on. Ident-check wouldn't work, libera would complain about too many connections... This one magically fixed it, but I imagine I'll have to remove that once ipv6 entirely replaces ipv4, which is totally going to happen.
### /set irc.server_default.ssl on
Once again one of these questionable defaults. Nowadays, coming across an irc server without ssl/tls is the uncommon option, so changing this default option just makes setting up a new server a little bit easier.
### /set irc.server_default.msg_part ""
### /set irc.server_default.msg_quit ""
By default, these tell everyone that you're using weechat when leaving. I like weechat, but not enough to rub it into everyone's face, so I like to clear those.
## Listing all options that differ from default
```
/fset d
```
That's it. This little command was instrumental in writing this blog post, and I have FlashCode from libera's #weechat channel to thank for pointing it out to me.
## Get rid of colors, buf list, channel list, etc to copy stuff easier
I've mentioned it earlier, but I feel like writing a section just for this. Weechat calls it bare-mode, and I keep remembering it as raw-mode, making successful searches rather difficult. The keyboard shortcut is `Alt + l` (lowercase L), and you use the same shortcut to leave that mode.
## Adding servers
I'm rather forgetful, and read-lazy, so instead of reading through the help/remember a bunch of options, I add servers by first proving as little information as possible, then open fset to scroll through options I need to change:
```
/server add libera libera.chat/6697
/fset server.libera
```
For libera specifically, all I needed to do was slap my username and password into the sasl config to get authenticated while connecting, SSL was already enabled thanks to one of the options from before.

View File

@ -0,0 +1,58 @@
---
title: Downloading MP3s from Youtube and getting the metadata right
draft: false
date: 2023-03-30T10:35:00+02:00
---
So, for the geekier people out there, there's a really neat tool to download youtube videos and do a whole bunch of fancy formatting from the command line: `youtube-dl`. This, however, tends to break every now and then and is slow to update. In comes `yt-dlp`, a fork that gets more frequent updates, does some fancy User-Agent stuff to not get throttled, and probably has some other features over it's predecesor.
One neat function these tools have is to wrangle downloaded videos into mp3s, even adding metadata it can find.
This is nice and all, but it only really comes together when you realize one thing: Youtube Music is just a frontend for Youtube. You can notice that easily by just looking at the URL when you're viewing an album on Youtube Music: It's just a playlist, nothing more, and `yt-dlp` can download all videos in a playlist.
However, getting all the options right for `yt-dlp` to download an album's worth of music and add in the right metadata including the cover art is a bit of an ordeal, considering that tool is meant to be much more general purpose. So, I've spent a day or two getting it mostly right:
```
yt-dlp \
--replace-in-metadata uploader ' - Topic' '' \
--parse-metadata '%(playlist_index)s:%(meta_track)s' --parse-metadata '%(uploader)s:%(meta_album_artist)s' --embed-metadata \
--embed-thumbnail --ppa "EmbedThumbnail+ffmpeg_o:-c:v mjpeg -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\"" \
--yes-playlist --format 'bestaudio/best' --extract-audio --audio-format mp3 --audio-quality 0 \
--windows-filenames --force-overwrites -o '%(uploader)s/%(album)s/%(playlist_index)s - %(title)s.%(ext)s' \
--print '%(uploader)s - %(album)s - %(playlist_index)s %(title)s' --no-simulate "$@"
```
You can just stuff this overly long command into a shell script and give it the link to a playlist (read: youtube music album) and it'll download, convert and tag everything for you. It'll even store everything in a neat folder structure that coincidentally is perfect for media servers like Jellyfin: `<album artist>/<album>/<track nr> - <title>.mp3`
## Cool, but what does that wall of options actually do?
### --replace-in-metadata uploader ' - Topic' '' \
This first line of options uses a pretty neat function: Using yt-dlp, you can basically run `sed` over any metadata `yt-dlp` managed to extract. Since for some reason youtube likes to add " - Topic" to the end of artist's channels, this line simply removes that.
### --parse-metadata '%(playlist_index)s:%(meta_track)s' --parse-metadata '%(uploader)s:%(meta_album_artist)s' --embed-metadata \
This one does some further metadata-magic: It tells `yt-dlp` to use the playlist index as the track number and the uploader (which we previously "fixed") as the album artist, since Youtube basically never sets that one like ever. This does break sometimes, I've noticed it choke on DMC5's and Metal Gear Rising's soundtrack. With that last option, `yt-dlp` actually embeds the metadata into the finished files.
### --embed-thumbnail --ppa "EmbedThumbnail+ffmpeg_o:-c:v mjpeg -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\"" \
This line is pure magic: the first option simply embeds the thumbnail, which unfortunately isn't square, as cover art should be, but the second option fixes just that. I'm not nearly well-versed enough in `ffmpeg`'s cryptic options to understand what's going on, I'm just glad it works.
### --yes-playlist --format 'bestaudio/best' --extract-audio --audio-format mp3 --audio-quality 0 \
Here's just some basic format selection. Basically, if you give it a link to a video in a playlist, it'll download the whole playlist instead of just the one video. Also it's told to get the best audio it can and that you want to end up with an mp3 file.
### --windows-filenames --force-overwrites -o '%(uploader)s/%(album)s/%(playlist_index)s - %(title)s.%(ext)s' \
This is where the fancy folder structure happens. I've chosen to force yt-dlp to use windows compatible filenames, just for a little extra compatibility.
### --print '%(uploader)s - %(album)s - %(playlist_index)s %(title)s' --no-simulate "$@"
Now this line exists to fix the horribly verbose output of yt-dlp. This way, you'll only see errors, warnings, and one line per downloaded video, allowing you to preview the folder structure in case some metadata is set wrong.

12
content/sitelen.md Normal file
View File

@ -0,0 +1,12 @@
---
title: super fancy sitelen pona generator
draft: false
menu: nav
linktitle: sitelen gen
---
Type in some text, press the button, and out comes fancy sitelen-pona. This is using [sitelen seli kiwen](https://www.kreativekorp.com/software/fonts/sitelenselikiwen/), a font with some really fancy ligatures. [Here's an example of what this toy can do](/~ekkie/sitelen.cgi?text=lanpan+pan%2C+lanpan+pan%2C+lanpan+moku+pan%0D%0Alanpan+la+mi+pilin+jan+li+sona+ala+e+tan%0D%0Ajan+li+wile+ala+pana+la+mi+wile+kama+lanpan%0D%0Alanpan+moku+pan+pan+pan)
<form action="/~ekkie/sitelen.cgi" method="get">
<textarea id="text" name="text" cols="80" required></textarea>
<button type="submit">Generate</button>
</form>

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ .Site.Title }} - {{ .Title }}</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{- $css := resources.Get "style.sass" | resources.ToCSS }}
<link rel="stylesheet" href="{{ $css.Permalink }}">
</head>
<body>
<nav>
{{- range site.Menus.nav }}
<a href="{{ .URL }}">{{.Name}}</a>
{{- end }}
</nav>
<header><h1 class="fancyboi">{{ .Title }}</h1></header>
<main>
{{- block "main" . }}{{- end }}
</main>
<!-- Begin Badges -->
<footer>
<a href="http://tilde.club"><img src="http://tilde.club/~zarate/tildeclub.gif" width="88" height="31" alt="Tilde Club Badge"></a>
<a href="https://cyber.dabamos.de/88x31/"><img src="https://cyber.dabamos.de/88x31/88x31.gif" width="88" height="31" alt="88x31"></a>
<img src="https://cyber.dabamos.de/88x31/1999x.gif" width="88" height="31" alt="199x">
<img src="https://cyber.dabamos.de/88x31/acab.gif" width="88" height="31" alt="acab">
<img src="https://cyber.dabamos.de/88x31/anarchynow.gif" width="88" height="31" alt="anarchynow">
<a href="https://archlinux.org/"><img src="https://cyber.dabamos.de/88x31/archlinux.gif" width="88" height="31" alt="anarchynow"></a>
<img src="https://cyber.dabamos.de/88x31/fursona.gif" width="88" height="31" alt="fursona">
<img src="https://cyber.dabamos.de/88x31/gaywebring.gif" width="88" height="31" alt="gaywebring">
<img src="https://cyber.dabamos.de/88x31/pride.gif" width="88" height="31" alt="pride">
<img src="https://cyber.dabamos.de/88x31/vim_a.gif" width="88" height="31" alt="vim_a">
</footer>
<!-- End Badges -->
</body>
</html>

View File

@ -0,0 +1,11 @@
{{- define "main" }}
{{ .Content }}
{{ range .Pages }}
<article>
<h5>{{ .Date.Format "02 January 2006" | lower }}</h5>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<p>{{ .Summary }}</p>
<p>...</p>
</article>
{{ end }}
{{- end }}

View File

@ -0,0 +1,3 @@
{{- define "main" }}
{{ .Content }}
{{- end }}

1
layouts/index.html Symbolic link
View File

@ -0,0 +1 @@
_default/single.html

36
static/sitelen.cgi Executable file
View File

@ -0,0 +1,36 @@
#!/home/ekkie/venvs/sitelen-gen/bin/python3
import sys
import os
from urllib.parse import parse_qs
from PIL import Image, ImageDraw, ImageFont
font_file = "/home/ekkie/files/sitelenselikiwenasuki.ttf"
font_size = 72
stroke_width = int(font_size * 0.03)
def main(text):
font = ImageFont.truetype(font_file, size=font_size)
image = Image.new('RGB', (1, 1), color='white')
draw = ImageDraw.Draw(image)
_, _, w, h = draw.textbbox((0, 0), text, font=font)
image = Image.new('RGBA', (w+font_size, h+font_size), (0, 0, 0, 0))
draw = ImageDraw.Draw(image)
draw.text(
(int(font_size/2), int(font_size/2)), text, font=font, fill='white',
stroke_fill='black', stroke_width=stroke_width)
image.crop(image.getbbox()).save(sys.stdout.buffer, 'PNG')
if __name__ == "__main__":
text = os.environ.get("QUERY_STRING", "")
text = parse_qs(text).get("text", None)
text = text[0].replace("\r", "") if text else text
if not text:
print("Status: 400 Bad Request")
print("Content-Type: text/plain")
print()
print("Please provide a text query parameter")
else:
print("Content-Type: image/png\n", flush=True)
main(text)