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