aboutsummaryrefslogtreecommitdiff
path: root/content/notes
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2023-11-01 22:54:27 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2023-11-01 22:54:27 +0100
commit2417a6b7603524dc5cd30d29b153f91024b9443d (patch)
tree9be5ea8e5baba96dd9159217da6badf6157fb595 /content/notes
parent89ba3497f07a8ea43d209b583f39fcc286acc923 (diff)
downloadmitjafelicijan.com-2417a6b7603524dc5cd30d29b153f91024b9443d.tar.gz
Move to Jekyll
Diffstat (limited to 'content/notes')
-rw-r--r--content/notes/2023-05-01-cachebusting-in-hugo.md17
-rw-r--r--content/notes/2023-05-05-run-9front-in-qemu.md28
-rw-r--r--content/notes/2023-05-06-git-push-multiple-origins.md17
-rw-r--r--content/notes/2023-05-07-mount-plan9-over-network.md23
-rw-r--r--content/notes/2023-05-08-write-iso-usb.md15
-rw-r--r--content/notes/2023-05-09-catv-weechat-config.md21
-rw-r--r--content/notes/2023-05-10-plan9-screenshot.md22
-rw-r--r--content/notes/2023-05-11-fix-plan9-bootloader.md20
-rw-r--r--content/notes/2023-05-12-install-plan9port-linux.md21
-rw-r--r--content/notes/2023-05-13-download-youtube-videos.md25
-rw-r--r--content/notes/2023-05-14-convert-mkv.md22
-rw-r--r--content/notes/2023-05-15-preview-troff-man-pages.md20
-rw-r--r--content/notes/2023-05-16-mass-set-permission.md16
-rw-r--r--content/notes/2023-05-22-non-blocking-shell-exec-csharp.md44
-rw-r--r--content/notes/2023-05-23-extend-lua-with-custom-c.md54
-rw-r--r--content/notes/2023-05-23-parse-rss-with-lua.md40
-rw-r--r--content/notes/2023-05-24-fresh-9front-desktop.md14
-rw-r--r--content/notes/2023-05-25-dcss-new-player-guide.md98
-rw-r--r--content/notes/2023-05-25-show-xterm-colors.md84
-rw-r--r--content/notes/2023-05-25-tmux-sane-defaults.md37
-rw-r--r--content/notes/2023-05-27-cronjobs-github-with-actions.md33
-rw-r--r--content/notes/2023-05-27-dcss-on-4k-displays.md30
-rw-r--r--content/notes/2023-05-27-drawing-pixels-in-plan9.md83
-rw-r--r--content/notes/2023-05-28-easy-time-took-in-bash.md25
-rw-r--r--content/notes/2023-05-29-grep-to-less-maintain-colors.md25
-rw-r--r--content/notes/2023-05-31-extending-dte-editor.md52
-rw-r--r--content/notes/2023-06-01-ewd-manuscripts-ebook.md22
-rw-r--r--content/notes/2023-06-04-bulk-make-thumbnails.md21
-rw-r--r--content/notes/2023-06-21-presentations-with-markdown.md78
-rw-r--r--content/notes/2023-06-24-making-cgit-look-nicer.md206
-rw-r--r--content/notes/2023-06-25-alacritty-open-links-with-modifier.md35
-rw-r--r--content/notes/2023-06-25-development-environments-with-nix.md68
-rw-r--r--content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md25
-rw-r--r--content/notes/2023-06-29-60s-ibm-computers-commercial.md17
-rw-r--r--content/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md15
-rw-r--r--content/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md70
-rw-r--r--content/notes/2023-08-05-floods-in-slovenia.md19
-rw-r--r--content/notes/2023-09-18-aws-eb-pyyaml-fix.md35
-rw-r--r--content/notes/2023-09-25-compile-drawterm-on-fedora-38.md23
39 files changed, 0 insertions, 1520 deletions
diff --git a/content/notes/2023-05-01-cachebusting-in-hugo.md b/content/notes/2023-05-01-cachebusting-in-hugo.md
deleted file mode 100644
index b889d6b..0000000
--- a/content/notes/2023-05-01-cachebusting-in-hugo.md
+++ /dev/null
@@ -1,17 +0,0 @@
1---
2title: Cache busting in Hugo
3url: cachebusting-in-hugo.html
4date: 2023-05-01T12:00:00+02:00
5type: note
6draft: false
7tags: [hugo]
8---
9
10```html
11{{ $cachebuster := delimit (shuffle (split (md5 "6fab11c6669976d759d2992eff1dd5be") "" )) "" }}
12
13<link rel="stylesheet" href="/style.css?v={{ $cachebuster }}">
14```
15
16This `6fab11c6669976d759d2992eff1dd5be` can be random string you generate use.
17You can use whatever you want.
diff --git a/content/notes/2023-05-05-run-9front-in-qemu.md b/content/notes/2023-05-05-run-9front-in-qemu.md
deleted file mode 100644
index b4f3de4..0000000
--- a/content/notes/2023-05-05-run-9front-in-qemu.md
+++ /dev/null
@@ -1,28 +0,0 @@
1---
2title: Run 9front in Qemu
3url: run-9front-in-qemu.html
4date: 2023-05-05T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9, qemu]
8---
9
10Run 9front in Qemu. This applies to [Plan9](https://9p.io/plan9/) and
11[9front](https://9front.org/).
12
13Download from here http://9front.org/iso/.
14
15```sh
16# Create a qcow2 image.
17qemu-img create -f qcow2 $HOME/VM/9front.qcow2.img 30G
18
19# Run the VM.
20qemu-system-x86_64 -cpu host -enable-kvm -m 1024 \
21 -net nic,model=virtio,macaddr=52:54:00:00:EE:03 -net user \
22 -device virtio-scsi-pci,id=scsi \
23 -drive if=none,id=vd0,file=$HOME/VM/9front.qcow2.img \
24 -device scsi-hd,drive=vd0 \
25 -drive if=none,id=vd1,file=$HOME/VM/ISO/9front.386.iso \
26 -device scsi-cd,drive=vd1,bootindex=0
27```
28
diff --git a/content/notes/2023-05-06-git-push-multiple-origins.md b/content/notes/2023-05-06-git-push-multiple-origins.md
deleted file mode 100644
index 2e96a00..0000000
--- a/content/notes/2023-05-06-git-push-multiple-origins.md
+++ /dev/null
@@ -1,17 +0,0 @@
1---
2title: Push to multiple origins at once in Git
3url: git-push-multiple-origins.html
4date: 2023-05-06T12:00:00+02:00
5type: note
6draft: false
7tags: [git]
8---
9
10Sometimes you want to push to multiple origins at once. This is useful if you
11have a mirror of your repository on another server. You can do this by adding
12multiple push urls to your git config. This is a shorthand for command above.
13
14```sh
15git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"'
16```
17
diff --git a/content/notes/2023-05-07-mount-plan9-over-network.md b/content/notes/2023-05-07-mount-plan9-over-network.md
deleted file mode 100644
index bb83202..0000000
--- a/content/notes/2023-05-07-mount-plan9-over-network.md
+++ /dev/null
@@ -1,23 +0,0 @@
1---
2title: Mount Plan9 over network
3url: mount-plan9-over-network.html
4date: 2023-05-07T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9]
8---
9
10- First install libfuse with sudo apt install libfuse-dev.
11- Then clone https://github.com/ftrvxmtrx/9pfs and compile it with make.
12- Copy 9pfs to your path.
13
14```sh
15# On Plan9 side
16ip/ipconfig # enables network
17aux/listen1 -tv tcp!*!9999 /bin/exportfs -r tmp # export tmp folder
18
19# On Linux side
209pfs 172.18.0.1 -p 9999 local_folder # mount
21umount local_folder # unmount
22```
23
diff --git a/content/notes/2023-05-08-write-iso-usb.md b/content/notes/2023-05-08-write-iso-usb.md
deleted file mode 100644
index 03b2c11..0000000
--- a/content/notes/2023-05-08-write-iso-usb.md
+++ /dev/null
@@ -1,15 +0,0 @@
1---
2title: Write ISO to USB Key
3url: write-iso-usb.html
4date: 2023-05-08T12:00:00+02:00
5type: note
6draft: false
7tags: [linux]
8---
9
10Write ISO to USB key. Nothing fancy here.
11
12```sh
13sudo dd if=iso_file.iso of=/dev/sdX bs=4M status=progress conv=fdatasync
14```
15
diff --git a/content/notes/2023-05-09-catv-weechat-config.md b/content/notes/2023-05-09-catv-weechat-config.md
deleted file mode 100644
index b730492..0000000
--- a/content/notes/2023-05-09-catv-weechat-config.md
+++ /dev/null
@@ -1,21 +0,0 @@
1---
2title: "#cat-v on weechat configuration"
3url: catv-weechat-config.html
4date: 2023-05-09T12:00:00+02:00
5type: note
6draft: false
7tags: [irc]
8---
9
10Set up weechat to connect to #cat-v on oftc. This applies to
11[weechat](https://weechat.org/) but should be similar for other irc clients.
12
13```sh
14# Install weechat and launch it and execute the following commands.
15
16/server add oftc irc.oftc.net -tls
17/set irc.server.oftc.autoconnect on
18/set irc.server.oftc.autojoin "#cat-v"
19/set irc.server.oftc.nicks "nick1,nick2,nick3"
20```
21
diff --git a/content/notes/2023-05-10-plan9-screenshot.md b/content/notes/2023-05-10-plan9-screenshot.md
deleted file mode 100644
index b3ffae3..0000000
--- a/content/notes/2023-05-10-plan9-screenshot.md
+++ /dev/null
@@ -1,22 +0,0 @@
1---
2title: Take a screenshot in Plan9
3url: plan9-screenshot.html
4date: 2023-05-10T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9]
8---
9
10Take a screenshot in Plan9. This applies to [Plan9](https://9p.io/plan9/) and
11[9front](https://9front.org/). This will take a screenshot of the screen and
12output it to `/dev/screen`. You can then use `topng` to convert it to a png
13image.
14
15```sh
16# Instant screenshot.
17cat /dev/screen | topng > screen.png
18
19# Delayed screenshot (5 seconds).
20sleep 5; cat /dev/screen | topng > screen.png
21```
22
diff --git a/content/notes/2023-05-11-fix-plan9-bootloader.md b/content/notes/2023-05-11-fix-plan9-bootloader.md
deleted file mode 100644
index b70d42d..0000000
--- a/content/notes/2023-05-11-fix-plan9-bootloader.md
+++ /dev/null
@@ -1,20 +0,0 @@
1---
2title: Fix bootloader not being written in Plan9
3url: fix-plan9-bootloader.html
4date: 2023-05-11T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9]
8---
9
10If the bootloader is not being written to a disk when installing 9front on real
11harware try clearing first sector of the disk with the following command.
12
13```sh
14dd if=/dev/zero of=/dev/sdX bs=512 count=1
15
16# If command above doesn't work try this one, wait couple of seconds and
17# press delete key to stop the command.
18cat </dev/zero >/dev/sd*/data
19```
20
diff --git a/content/notes/2023-05-12-install-plan9port-linux.md b/content/notes/2023-05-12-install-plan9port-linux.md
deleted file mode 100644
index 49a1e4c..0000000
--- a/content/notes/2023-05-12-install-plan9port-linux.md
+++ /dev/null
@@ -1,21 +0,0 @@
1---
2title: Install Plan9port on Linux
3url: install-plan9port-linux.html
4date: 2023-05-12T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9]
8---
9
10Install Plan9port on Linux. This applies to
11[Plan9port](https://9fans.github.io/plan9port/). This is a port of many Plan 9
12programs to Unix-like operating systems. Useful for programs like `9term` and
13`rc`.
14
15```sh
16sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev
17git clone https://github.com/9fans/plan9port $HOME/plan9
18cd $HOME/plan9/plan9port
19./INSTALL -r $HOME/plan9
20```
21
diff --git a/content/notes/2023-05-13-download-youtube-videos.md b/content/notes/2023-05-13-download-youtube-videos.md
deleted file mode 100644
index 33fff05..0000000
--- a/content/notes/2023-05-13-download-youtube-videos.md
+++ /dev/null
@@ -1,25 +0,0 @@
1---
2title: Download list of YouTube files
3url: download-youtube-videos.html
4date: 2023-05-13T12:00:00+02:00
5type: note
6draft: false
7tags: [youtube]
8---
9
10If you need to download a list of YouTube videos and don't want to download the
11actual YouTube list (which `yt-dlp` supports), you can use the following method.
12
13```js
14// Used to get list of raw URL's from YouTube's video tab'.
15// Copy them into videos.txt.
16document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href))
17```
18
19Download and install https://github.com/yt-dlp/yt-dlp.
20
21```sh
22# This will download all videos in videos.txt.
23yt-dlp --batch-file videos.txt -N `nproc` -f webm
24```
25
diff --git a/content/notes/2023-05-14-convert-mkv.md b/content/notes/2023-05-14-convert-mkv.md
deleted file mode 100644
index 2219eed..0000000
--- a/content/notes/2023-05-14-convert-mkv.md
+++ /dev/null
@@ -1,22 +0,0 @@
1---
2title: Convert all MKV files into other formats
3url: convert-mkv.html
4date: 2023-05-14T12:00:00+02:00
5type: note
6draft: false
7tags: [ffmpeg]
8---
9
10You will need `ffmpeg` installed on your system. This will convert all MKV files
11into WebM format.
12
13```sh
14# Convert all MKV files into WebM format.
15find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \;
16```
17
18```sh
19# Convert all MKV files into MP4 format.
20find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \;
21```
22
diff --git a/content/notes/2023-05-15-preview-troff-man-pages.md b/content/notes/2023-05-15-preview-troff-man-pages.md
deleted file mode 100644
index 330ce51..0000000
--- a/content/notes/2023-05-15-preview-troff-man-pages.md
+++ /dev/null
@@ -1,20 +0,0 @@
1---
2title: Previews how man page written in Troff will look like
3url: preview-troff-man-pages.html
4date: 2023-05-15T12:00:00+02:00
5type: note
6draft: false
7tags: [troff]
8---
9
10Troff is used to write man pages and it is difficult to read it so this will
11preview how it will look like when it is rendered.
12
13```sh
14# On Linux system.
15groff -man -Tascii filename
16
17# On Plan9 system.
18man 1 filename
19```
20
diff --git a/content/notes/2023-05-16-mass-set-permission.md b/content/notes/2023-05-16-mass-set-permission.md
deleted file mode 100644
index 4891ba8..0000000
--- a/content/notes/2023-05-16-mass-set-permission.md
+++ /dev/null
@@ -1,16 +0,0 @@
1---
2title: Change permissions of matching files recursively
3url: mass-set-permission.html
4date: 2023-05-16T12:00:00+02:00
5type: note
6draft: false
7tags: [linux]
8---
9
10Replace `*.xml` with your pattern. This will remove executable bit from all
11files matching the pattern. Change `+` to `-` to add executable bit.
12
13```sh
14find . -type f -name "*.xml" -exec chmod -x {} +
15```
16
diff --git a/content/notes/2023-05-22-non-blocking-shell-exec-csharp.md b/content/notes/2023-05-22-non-blocking-shell-exec-csharp.md
deleted file mode 100644
index ffad85c..0000000
--- a/content/notes/2023-05-22-non-blocking-shell-exec-csharp.md
+++ /dev/null
@@ -1,44 +0,0 @@
1---
2title: Execute not blocking async shell command in C#
3url: non-blocking-shell-exec-csharp.html
4date: 2023-05-22T12:00:00+02:00
5type: note
6draft: false
7tags: [csharp]
8---
9
10Execute a shell command in async in C# while not blocking the UI thread.
11
12```c#
13private async Task executeCopyCommand()
14{
15 await Task.Run(() =>
16 {
17 var processStartInfo = new ProcessStartInfo("cmd", "/c dir")
18 {
19 RedirectStandardOutput = true,
20 UseShellExecute = false,
21 CreateNoWindow = true
22 };
23
24 var process = new Process
25 {
26 StartInfo = processStartInfo
27 };
28
29 process.Start();
30 process.WaitForExit();
31 });
32}
33```
34
35Make sure that `async` is present in the function definition and `await` is used
36in the method that calls `executeCopyCommand()`.
37
38```c#
39private async void button_Click(object sender, EventArgs e)
40{
41 await executeCopyCommand();
42}
43```
44
diff --git a/content/notes/2023-05-23-extend-lua-with-custom-c.md b/content/notes/2023-05-23-extend-lua-with-custom-c.md
deleted file mode 100644
index 554a6a4..0000000
--- a/content/notes/2023-05-23-extend-lua-with-custom-c.md
+++ /dev/null
@@ -1,54 +0,0 @@
1---
2title: Extend Lua with custom C functions using Clang
3url: extend-lua-with-custom-c.html
4date: 2023-05-23T12:00:00+02:00
5type: note
6draft: false
7tags: [lua, c]
8---
9
10Here is a boilerplate for extending Lua with custom C functions. This requires
11Clang and Lua 5.1 to be installed. GCC can be used instead of Clang, but the
12Makefile will need to be modified.
13
14- nativefunc.c
15
16 ```c
17 #include <lua.h>
18 #include <lauxlib.h>
19
20 static int l_mult50(lua_State *L) {
21 double number = luaL_checknumber(L, 1);
22 lua_pushnumber(L, number * 50);
23 return 1;
24 }
25
26 int luaopen_nativefunc(lua_State *L) {
27 static const struct luaL_Reg nativeFuncLib[] = {{"mult50", l_mult50}, {NULL, NULL}};
28
29 luaL_register(L, "nativelib", nativeFuncLib);
30 return 1;
31 }
32 ```
33
34- main.lua
35
36 ```lua
37 require "nativefunc"
38 print(nativelib.mult50(50))
39 ```
40
41- Makefile
42
43 ```Makefile
44 CC = clang
45 CFLAGS =
46 INCLUDES = `pkg-config lua5.1 --cflags-only-I`
47
48 all:
49 $(CC) -shared -o nativefunc.so -fPIC nativefunc.c $(CFLAGS) $(INCLUDES)
50
51 clean:
52 rm *.so
53 ```
54
diff --git a/content/notes/2023-05-23-parse-rss-with-lua.md b/content/notes/2023-05-23-parse-rss-with-lua.md
deleted file mode 100644
index ecd33d5..0000000
--- a/content/notes/2023-05-23-parse-rss-with-lua.md
+++ /dev/null
@@ -1,40 +0,0 @@
1---
2title: Parse RSS feeds with Lua
3url: parse-rss-with-lua.html
4date: 2023-05-23T12:00:00+02:00
5type: note
6draft: false
7tags: [lua, rss]
8---
9
10Example of parsing RSS feeds with Lua. Before running the script install:
11
12- feedparser with `luarocks install feedparser`
13- luasocket with `luarocks install luasocket`
14
15```lua
16local http = require("socket.http")
17local feedparser = require("feedparser")
18
19local feed_url = "https://mitjafelicijan.com/index.xml"
20
21local response, status, _ = http.request(feed_url)
22if status == 200 then
23 local parsed = feedparser.parse(response)
24
25 -- Print out feed details.
26 print("> Title ", parsed.feed.title)
27 print("> Author ", parsed.feed.author)
28 print("> ID ", parsed.feed.id)
29 print("> Entries ", #parsed.entries)
30
31 for _, item in ipairs(parsed.entries) do
32 print("GUID ", item.guid)
33 print("Title ", item.title)
34 print("Link ", item.link)
35 print("Summary ", item.summary)
36 end
37else
38 print("! Request failed. Status:", status)
39end
40```
diff --git a/content/notes/2023-05-24-fresh-9front-desktop.md b/content/notes/2023-05-24-fresh-9front-desktop.md
deleted file mode 100644
index 21d8d93..0000000
--- a/content/notes/2023-05-24-fresh-9front-desktop.md
+++ /dev/null
@@ -1,14 +0,0 @@
1---
2title: My brand new Plan9/9front desktop
3url: fresh-9front-desktop.html
4date: 2023-05-24T12:00:00+02:00
5type: note
6draft: false
7tags: [plan9]
8---
9
10I have been experimenting with Plan9/9front for a week now. Noice! This is how
11my desktop looks like.
12
13![9front desktop](/notes/9front-desktop.png)
14
diff --git a/content/notes/2023-05-25-dcss-new-player-guide.md b/content/notes/2023-05-25-dcss-new-player-guide.md
deleted file mode 100644
index ff8493c..0000000
--- a/content/notes/2023-05-25-dcss-new-player-guide.md
+++ /dev/null
@@ -1,98 +0,0 @@
1---
2title: Dungeon Crawl Stone Soup - New player guide
3url: dcss-new-player-guide.html
4date: 2023-05-25T22:00:00+02:00
5type: note
6draft: false
7tags: [dcss]
8---
9
10An amazing game deserves an amazing guide. All this material can be find in some
11form on another on [craw's](https://github.com/crawl/crawl) official repository.
12
13- [DCSS Quickstart](/notes/dcss-quickstart.pdf) - Very short introduction to the
14 game
15- [DCSS Manual](/notes/dcss_manual.pdf) - Extensive manual about the game
16
17![Dungeon Crawl Stone Soup](/notes/dcss.jpg)
18
19**Movement and Exploration**
20
21- You can move around with the numpad (try numlock on and off), vi-keys, or
22 clicking with the mouse. Arrow keys work, though you can't move diagonally
23 with them. Pressing Shift and a direction will move until you see/hit
24 something.
25- Pressing `>` will take you down a staircase, and `<` to go up a staircase.
26- You can open doors by walking into them, and close them with `C`.
27- You can autoexplore by pressing `o`.
28- You can re-view recent messages with `Ctrl-p`.
29
30**Monsters and Combat**
31
32- You can pick up items with `,` or `g`.
33- Wield weapons with `w`. Weapons have different stats.
34 - (You may also engage in Unarmed Combat, though it isn't very effective when
35 untrained).
36- Attack monsters in melee by walking in their direction (or with
37 Ctrl-direction).
38- You can wait with `.` or `s`, passing your turn - such as to get monsters into
39 a corridor with you.
40- You can rest with `5`, waiting until you are fully healed, or something
41 noteworthy happens.
42- Either mouseover and rightclick, or use `x` then `v` on the monster to examine
43 monsters. Monsters with a red border are 'dangerous' relative to your current
44 XP level (XL).
45- Quiver (often ranged) actions for further use with `Q`.
46- You can fire ranged weapons manually with `f`, or auto-target your quiver with
47 `p` or `Shift-Tab`. Throwing weapons can be thrown immediately, while
48 launchers (like bows) need to be wielded first.
49
50**Items and Inventory**
51
52- View your inventory by pressing `i`. Most item related commands can also be
53 done with this menu.
54- You can wear amour with `W;` amour gives `AC`, while heavier body armour
55 reduces `EV`.
56- Autoexplore will automatically pick up useful items, such as potions and
57 scrolls, if you aren't in danger.
58- You can read scrolls with `r` and drink ("quaff") potions with `q`.
59- Equipment items may have brands, with special properties. Branded equipment is
60 blue when unidentified.
61- Equipment items may be artifacts, often with unique properties, and are
62 unmodifiable. They are written in white.
63- You can evoke wands with `V`.
64- You can put on jewelry with `P`, and remove it with `R`.
65- Gold is used in shops, which can be interacted with by either `>` or `<`.
66
67**Magic and Spellcasting**
68
69- Once you find a spellbook, you can memorize spells with `M`.
70- You need to be the same XL as the spell's spell level in order to learn it, in
71 addition to training magical skill (to lower failure rate).
72- Cast spells by pressing `z`, then the letter assigned to the spell. You may
73 also Quiver a spell and then use it like a ranged weapon (with Shift-Tab).
74- You can view your memorized spells by pressing `I` (capital-i) or `z`.
75- Like HP, you can recover MP by resting (with 5).
76- Many spells can be positioned more effectively, or combined with other spells,
77 in order to get (more effective) use out of them.
78- Heavier body amour and shields hamper spellcasting.
79
80**Gods and Divine Abilities**
81
82- You may look at a god's overview by praying at their altar (with `>` or `<`).
83 After praying, you can worship the god by pressing Enter afterwards.
84- Gods all have unique features about them. Trog, the god of the tutorial, is
85 also the god of rage and bloodshed, and so despises spellcasting.
86- Gods like and dislike different things. Most gods either like killing things
87 (like Trog) or exploring new areas (like Elyvilon), rewarding you piety
88 (divine favor) for doing so.
89- You should learn to use and even rely on divine abilities often, as they are
90 usually very strong. Trog's Berserk gives you 1.5x health, 1.5x speed (to all
91 valid actions), and a big damage boost. Note that Berserk prevents most
92 actions other than move and melee attack, and runs out very quickly if you
93 aren't attacking. And after berserk ends, you are slowed down and can't
94 berserk again for a short time.
95- In addition, the vast majority of abilities consume piety in the process.
96 Regardless, this ability is very cheap, and the benefits are incredible, so
97 don't hold back!
98- Pressing `^` will let you view your current god, abilities, and piety.
diff --git a/content/notes/2023-05-25-show-xterm-colors.md b/content/notes/2023-05-25-show-xterm-colors.md
deleted file mode 100644
index 1e6d526..0000000
--- a/content/notes/2023-05-25-show-xterm-colors.md
+++ /dev/null
@@ -1,84 +0,0 @@
1---
2title: Display xterm color palette
3url: xterm-color-palette.html
4date: 2023-05-25T12:00:00+02:00
5type: note
6draft: false
7tags: [linux]
8---
9
10- `bash xterm-palette.sh` - will show you number of max colors available
11- `bash xterm-palette.sh -v` - will create a list of all colors with codes
12
13![xterm color palette](/notes/xterm-palette.png)
14
15```sh
16#!/usr/bin/env bash
17# xterm-palette.sh
18
19trap 'tput sgr0' exit # Clean up even if user hits ^C
20
21function setfg () {
22 printf '\e[38;5;%dm' $1
23}
24
25function setbg () {
26 printf '\e[48;5;%dm' $1
27}
28
29function showcolors() {
30 # Given an integer, display that many colors
31 for ((i=0; i<$1; i++))
32 do
33 printf '%4d ' $i
34 setbg $i
35 tput el
36 tput sgr0
37 echo
38 done
39 tput sgr0 el
40}
41
42# First, test if terminal supports OSC 4 at all.
43printf '\e]4;%d;?\a' 0
44read -d $'\a' -s -t 0.1 </dev/tty
45if [ -z "$REPLY" ]
46then
47 # OSC 4 not supported, so we'll fall back to terminfo
48 max=$(tput colors)
49else
50 # OSC 4 is supported, so use it for a binary search
51 min=0
52 max=256
53 while [[ $((min+1)) -lt $max ]]
54 do
55 i=$(( (min+max)/2 ))
56 printf '\e]4;%d;?\a' $i
57 read -d $'\a' -s -t 0.1 </dev/tty
58 if [ -z "$REPLY" ]
59 then
60 max=$i
61 else
62 min=$i
63 fi
64 done
65fi
66
67
68# If -v is given, show all the colors
69case ${1-none} in
70 none)
71 echo $max
72 ;;
73 -v)
74 showcolors $max
75 ;;
76 *)
77 if [[ "$1" -gt 0 ]]; then
78 showcolors $1
79 else
80 echo $max
81 fi
82 ;;
83esac | less --raw-control-chars --QUIT-AT-EOF --no-init
84```
diff --git a/content/notes/2023-05-25-tmux-sane-defaults.md b/content/notes/2023-05-25-tmux-sane-defaults.md
deleted file mode 100644
index e21b62b..0000000
--- a/content/notes/2023-05-25-tmux-sane-defaults.md
+++ /dev/null
@@ -1,37 +0,0 @@
1---
2title: Sane defaults for tmux with more visible statusbar
3url: tmux-sane-defaults.html
4date: 2023-05-25T12:00:00+02:00
5type: note
6draft: false
7tags: [tmux]
8---
9
10```conf
11# Remap prefix from 'C-b' to 'M-a'.
12unbind C-b
13set-option -g prefix M-a
14bind-key M-a send-prefix
15
16# Split panes using | and -.
17bind | split-window -h
18bind - split-window -v
19unbind '"'
20unbind %
21
22# Start counting windows with 1.
23set-option -g allow-rename on
24set -g base-index 1
25setw -g pane-base-index 1
26
27# Statusbar: purple bg and white fg.
28set -g status-bg '#480b8e'
29set -g status-fg '#ffffff'
30
31# Active window: black bg and white fg.
32set -g window-status-current-format "#[fg=#ffffff]#[bg=#111111]#[fg=#ffffff]#[bg=#111111] #I:#W #[fg=#ffffff]#[bg=#111111]"
33
34# Disable mouse mode (tmux 2.1 and above).
35set -g mouse off
36```
37
diff --git a/content/notes/2023-05-27-cronjobs-github-with-actions.md b/content/notes/2023-05-27-cronjobs-github-with-actions.md
deleted file mode 100644
index b28e4a9..0000000
--- a/content/notes/2023-05-27-cronjobs-github-with-actions.md
+++ /dev/null
@@ -1,33 +0,0 @@
1---
2title: "Cronjobs on Github with Github Actions"
3url: cronjobs-github-with-actions.html
4date: 2023-05-27T00:35:36+02:00
5type: note
6draft: false
7tags: [github]
8---
9
10In the root of your repository create a folder `.github/workflows` and in that
11folder create a file a file `cron.yaml`. This file can be named whatever you
12wish. But it has to be a `yaml` file.
13
14File below (`.github/workflows/cron.yaml`) describes an action that will trigger
15every six hours and it will curl example.com.
16
17However. Be sure that you have enough credits. Free account is not that generous
18with the minutes they give you for free. Check more about GitHub Actions usage
19on their website https://docs.github.com/en/actions.
20
21```yaml
22# .github/workflows/cron.yaml
23name: Do a curl every 6 hours
24on:
25 schedule:
26 - cron: '0 */6 * * *'
27jobs:
28 cron:
29 runs-on: ubuntu-latest
30 steps:
31 - name: Call some url
32 run: curl 'https://example.com'
33```
diff --git a/content/notes/2023-05-27-dcss-on-4k-displays.md b/content/notes/2023-05-27-dcss-on-4k-displays.md
deleted file mode 100644
index 8dd7095..0000000
--- a/content/notes/2023-05-27-dcss-on-4k-displays.md
+++ /dev/null
@@ -1,30 +0,0 @@
1---
2title: "Make DCSS playable on 4k displays"
3url: dcss-on-4k-display.html
4date: 2023-05-27T19:35:11+02:00
5type: note
6draft: false
7tags: [dcss]
8---
9
10Dungeon Crawl Stone Soup has a a very small font by default. On a 4k display, it
11is barely readable. This is how I made it playable.
12
13Make a file `~/.crawlrc` with the following content:
14
15```ini
16# Adjust the sizes to your liking.
17
18tile_font_crt_size = 32
19tile_font_stat_size = 32
20tile_font_msg_size = 32
21tile_font_tip_size = 32
22tile_font_lbl_size = 32
23tile_sidebar_pixels = 64
24```
25
26To zoom in and out in viewport, press `Ctrl+` and `Ctrl-` respectively.
27
28All the possible options are documented in the [Dungeon Crawl Stone Soup Options
29Guide](https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt)
30file.
diff --git a/content/notes/2023-05-27-drawing-pixels-in-plan9.md b/content/notes/2023-05-27-drawing-pixels-in-plan9.md
deleted file mode 100644
index 473ccaf..0000000
--- a/content/notes/2023-05-27-drawing-pixels-in-plan9.md
+++ /dev/null
@@ -1,83 +0,0 @@
1---
2title: "Drawing Pixels in Plan9"
3url: drawing-pixels-in-plan9.html
4date: 2023-05-27T17:41:33+02:00
5type: note
6draft: false
7tags: [plan9, graphics]
8---
9
10I have started exploring Plan9's graphics capabilities. This is a hello world
11alternative for drawing that draws a yellow square on a blue background.
12
13More information:
14
15- [draw.h header file](https://github.com/0intro/plan9/blob/main/sys/include/draw.h)
16 contains all the drawing functions
17- [draw man page](https://9fans.github.io/plan9port/man/man3/draw.html)
18 has a bit more digestable descriptions of the draw functions
19- [graphics man page](https://9fans.github.io/plan9port/man/man3/graphics.html)
20 has a bit more digestable descriptions of the graphics functions
21- [all man pages](https://9fans.github.io/plan9port/man/man3/)
22 can be a valuable resource for learning about the system
23
24![Plan9 Howdy World!](/notes/plan9-pixels.png)
25
26```c
27// main.c
28#include <u.h>
29#include <libc.h>
30#include <draw.h>
31#include <cursor.h>
32
33void
34main()
35{
36 ulong co;
37 Image *im, *bg;
38 co = 0x0000FFFF;
39
40 if (initdraw(nil, nil, argv0) < 0)
41 {
42 sysfatal("%s: %r", argv0);
43 }
44
45 im = allocimage(display, Rect(0, 0, 300, 300), RGB24, 0, DYellow);
46 bg = allocimage(display, Rect(0, 0, 1, 1), RGB24, 1, co);
47
48 if (im == nil || bg == nil)
49 {
50 sysfatal("not enough memory");
51 }
52
53 draw(screen, screen->r, bg, nil, ZP);
54 draw(screen, screen->r, im, nil, Pt(-40, -40));
55
56 flushimage(display, Refnone);
57
58 // Wait 10 seconds before exiting.
59 sleep(10000);
60
61 exits(nil);
62}
63```
64
65And then compile with `mk` (mkfile below):
66
67```makefile
68# mkfile
69</$objtype/mkfile
70
71RC=/rc/bin
72BIN=/$objtype/bin
73MAN=/sys/man
74
75main:
76 $CC $CFLAGS main.c
77 $LD $LDFLAGS -o main main.$O
78```
79
80And run with `./main`. To exit the program, press `Delete key` (strange but this
81is the alternative for Ctrl+C).
82
83*This is **very cool** indeed!*
diff --git a/content/notes/2023-05-28-easy-time-took-in-bash.md b/content/notes/2023-05-28-easy-time-took-in-bash.md
deleted file mode 100644
index 999434a..0000000
--- a/content/notes/2023-05-28-easy-time-took-in-bash.md
+++ /dev/null
@@ -1,25 +0,0 @@
1---
2title: "Easy measure time took in a bash script"
3url: easy-time-took-in-bash.html
4date: 2023-05-28T17:53:20+02:00
5type: note
6draft: false
7tags: [bash]
8---
9
10In Bash, the `$SECONDS` variable is a special variable that automatically keeps
11track of the number of seconds since the current shell or script started
12executing. It starts counting from the moment the script begins running.
13
14```bash
15#!/bin/bash
16
17# Reset the timer to zero.
18SECONDS=0
19
20# Do something.
21sleep 5
22
23# Print the time elapsed.
24echo "Time taken: $SECONDS seconds"
25```
diff --git a/content/notes/2023-05-29-grep-to-less-maintain-colors.md b/content/notes/2023-05-29-grep-to-less-maintain-colors.md
deleted file mode 100644
index 6fc40a1..0000000
--- a/content/notes/2023-05-29-grep-to-less-maintain-colors.md
+++ /dev/null
@@ -1,25 +0,0 @@
1---
2title: "Grep to Less that maintain colors"
3url: grep-to-less-maintain-colors.html
4date: 2023-05-29T21:27:07+02:00
5type: note
6draft: false
7tags: [bash]
8---
9
10I often use `grep` to search for todo's in my code and other people's code and
11then pipe them in `less` and I missed having colors that grep outputs in `less`.
12
13- Grep's `--color=always` use markers to highlight the matching strings.
14- Less's `-R` option outputs "raw" control characters.
15
16You could use `alias grep='grep --color=always'` and `alias less='less -R'` or
17create todo function in your `.bashrc` that accepts first argument as search
18string.
19
20```sh
21# This is where the magic happens.
22grep --color=always -rni "TODO:" | less -R
23```
24
25![Less and grep](/notes/grep-less.png)
diff --git a/content/notes/2023-05-31-extending-dte-editor.md b/content/notes/2023-05-31-extending-dte-editor.md
deleted file mode 100644
index a82ab1b..0000000
--- a/content/notes/2023-05-31-extending-dte-editor.md
+++ /dev/null
@@ -1,52 +0,0 @@
1---
2title: "Extending dte editor"
3url: extending-dte-editor.html
4date: 2023-05-31T08:12:45+02:00
5type: note
6draft: false
7tags: [dte]
8---
9
10[`dte`](https://craigbarnes.gitlab.io/dte/) is an interesting editor I started
11using lately more and more. Since it is using
12[`execvp()`](https://linux.die.net/man/3/execvp) it can be easily extended. I
13needed comment/uncomment feature so I created a small utility that does this for
14me. Code lives on repository [dte
15extensions](https://git.mitjafelicijan.com/dte-extensions.git/about/) but this
16utilities can be used for whatever you want. Make sure you have version 1.11 or
17above.
18
19Next one will be invoking formatter based on the type of a file.
20
21My config that works for me.
22
23```sh
24set show-line-numbers true;
25set tab-width 4;
26set case-sensitive-search false;
27
28# Special aliases
29alias m_comment 'exec -s -i line -o buffer -e errmsg ~/.dte/bin/comment'
30alias m_format 'save; exec go fmt .; reload'
31alias m_duplicate 'copy;paste';
32
33# Useful aliases.
34alias m_force_close 'quit -f';
35alias m_reload 'close; open $FILE'
36
37# Key bindings.
38bind M-s save;
39bind M-q m_force_close;
40bind M-z refresh;
41bind C-down blkdown;
42bind C-up blkup;
43bind C-_ m_comment;
44bind M-. m_format;
45bind C-d m_duplicate;
46
47# Syntax highlighting.
48hi preproc magenta;
49hi keyword red;
50hi linenumber blue;
51hi comment cyan;
52```
diff --git a/content/notes/2023-06-01-ewd-manuscripts-ebook.md b/content/notes/2023-06-01-ewd-manuscripts-ebook.md
deleted file mode 100644
index 1ce597e..0000000
--- a/content/notes/2023-06-01-ewd-manuscripts-ebook.md
+++ /dev/null
@@ -1,22 +0,0 @@
1---
2title: "Edsger W. Dijkstra Manuscripts ebook"
3url: ewd-manuscripts-ebook.html
4date: 2023-06-01T22:47:56+02:00
5type: note
6draft: false
7tags: [random]
8---
9
10I love reading the original manuscripts of Edsger W. Dijkstra. They are
11available online at the University of Texas at Austin website, but I also found
12MOBI version. I converted it into ePub as well.
13
14Downloads:
15
16- [MOBI version of all Manuscripts](https://mitjafelicijan.fra1.digitaloceanspaces.com/haphazard/ewd-manuscripts.mobi)
17- [ePub version of all Manuscripts](https://mitjafelicijan.fra1.digitaloceanspaces.com/haphazard/ewd-manuscripts.epub)
18
19Sources and credits:
20
21- [Original manuscripts from University of Texas at Austin](https://www.cs.utexas.edu/users/EWD/index00xx.html)
22- [Original repository of MOBI version](https://github.com/evmn/The-Manuscripts-of-Edsger-W.-Dijkstra)
diff --git a/content/notes/2023-06-04-bulk-make-thumbnails.md b/content/notes/2023-06-04-bulk-make-thumbnails.md
deleted file mode 100644
index 4bab661..0000000
--- a/content/notes/2023-06-04-bulk-make-thumbnails.md
+++ /dev/null
@@ -1,21 +0,0 @@
1---
2title: "Bulk thumbnails"
3url: bulk-make-thumbnails.html
4date: 2023-06-04T20:46:56+02:00
5type: note
6draft: false
7tags: [bash]
8---
9
10Make bulk thumbnails of JPGs with ImageMagick.
11
12```sh
13#!/bin/bash
14
15directory="./images/"
16dimensions="360x360"
17
18for file in "$directory"*.jpg; do
19 convert "$file" -resize $dimensions "$file" "${file%.*}-thumbnail.jpg"
20done
21```
diff --git a/content/notes/2023-06-21-presentations-with-markdown.md b/content/notes/2023-06-21-presentations-with-markdown.md
deleted file mode 100644
index 49ea53e..0000000
--- a/content/notes/2023-06-21-presentations-with-markdown.md
+++ /dev/null
@@ -1,78 +0,0 @@
1---
2title: "Simple presentations with Markdown"
3url: presentations-with-markdown.html
4date: 2023-06-21T08:54:48+02:00
5type: note
6draft: false
7tags: [random]
8---
9
10A simple way to make presentations without using desktop apps or using online
11services is https://github.com/remarkjs/remark.
12
13First create `index.html` and be sure you make changes to `config` variable.
14
15```html
16<!DOCTYPE html>
17<html>
18
19<head>
20 <title></title>
21 <meta charset="utf-8">
22 <style>
23 body {
24 font-family: 'SF Pro Display';
25 }
26
27 .remark-code,
28 .remark-inline-code {
29 font-family: 'SF Mono';
30 font-size: medium;
31 background-color: gainsboro;
32 border-radius: 5px;
33 padding: 0 5px;
34 }
35 </style>
36</head>
37
38<body>
39 <textarea id="source"></textarea>
40 <script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
41 <script>
42 const config = {
43 title: 'My presentation',
44 file: 'presentation.md',
45 };
46
47 document.title = config.title;
48 remark.create({ sourceUrl: config.file });
49 </script>
50</body>
51
52</html>
53```
54
55Now the markdown file `presentation.md` with presenetation. `---` is used to
56separate slides. Other stuff is just pure markdown.
57
58```md
59class: center, middle
60
61# Main title of the presentation
62
63---
64
65# Fist slide
66
67Eveniet mollitia nemo architecto rerum aut iure iste. Sit nihil nobis libero iusto fugit nam laudantium ut. Dignissimos corrupti laudantium nisi.
68
69- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
70- Integer aliquet mauris a felis fringilla, ut congue massa finibus.
71
72---
73
74# Slide two
75
76- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
77- Vestibulum eget leo ac dolor venenatis pulvinar.
78```
diff --git a/content/notes/2023-06-24-making-cgit-look-nicer.md b/content/notes/2023-06-24-making-cgit-look-nicer.md
deleted file mode 100644
index 6eb18fa..0000000
--- a/content/notes/2023-06-24-making-cgit-look-nicer.md
+++ /dev/null
@@ -1,206 +0,0 @@
1---
2title: "Making cgit look nicer"
3url: making-cgit-look-nicer.html
4date: 2023-06-24T13:33:58+02:00
5type: note
6draft: false
7tags: [git]
8---
9
10For personal use I have a [private Git server](https://git.mitjafelicijan.com)
11set up and I use GitHub just as a mirror. By default the cgit theme looks a bit
12dated so I made the flowing theme.
13
14- `/etc/cgitrc`
15
16```ini
17css=/cgit.css
18logo=/startrek.gif
19favicon=/favicon.png
20source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh
21about-filter=/usr/lib/cgit/filters/about-formatting.sh
22
23local-time=1
24snapshots=tar.gz
25repository-sort=age
26cache-size=1000
27branch-sort=age
28summary-log=200
29max-atom-items=50
30max-repo-count=100
31
32enable-index-owner=0
33enable-follow-links=1
34enable-log-filecount=1
35enable-log-linecount=1
36
37root-title=Place for code, experiments and other bullshit!
38root-desc=
39clone-url=git@git.mitjafelicijan.com:/home/git/$CGIT_REPO_URL
40
41mimetype.gif=image/gif
42mimetype.html=text/html
43mimetype.jpg=image/jpeg
44mimetype.jpeg=image/jpeg
45mimetype.pdf=application/pdf
46mimetype.png=image/png
47mimetype.svg=image/svg+xml
48
49readme=:README.md
50readme=:readme.md
51
52# Must be at the end!
53virtual-root=/
54scan-path=/home/git/
55```
56
57For `syntax-highlighting-edited.sh` follow instructions on
58[https://wiki.archlinux.org/title/Cgit](https://wiki.archlinux.org/title/Cgit#Using_highlight).
59
60- `/usr/share/cgit/cgit.css`
61
62```css
63* {
64 font-size: 11pt;
65}
66
67body {
68 font-family: monospace;
69 background: white;
70 padding: 1em;
71}
72
73th, td {
74 text-align: left;
75}
76
77/* HEADER */
78
79#header {
80 margin-bottom: 1em;
81}
82
83#header .logo img {
84 display: block;
85 height: 3em;
86 margin-right: 10px;
87}
88
89#header .sub.right {
90 display: none;
91}
92
93/* FOOTER */
94
95.footer {
96 margin-top: 2em;
97 font-style: italic;
98}
99
100.footer, .footer a {
101 color: gray;
102}
103
104/* TABS */
105
106.tabs a {
107 margin-bottom: 2em;
108 display: inline-block;
109 margin-right: 1em;
110}
111
112.tabs td a:only-child {
113 display: none;
114}
115
116/* HIDING ELEMENTS */
117
118.cgit-panel, .form {
119 display: none;
120}
121
122/* LISTS */
123
124.list td, .list th {
125 padding-right: 2em;
126}
127
128.list .nohover a {
129 color: black;
130}
131
132.list .button {
133 padding-right: 0.5em;
134}
135
136/* COMMIT */
137
138.commit-subject {
139 padding: 1em 0;
140}
141
142.decoration a {
143 padding-left: 0.5em;
144}
145
146.commit-info th {
147 padding-right: 1em;
148}
149
150.commit-subject {
151 padding: 2em 0;
152}
153
154table.diff div.head {
155 padding-top: 2em;
156}
157
158table.diffstat td {
159 padding-right: 1em;
160}
161
162/* CONTENT */
163
164.linenumbers {
165 padding-right: 0.5em;
166}
167
168.linenumbers a {
169 color: gray;
170}
171
172.pager {
173 display: flex;
174 list-style-type: none;
175 padding: 0;
176 gap: 0.5em;
177}
178
179/* DIFF COLORS */
180
181table.diff {
182 width: 100%;
183}
184
185table.diff td {
186 white-space: pre;
187}
188
189table.diff td div.head {
190 font-weight: bold;
191 margin-top: 1em;
192 color: black;
193}
194
195table.diff td div.hunk {
196 color: #009;
197}
198
199table.diff td div.add {
200 color: green;
201}
202
203table.diff td div.del {
204 color: red;
205}
206```
diff --git a/content/notes/2023-06-25-alacritty-open-links-with-modifier.md b/content/notes/2023-06-25-alacritty-open-links-with-modifier.md
deleted file mode 100644
index eb73c4c..0000000
--- a/content/notes/2023-06-25-alacritty-open-links-with-modifier.md
+++ /dev/null
@@ -1,35 +0,0 @@
1---
2title: "Alacritty open links with modifier"
3url: alacritty-open-links-with-modifier.html
4date: 2023-06-25T17:17:16+02:00
5type: note
6draft: false
7tags: [linux]
8---
9
10Alacritty by default makes all links in the terminal output clickable and this
11gets annoying rather quickly. I liked the default behavior of Gnome terminal
12where you needed to hold Control key and then you could click and open links.
13
14To achieve this in Alacritty you need to provide a `hint` in the configuration
15file. Config file is located at `~/.config/alacritty/alacritty.yml`.
16
17```yaml
18hints:
19 enabled:
20 - regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
21 [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
22 command: xdg-open
23 post_processing: true
24 mouse:
25 enabled: true
26 mods: Control
27```
28
29The following should work under any Linux system. For macOS, you will need to
30change `command: xdg-open` to something else.
31
32Now the links will be visible and clickable only when Control key is being
33pressed.
34
35Source: https://github.com/alacritty/alacritty/issues/5246
diff --git a/content/notes/2023-06-25-development-environments-with-nix.md b/content/notes/2023-06-25-development-environments-with-nix.md
deleted file mode 100644
index 6bae302..0000000
--- a/content/notes/2023-06-25-development-environments-with-nix.md
+++ /dev/null
@@ -1,68 +0,0 @@
1---
2title: "Development environments with Nix"
3url: development-environments-with-nix.html
4date: 2023-06-25T16:38:10+02:00
5type: note
6draft: false
7tags: [random]
8---
9
10Nix is amazing for making reproducible cross OS development environment.
11
12First you need to [install Nix package
13manager](https://nixos.org/download.html).
14
15- Create a file `shell.nix` in your project folder.
16- In the section that has `python3` etc add programs you want to use. These can
17 be CLI or GUI applications. It doesn't matter to Nix.
18
19```nix
20{ pkgs ? import <nixpkgs> {} }:
21 pkgs.mkShell {
22 nativeBuildInputs = with pkgs.buildPackages; [
23 python3
24 tinycc
25 ];
26}
27```
28
29And then run it `nix-shell`. By default it will look for `shell.nix` file. If
30you want to specify a different file use `nix-shell file.nix`. That is about it.
31
32When the shell is spawned it could happen that your `PS1` prompt will be
33overwritten and your prompt will look differently. In that case you need to
34either do `NIX_SHELL_PRESERVE_PROMPT=1 nix shell` or add
35`NIX_SHELL_PRESERVE_PROMPT` variable to your `bashrc` or `zshrc` file and set it
36to `1`.
37
38I also have a modified `PS1` prompt for Bash that I use and it also catches the
39usage of Nix shell.
40
41```sh
42NIX_SHELL_PRESERVE_PROMPT=1
43
44parse_git_branch() {
45 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
46}
47
48is_inside_nix_shell() {
49 nix_shell_name="$(basename "$IN_NIX_SHELL" 2>/dev/null)"
50 if [[ -n "$nix_shell_name" ]]; then
51 echo " \e[0;36m(nix-shell)\e[0m"
52 fi
53}
54
55export PS1="[\033[38;5;9m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ "
56```
57
58And this is what it looks like when you are in a Nix shell. Otherwise that part
59of prompt is omitted
60
61![PS1 Prompt](/notes/ps1-prompt.png)
62
63More resources:
64
65- https://nixos.wiki/wiki/Development_environment_with_nix-shell
66- https://nixos.wiki/wiki/Main_Page
67- https://itsfoss.com/why-use-nixos/
68- https://mynixos.com/
diff --git a/content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md b/content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md
deleted file mode 100644
index 751d1dc..0000000
--- a/content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md
+++ /dev/null
@@ -1,25 +0,0 @@
1---
2title: "10/GUI 10 Finger Multitouch User Interface"
3url: 10gui-10-finger-multitouch-user-interface.html
4date: 2023-06-29T14:51:39+02:00
5type: note
6draft: false
7tags: [graphics]
8---
9
10Message from 10/GUI team (page 10gui.com does not exist anymore):
11
12*Over a quarter-century ago, Xerox introduced the modern graphical user
13interface paradigm we today take for granted.*
14
15*That it has endured is a testament to the genius of its design. But the
16industry is now at a crossroads: New technologies promise higher-bandwidth
17interaction, but have yet to find a truly viable implementation.*
18
19*10/GUI aims to bridge this gap by rethinking the desktop to leverage technology
20in an intuitive and powerful way.*
21
22<video
23 poster="/notes/10gui-10-finger-multitouch-user-interface.jpg"
24 src="/notes/10gui-10-finger-multitouch-user-interface.mp4"
25 controls></video>
diff --git a/content/notes/2023-06-29-60s-ibm-computers-commercial.md b/content/notes/2023-06-29-60s-ibm-computers-commercial.md
deleted file mode 100644
index c97d747..0000000
--- a/content/notes/2023-06-29-60s-ibm-computers-commercial.md
+++ /dev/null
@@ -1,17 +0,0 @@
1---
2title: "60's IBM Computers Commercial"
3url: 60s-ibm-computers-commercial.html
4date: 2023-06-29T22:13:45+02:00
5type: note
6draft: false
7tags: [random]
8---
9
10Likely aired during an hour-long program during the 1960s, long commercials such
11as this typically aired during hour-long programs. They would *not* have aired
12during a half-hour program.
13
14<video
15 poster="/notes/60s-ibm-computers-commercial.jpg"
16 src="/notes/60s-ibm-computers-commercial.mp4"
17 controls></video>
diff --git a/content/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md b/content/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md
deleted file mode 100644
index e213a42..0000000
--- a/content/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md
+++ /dev/null
@@ -1,15 +0,0 @@
1---
2title: "Set color temperature of displays on i3"
3url: set-color-temperature-of-displays-on-i3.html
4date: 2023-07-14T09:19:31+02:00
5type: note
6draft: false
7---
8
9I have been using Gnome's night shift for a while now and I have been missing
10this feature under i3wm. This can be done with
11[redshift](https://linux.die.net/man/1/redshift).
12
13- On Debian install with `sudo apt install redshift`
14- And then manually set it with `redshift -O 3000`
15- Reset the current settings with `redshift -x`
diff --git a/content/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md b/content/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md
deleted file mode 100644
index 51e85ec..0000000
--- a/content/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md
+++ /dev/null
@@ -1,70 +0,0 @@
1---
2title: "Make B/W SVG charts with matplotlib"
3url: make-b-w-svg-charts-with-matplotlib.html
4date: 2023-08-01T17:04:10+02:00
5type: note
6draft: false
7---
8
9Install pip requirements.
10
11```sh
12pip install matplotlib
13pip install pandas
14```
15
16Example of data being used.
17
18```text
19Epoch,Connect (NLB),Processing (NLB),Waiting (NLB),Total (NLB),Connect (ALB),Processing (ALB),Waiting (ALB),Total (ALB)
201,57.7,315.7,309.4,321.6,9,104.4,98.3,105.7
212,121.9,114.4,100.3,176.9,5.8,99.1,97.1,101.1
223,5.3,229.4,231.2,231.4,14.2,83,69.4,87.9
234,4.2,134.5,112.2,135.3,5.3,132.4,105.5,134.1
245,5.8,247.4,246.8,248.1,6,74.3,70.2,75.5
256,9.9,122.9,100.6,122.7,7.5,241.1,79.3,242.3
267,6.1,170.2,106.4,170.5,7.2,382.4,375.1,383.8
278,6.6,194.3,201.4,195.5,7.1,130.9,104.8,132.6
289,6.4,146.1,122.3,147.7,9.4,95.6,74,96.4
29```
30
31In the code you can use `df` as dataframes and use the headers like `df["Epoch"]`.
32This is how you get a column data with pandas.
33
34The Python code responsible for generating a chart:
35
36```python
37import csv
38import sys
39
40import matplotlib.pyplot as plt
41import pandas as pd
42
43# Read the data
44df = pd.read_csv("data.csv")
45
46# Settings
47plt.title("Connect median NLB vs ALB")
48plt.tight_layout(pad=2)
49fig = plt.gcf()
50fig.set_size_inches(10, 4)
51
52# Plotting
53plt.plot(df["Epoch"], df["Connect (ALB)"], label = "ALB", color="black", linestyle="-")
54plt.plot(df["Epoch"], df["Connect (NLB)"], label = "NLB", color="black", linestyle="--")
55
56# Adding x and y axis labels
57plt.xlabel("Epoch", fontstyle="italic")
58plt.ylabel("Median value (ms)", fontstyle="italic")
59
60# Legend
61legend = plt.legend()
62legend.get_frame().set_linewidth(0)
63
64# Export as SVG
65plt.savefig("plot.svg", format="svg")
66```
67
68![SVG Chart](/notes/plot.svg)
69
70The image above is SVG and you can zoom in and out and check that the image is vector.
diff --git a/content/notes/2023-08-05-floods-in-slovenia.md b/content/notes/2023-08-05-floods-in-slovenia.md
deleted file mode 100644
index d0ebc18..0000000
--- a/content/notes/2023-08-05-floods-in-slovenia.md
+++ /dev/null
@@ -1,19 +0,0 @@
1---
2title: "Floods in Slovenia up close"
3url: floods-in-slovenia.html
4date: 2023-08-05T07:06:50+02:00
5type: note
6draft: false
7---
8
9<video src="/notes/floods/IMG_1471.mp4" controls></video>
10
11<video src="/notes/floods/IMG_1474.mp4" controls></video>
12
13![](/notes/floods/IMG_1469.webp)
14
15![](/notes/floods/IMG_1470.webp)
16
17<video src="/notes/floods/IMG_1461.mp4" controls></video>
18
19<video src="/notes/floods/IMG_1466.mp4" controls></video>
diff --git a/content/notes/2023-09-18-aws-eb-pyyaml-fix.md b/content/notes/2023-09-18-aws-eb-pyyaml-fix.md
deleted file mode 100644
index 77ae27d..0000000
--- a/content/notes/2023-09-18-aws-eb-pyyaml-fix.md
+++ /dev/null
@@ -1,35 +0,0 @@
1---
2title: "AWS EB PyYAML fix"
3url: aws-eb-pyyaml-fix.html
4date: 2023-09-18T07:27:29+02:00
5type: note
6draft: false
7---
8
9Recent update of my system completely borked [EB CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-advanced.html)
10on my machine.
11
12I tried installing it with `pip install awsebcli --upgrade --user` and it failed.
13
14The error was the following.
15
16```text
17Collecting PyYAML<6.1,>=5.3.1 (from awsebcli)
18 Using cached PyYAML-5.4.1.tar.gz (175 kB)
19 Installing build dependencies ... done
20 Getting requirements to build wheel ... error
21 error: subprocess-exited-with-error
22
23 × Getting requirements to build wheel did not run successfully.
24 │ exit code: 1
25 ╰─> [68 lines of output]
26```
27
28To fix this issue with PyYAML you must install PyYAML separately.
29
30Do the following and try installing `eb` again after.
31
32```sh
33echo 'Cython < 3.0' > /tmp/constraint.txt
34PIP_CONSTRAINT=/tmp/constraint.txt pip install 'PyYAML==5.4.1'
35```
diff --git a/content/notes/2023-09-25-compile-drawterm-on-fedora-38.md b/content/notes/2023-09-25-compile-drawterm-on-fedora-38.md
deleted file mode 100644
index ec7446b..0000000
--- a/content/notes/2023-09-25-compile-drawterm-on-fedora-38.md
+++ /dev/null
@@ -1,23 +0,0 @@
1---
2title: "Compile drawterm on Fedora 38"
3url: compile-drawterm-on-fedora-38.html
4date: 2023-09-25T09:04:28+02:00
5type: note
6draft: false
7---
8
9First install two dependencies:
10
11```sh
12sudo dnf install libX11-devel libXt-devel
13```
14
15Clone the repo and compile it:
16
17```sh
18git clone git://git.9front.org/plan9front/drawterm
19cd drawterm
20CONF=unix make
21```
22
23That should produce `drawterm` binary.