From 2417a6b7603524dc5cd30d29b153f91024b9443d Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 1 Nov 2023 22:54:27 +0100 Subject: Move to Jekyll --- content/notes/2023-05-01-cachebusting-in-hugo.md | 17 -- content/notes/2023-05-05-run-9front-in-qemu.md | 28 --- .../notes/2023-05-06-git-push-multiple-origins.md | 17 -- .../notes/2023-05-07-mount-plan9-over-network.md | 23 --- content/notes/2023-05-08-write-iso-usb.md | 15 -- content/notes/2023-05-09-catv-weechat-config.md | 21 --- content/notes/2023-05-10-plan9-screenshot.md | 22 --- content/notes/2023-05-11-fix-plan9-bootloader.md | 20 -- .../notes/2023-05-12-install-plan9port-linux.md | 21 --- .../notes/2023-05-13-download-youtube-videos.md | 25 --- content/notes/2023-05-14-convert-mkv.md | 22 --- .../notes/2023-05-15-preview-troff-man-pages.md | 20 -- content/notes/2023-05-16-mass-set-permission.md | 16 -- .../2023-05-22-non-blocking-shell-exec-csharp.md | 44 ----- .../notes/2023-05-23-extend-lua-with-custom-c.md | 54 ------ content/notes/2023-05-23-parse-rss-with-lua.md | 40 ---- content/notes/2023-05-24-fresh-9front-desktop.md | 14 -- content/notes/2023-05-25-dcss-new-player-guide.md | 98 ---------- content/notes/2023-05-25-show-xterm-colors.md | 84 --------- content/notes/2023-05-25-tmux-sane-defaults.md | 37 ---- .../2023-05-27-cronjobs-github-with-actions.md | 33 ---- content/notes/2023-05-27-dcss-on-4k-displays.md | 30 --- .../notes/2023-05-27-drawing-pixels-in-plan9.md | 83 --------- content/notes/2023-05-28-easy-time-took-in-bash.md | 25 --- .../2023-05-29-grep-to-less-maintain-colors.md | 25 --- content/notes/2023-05-31-extending-dte-editor.md | 52 ------ content/notes/2023-06-01-ewd-manuscripts-ebook.md | 22 --- content/notes/2023-06-04-bulk-make-thumbnails.md | 21 --- .../2023-06-21-presentations-with-markdown.md | 78 -------- content/notes/2023-06-24-making-cgit-look-nicer.md | 206 --------------------- ...023-06-25-alacritty-open-links-with-modifier.md | 35 ---- ...2023-06-25-development-environments-with-nix.md | 68 ------- ...29-10gui-10-finger-multitouch-user-interface.md | 25 --- .../2023-06-29-60s-ibm-computers-commercial.md | 17 -- ...7-14-set-color-temperature-of-displays-on-i3.md | 15 -- ...23-08-01-make-b-w-svg-charts-with-matplotlib.md | 70 ------- content/notes/2023-08-05-floods-in-slovenia.md | 19 -- content/notes/2023-09-18-aws-eb-pyyaml-fix.md | 35 ---- .../2023-09-25-compile-drawterm-on-fedora-38.md | 23 --- 39 files changed, 1520 deletions(-) delete mode 100644 content/notes/2023-05-01-cachebusting-in-hugo.md delete mode 100644 content/notes/2023-05-05-run-9front-in-qemu.md delete mode 100644 content/notes/2023-05-06-git-push-multiple-origins.md delete mode 100644 content/notes/2023-05-07-mount-plan9-over-network.md delete mode 100644 content/notes/2023-05-08-write-iso-usb.md delete mode 100644 content/notes/2023-05-09-catv-weechat-config.md delete mode 100644 content/notes/2023-05-10-plan9-screenshot.md delete mode 100644 content/notes/2023-05-11-fix-plan9-bootloader.md delete mode 100644 content/notes/2023-05-12-install-plan9port-linux.md delete mode 100644 content/notes/2023-05-13-download-youtube-videos.md delete mode 100644 content/notes/2023-05-14-convert-mkv.md delete mode 100644 content/notes/2023-05-15-preview-troff-man-pages.md delete mode 100644 content/notes/2023-05-16-mass-set-permission.md delete mode 100644 content/notes/2023-05-22-non-blocking-shell-exec-csharp.md delete mode 100644 content/notes/2023-05-23-extend-lua-with-custom-c.md delete mode 100644 content/notes/2023-05-23-parse-rss-with-lua.md delete mode 100644 content/notes/2023-05-24-fresh-9front-desktop.md delete mode 100644 content/notes/2023-05-25-dcss-new-player-guide.md delete mode 100644 content/notes/2023-05-25-show-xterm-colors.md delete mode 100644 content/notes/2023-05-25-tmux-sane-defaults.md delete mode 100644 content/notes/2023-05-27-cronjobs-github-with-actions.md delete mode 100644 content/notes/2023-05-27-dcss-on-4k-displays.md delete mode 100644 content/notes/2023-05-27-drawing-pixels-in-plan9.md delete mode 100644 content/notes/2023-05-28-easy-time-took-in-bash.md delete mode 100644 content/notes/2023-05-29-grep-to-less-maintain-colors.md delete mode 100644 content/notes/2023-05-31-extending-dte-editor.md delete mode 100644 content/notes/2023-06-01-ewd-manuscripts-ebook.md delete mode 100644 content/notes/2023-06-04-bulk-make-thumbnails.md delete mode 100644 content/notes/2023-06-21-presentations-with-markdown.md delete mode 100644 content/notes/2023-06-24-making-cgit-look-nicer.md delete mode 100644 content/notes/2023-06-25-alacritty-open-links-with-modifier.md delete mode 100644 content/notes/2023-06-25-development-environments-with-nix.md delete mode 100644 content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md delete mode 100644 content/notes/2023-06-29-60s-ibm-computers-commercial.md delete mode 100644 content/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md delete mode 100644 content/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md delete mode 100644 content/notes/2023-08-05-floods-in-slovenia.md delete mode 100644 content/notes/2023-09-18-aws-eb-pyyaml-fix.md delete mode 100644 content/notes/2023-09-25-compile-drawterm-on-fedora-38.md (limited to 'content/notes') 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 @@ ---- -title: Cache busting in Hugo -url: cachebusting-in-hugo.html -date: 2023-05-01T12:00:00+02:00 -type: note -draft: false -tags: [hugo] ---- - -```html -{{ $cachebuster := delimit (shuffle (split (md5 "6fab11c6669976d759d2992eff1dd5be") "" )) "" }} - - -``` - -This `6fab11c6669976d759d2992eff1dd5be` can be random string you generate use. -You 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 @@ ---- -title: Run 9front in Qemu -url: run-9front-in-qemu.html -date: 2023-05-05T12:00:00+02:00 -type: note -draft: false -tags: [plan9, qemu] ---- - -Run 9front in Qemu. This applies to [Plan9](https://9p.io/plan9/) and -[9front](https://9front.org/). - -Download from here http://9front.org/iso/. - -```sh -# Create a qcow2 image. -qemu-img create -f qcow2 $HOME/VM/9front.qcow2.img 30G - -# Run the VM. -qemu-system-x86_64 -cpu host -enable-kvm -m 1024 \ - -net nic,model=virtio,macaddr=52:54:00:00:EE:03 -net user \ - -device virtio-scsi-pci,id=scsi \ - -drive if=none,id=vd0,file=$HOME/VM/9front.qcow2.img \ - -device scsi-hd,drive=vd0 \ - -drive if=none,id=vd1,file=$HOME/VM/ISO/9front.386.iso \ - -device scsi-cd,drive=vd1,bootindex=0 -``` - 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 @@ ---- -title: Push to multiple origins at once in Git -url: git-push-multiple-origins.html -date: 2023-05-06T12:00:00+02:00 -type: note -draft: false -tags: [git] ---- - -Sometimes you want to push to multiple origins at once. This is useful if you -have a mirror of your repository on another server. You can do this by adding -multiple push urls to your git config. This is a shorthand for command above. - -```sh -git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"' -``` - 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 @@ ---- -title: Mount Plan9 over network -url: mount-plan9-over-network.html -date: 2023-05-07T12:00:00+02:00 -type: note -draft: false -tags: [plan9] ---- - -- First install libfuse with sudo apt install libfuse-dev. -- Then clone https://github.com/ftrvxmtrx/9pfs and compile it with make. -- Copy 9pfs to your path. - -```sh -# On Plan9 side -ip/ipconfig # enables network -aux/listen1 -tv tcp!*!9999 /bin/exportfs -r tmp # export tmp folder - -# On Linux side -9pfs 172.18.0.1 -p 9999 local_folder # mount -umount local_folder # unmount -``` - 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 @@ ---- -title: Write ISO to USB Key -url: write-iso-usb.html -date: 2023-05-08T12:00:00+02:00 -type: note -draft: false -tags: [linux] ---- - -Write ISO to USB key. Nothing fancy here. - -```sh -sudo dd if=iso_file.iso of=/dev/sdX bs=4M status=progress conv=fdatasync -``` - 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 @@ ---- -title: "#cat-v on weechat configuration" -url: catv-weechat-config.html -date: 2023-05-09T12:00:00+02:00 -type: note -draft: false -tags: [irc] ---- - -Set up weechat to connect to #cat-v on oftc. This applies to -[weechat](https://weechat.org/) but should be similar for other irc clients. - -```sh -# Install weechat and launch it and execute the following commands. - -/server add oftc irc.oftc.net -tls -/set irc.server.oftc.autoconnect on -/set irc.server.oftc.autojoin "#cat-v" -/set irc.server.oftc.nicks "nick1,nick2,nick3" -``` - 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 @@ ---- -title: Take a screenshot in Plan9 -url: plan9-screenshot.html -date: 2023-05-10T12:00:00+02:00 -type: note -draft: false -tags: [plan9] ---- - -Take a screenshot in Plan9. This applies to [Plan9](https://9p.io/plan9/) and -[9front](https://9front.org/). This will take a screenshot of the screen and -output it to `/dev/screen`. You can then use `topng` to convert it to a png -image. - -```sh -# Instant screenshot. -cat /dev/screen | topng > screen.png - -# Delayed screenshot (5 seconds). -sleep 5; cat /dev/screen | topng > screen.png -``` - 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 @@ ---- -title: Fix bootloader not being written in Plan9 -url: fix-plan9-bootloader.html -date: 2023-05-11T12:00:00+02:00 -type: note -draft: false -tags: [plan9] ---- - -If the bootloader is not being written to a disk when installing 9front on real -harware try clearing first sector of the disk with the following command. - -```sh -dd if=/dev/zero of=/dev/sdX bs=512 count=1 - -# If command above doesn't work try this one, wait couple of seconds and -# press delete key to stop the command. -cat /dev/sd*/data -``` - 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 @@ ---- -title: Install Plan9port on Linux -url: install-plan9port-linux.html -date: 2023-05-12T12:00:00+02:00 -type: note -draft: false -tags: [plan9] ---- - -Install Plan9port on Linux. This applies to -[Plan9port](https://9fans.github.io/plan9port/). This is a port of many Plan 9 -programs to Unix-like operating systems. Useful for programs like `9term` and -`rc`. - -```sh -sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev -git clone https://github.com/9fans/plan9port $HOME/plan9 -cd $HOME/plan9/plan9port -./INSTALL -r $HOME/plan9 -``` - 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 @@ ---- -title: Download list of YouTube files -url: download-youtube-videos.html -date: 2023-05-13T12:00:00+02:00 -type: note -draft: false -tags: [youtube] ---- - -If you need to download a list of YouTube videos and don't want to download the -actual YouTube list (which `yt-dlp` supports), you can use the following method. - -```js -// Used to get list of raw URL's from YouTube's video tab'. -// Copy them into videos.txt. -document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href)) -``` - -Download and install https://github.com/yt-dlp/yt-dlp. - -```sh -# This will download all videos in videos.txt. -yt-dlp --batch-file videos.txt -N `nproc` -f webm -``` - 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 @@ ---- -title: Convert all MKV files into other formats -url: convert-mkv.html -date: 2023-05-14T12:00:00+02:00 -type: note -draft: false -tags: [ffmpeg] ---- - -You will need `ffmpeg` installed on your system. This will convert all MKV files -into WebM format. - -```sh -# Convert all MKV files into WebM format. -find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \; -``` - -```sh -# Convert all MKV files into MP4 format. -find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \; -``` - 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 @@ ---- -title: Previews how man page written in Troff will look like -url: preview-troff-man-pages.html -date: 2023-05-15T12:00:00+02:00 -type: note -draft: false -tags: [troff] ---- - -Troff is used to write man pages and it is difficult to read it so this will -preview how it will look like when it is rendered. - -```sh -# On Linux system. -groff -man -Tascii filename - -# On Plan9 system. -man 1 filename -``` - 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 @@ ---- -title: Change permissions of matching files recursively -url: mass-set-permission.html -date: 2023-05-16T12:00:00+02:00 -type: note -draft: false -tags: [linux] ---- - -Replace `*.xml` with your pattern. This will remove executable bit from all -files matching the pattern. Change `+` to `-` to add executable bit. - -```sh -find . -type f -name "*.xml" -exec chmod -x {} + -``` - 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 @@ ---- -title: Execute not blocking async shell command in C# -url: non-blocking-shell-exec-csharp.html -date: 2023-05-22T12:00:00+02:00 -type: note -draft: false -tags: [csharp] ---- - -Execute a shell command in async in C# while not blocking the UI thread. - -```c# -private async Task executeCopyCommand() -{ - await Task.Run(() => - { - var processStartInfo = new ProcessStartInfo("cmd", "/c dir") - { - RedirectStandardOutput = true, - UseShellExecute = false, - CreateNoWindow = true - }; - - var process = new Process - { - StartInfo = processStartInfo - }; - - process.Start(); - process.WaitForExit(); - }); -} -``` - -Make sure that `async` is present in the function definition and `await` is used -in the method that calls `executeCopyCommand()`. - -```c# -private async void button_Click(object sender, EventArgs e) -{ - await executeCopyCommand(); -} -``` - 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 @@ ---- -title: Extend Lua with custom C functions using Clang -url: extend-lua-with-custom-c.html -date: 2023-05-23T12:00:00+02:00 -type: note -draft: false -tags: [lua, c] ---- - -Here is a boilerplate for extending Lua with custom C functions. This requires -Clang and Lua 5.1 to be installed. GCC can be used instead of Clang, but the -Makefile will need to be modified. - -- nativefunc.c - - ```c - #include - #include - - static int l_mult50(lua_State *L) { - double number = luaL_checknumber(L, 1); - lua_pushnumber(L, number * 50); - return 1; - } - - int luaopen_nativefunc(lua_State *L) { - static const struct luaL_Reg nativeFuncLib[] = {{"mult50", l_mult50}, {NULL, NULL}}; - - luaL_register(L, "nativelib", nativeFuncLib); - return 1; - } - ``` - -- main.lua - - ```lua - require "nativefunc" - print(nativelib.mult50(50)) - ``` - -- Makefile - - ```Makefile - CC = clang - CFLAGS = - INCLUDES = `pkg-config lua5.1 --cflags-only-I` - - all: - $(CC) -shared -o nativefunc.so -fPIC nativefunc.c $(CFLAGS) $(INCLUDES) - - clean: - rm *.so - ``` - 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 @@ ---- -title: Parse RSS feeds with Lua -url: parse-rss-with-lua.html -date: 2023-05-23T12:00:00+02:00 -type: note -draft: false -tags: [lua, rss] ---- - -Example of parsing RSS feeds with Lua. Before running the script install: - -- feedparser with `luarocks install feedparser` -- luasocket with `luarocks install luasocket` - -```lua -local http = require("socket.http") -local feedparser = require("feedparser") - -local feed_url = "https://mitjafelicijan.com/index.xml" - -local response, status, _ = http.request(feed_url) -if status == 200 then - local parsed = feedparser.parse(response) - - -- Print out feed details. - print("> Title ", parsed.feed.title) - print("> Author ", parsed.feed.author) - print("> ID ", parsed.feed.id) - print("> Entries ", #parsed.entries) - - for _, item in ipairs(parsed.entries) do - print("GUID ", item.guid) - print("Title ", item.title) - print("Link ", item.link) - print("Summary ", item.summary) - end -else - print("! Request failed. Status:", status) -end -``` 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 @@ ---- -title: My brand new Plan9/9front desktop -url: fresh-9front-desktop.html -date: 2023-05-24T12:00:00+02:00 -type: note -draft: false -tags: [plan9] ---- - -I have been experimenting with Plan9/9front for a week now. Noice! This is how -my desktop looks like. - -![9front desktop](/notes/9front-desktop.png) - 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 @@ ---- -title: Dungeon Crawl Stone Soup - New player guide -url: dcss-new-player-guide.html -date: 2023-05-25T22:00:00+02:00 -type: note -draft: false -tags: [dcss] ---- - -An amazing game deserves an amazing guide. All this material can be find in some -form on another on [craw's](https://github.com/crawl/crawl) official repository. - -- [DCSS Quickstart](/notes/dcss-quickstart.pdf) - Very short introduction to the - game -- [DCSS Manual](/notes/dcss_manual.pdf) - Extensive manual about the game - -![Dungeon Crawl Stone Soup](/notes/dcss.jpg) - -**Movement and Exploration** - -- You can move around with the numpad (try numlock on and off), vi-keys, or - clicking with the mouse. Arrow keys work, though you can't move diagonally - with them. Pressing Shift and a direction will move until you see/hit - something. -- Pressing `>` will take you down a staircase, and `<` to go up a staircase. -- You can open doors by walking into them, and close them with `C`. -- You can autoexplore by pressing `o`. -- You can re-view recent messages with `Ctrl-p`. - -**Monsters and Combat** - -- You can pick up items with `,` or `g`. -- Wield weapons with `w`. Weapons have different stats. - - (You may also engage in Unarmed Combat, though it isn't very effective when - untrained). -- Attack monsters in melee by walking in their direction (or with - Ctrl-direction). -- You can wait with `.` or `s`, passing your turn - such as to get monsters into - a corridor with you. -- You can rest with `5`, waiting until you are fully healed, or something - noteworthy happens. -- Either mouseover and rightclick, or use `x` then `v` on the monster to examine - monsters. Monsters with a red border are 'dangerous' relative to your current - XP level (XL). -- Quiver (often ranged) actions for further use with `Q`. -- You can fire ranged weapons manually with `f`, or auto-target your quiver with - `p` or `Shift-Tab`. Throwing weapons can be thrown immediately, while - launchers (like bows) need to be wielded first. - -**Items and Inventory** - -- View your inventory by pressing `i`. Most item related commands can also be - done with this menu. -- You can wear amour with `W;` amour gives `AC`, while heavier body armour - reduces `EV`. -- Autoexplore will automatically pick up useful items, such as potions and - scrolls, if you aren't in danger. -- You can read scrolls with `r` and drink ("quaff") potions with `q`. -- Equipment items may have brands, with special properties. Branded equipment is - blue when unidentified. -- Equipment items may be artifacts, often with unique properties, and are - unmodifiable. They are written in white. -- You can evoke wands with `V`. -- You can put on jewelry with `P`, and remove it with `R`. -- Gold is used in shops, which can be interacted with by either `>` or `<`. - -**Magic and Spellcasting** - -- Once you find a spellbook, you can memorize spells with `M`. -- You need to be the same XL as the spell's spell level in order to learn it, in - addition to training magical skill (to lower failure rate). -- Cast spells by pressing `z`, then the letter assigned to the spell. You may - also Quiver a spell and then use it like a ranged weapon (with Shift-Tab). -- You can view your memorized spells by pressing `I` (capital-i) or `z`. -- Like HP, you can recover MP by resting (with 5). -- Many spells can be positioned more effectively, or combined with other spells, - in order to get (more effective) use out of them. -- Heavier body amour and shields hamper spellcasting. - -**Gods and Divine Abilities** - -- You may look at a god's overview by praying at their altar (with `>` or `<`). - After praying, you can worship the god by pressing Enter afterwards. -- Gods all have unique features about them. Trog, the god of the tutorial, is - also the god of rage and bloodshed, and so despises spellcasting. -- Gods like and dislike different things. Most gods either like killing things - (like Trog) or exploring new areas (like Elyvilon), rewarding you piety - (divine favor) for doing so. -- You should learn to use and even rely on divine abilities often, as they are - usually very strong. Trog's Berserk gives you 1.5x health, 1.5x speed (to all - valid actions), and a big damage boost. Note that Berserk prevents most - actions other than move and melee attack, and runs out very quickly if you - aren't attacking. And after berserk ends, you are slowed down and can't - berserk again for a short time. -- In addition, the vast majority of abilities consume piety in the process. - Regardless, this ability is very cheap, and the benefits are incredible, so - don't hold back! -- 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 @@ ---- -title: Display xterm color palette -url: xterm-color-palette.html -date: 2023-05-25T12:00:00+02:00 -type: note -draft: false -tags: [linux] ---- - -- `bash xterm-palette.sh` - will show you number of max colors available -- `bash xterm-palette.sh -v` - will create a list of all colors with codes - -![xterm color palette](/notes/xterm-palette.png) - -```sh -#!/usr/bin/env bash -# xterm-palette.sh - -trap 'tput sgr0' exit # Clean up even if user hits ^C - -function setfg () { - printf '\e[38;5;%dm' $1 -} - -function setbg () { - printf '\e[48;5;%dm' $1 -} - -function showcolors() { - # Given an integer, display that many colors - for ((i=0; i<$1; i++)) - do - printf '%4d ' $i - setbg $i - tput el - tput sgr0 - echo - done - tput sgr0 el -} - -# First, test if terminal supports OSC 4 at all. -printf '\e]4;%d;?\a' 0 -read -d $'\a' -s -t 0.1 -#include -#include -#include - -void -main() -{ - ulong co; - Image *im, *bg; - co = 0x0000FFFF; - - if (initdraw(nil, nil, argv0) < 0) - { - sysfatal("%s: %r", argv0); - } - - im = allocimage(display, Rect(0, 0, 300, 300), RGB24, 0, DYellow); - bg = allocimage(display, Rect(0, 0, 1, 1), RGB24, 1, co); - - if (im == nil || bg == nil) - { - sysfatal("not enough memory"); - } - - draw(screen, screen->r, bg, nil, ZP); - draw(screen, screen->r, im, nil, Pt(-40, -40)); - - flushimage(display, Refnone); - - // Wait 10 seconds before exiting. - sleep(10000); - - exits(nil); -} -``` - -And then compile with `mk` (mkfile below): - -```makefile -# mkfile - - - - - - - - - - - - - - - - -``` - -Now the markdown file `presentation.md` with presenetation. `---` is used to -separate slides. Other stuff is just pure markdown. - -```md -class: center, middle - -# Main title of the presentation - ---- - -# Fist slide - -Eveniet mollitia nemo architecto rerum aut iure iste. Sit nihil nobis libero iusto fugit nam laudantium ut. Dignissimos corrupti laudantium nisi. - -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. -- Integer aliquet mauris a felis fringilla, ut congue massa finibus. - ---- - -# Slide two - -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. -- Vestibulum eget leo ac dolor venenatis pulvinar. -``` 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 @@ ---- -title: "Making cgit look nicer" -url: making-cgit-look-nicer.html -date: 2023-06-24T13:33:58+02:00 -type: note -draft: false -tags: [git] ---- - -For personal use I have a [private Git server](https://git.mitjafelicijan.com) -set up and I use GitHub just as a mirror. By default the cgit theme looks a bit -dated so I made the flowing theme. - -- `/etc/cgitrc` - -```ini -css=/cgit.css -logo=/startrek.gif -favicon=/favicon.png -source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh -about-filter=/usr/lib/cgit/filters/about-formatting.sh - -local-time=1 -snapshots=tar.gz -repository-sort=age -cache-size=1000 -branch-sort=age -summary-log=200 -max-atom-items=50 -max-repo-count=100 - -enable-index-owner=0 -enable-follow-links=1 -enable-log-filecount=1 -enable-log-linecount=1 - -root-title=Place for code, experiments and other bullshit! -root-desc= -clone-url=git@git.mitjafelicijan.com:/home/git/$CGIT_REPO_URL - -mimetype.gif=image/gif -mimetype.html=text/html -mimetype.jpg=image/jpeg -mimetype.jpeg=image/jpeg -mimetype.pdf=application/pdf -mimetype.png=image/png -mimetype.svg=image/svg+xml - -readme=:README.md -readme=:readme.md - -# Must be at the end! -virtual-root=/ -scan-path=/home/git/ -``` - -For `syntax-highlighting-edited.sh` follow instructions on -[https://wiki.archlinux.org/title/Cgit](https://wiki.archlinux.org/title/Cgit#Using_highlight). - -- `/usr/share/cgit/cgit.css` - -```css -* { - font-size: 11pt; -} - -body { - font-family: monospace; - background: white; - padding: 1em; -} - -th, td { - text-align: left; -} - -/* HEADER */ - -#header { - margin-bottom: 1em; -} - -#header .logo img { - display: block; - height: 3em; - margin-right: 10px; -} - -#header .sub.right { - display: none; -} - -/* FOOTER */ - -.footer { - margin-top: 2em; - font-style: italic; -} - -.footer, .footer a { - color: gray; -} - -/* TABS */ - -.tabs a { - margin-bottom: 2em; - display: inline-block; - margin-right: 1em; -} - -.tabs td a:only-child { - display: none; -} - -/* HIDING ELEMENTS */ - -.cgit-panel, .form { - display: none; -} - -/* LISTS */ - -.list td, .list th { - padding-right: 2em; -} - -.list .nohover a { - color: black; -} - -.list .button { - padding-right: 0.5em; -} - -/* COMMIT */ - -.commit-subject { - padding: 1em 0; -} - -.decoration a { - padding-left: 0.5em; -} - -.commit-info th { - padding-right: 1em; -} - -.commit-subject { - padding: 2em 0; -} - -table.diff div.head { - padding-top: 2em; -} - -table.diffstat td { - padding-right: 1em; -} - -/* CONTENT */ - -.linenumbers { - padding-right: 0.5em; -} - -.linenumbers a { - color: gray; -} - -.pager { - display: flex; - list-style-type: none; - padding: 0; - gap: 0.5em; -} - -/* DIFF COLORS */ - -table.diff { - width: 100%; -} - -table.diff td { - white-space: pre; -} - -table.diff td div.head { - font-weight: bold; - margin-top: 1em; - color: black; -} - -table.diff td div.hunk { - color: #009; -} - -table.diff td div.add { - color: green; -} - -table.diff td div.del { - color: red; -} -``` 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 @@ ---- -title: "Alacritty open links with modifier" -url: alacritty-open-links-with-modifier.html -date: 2023-06-25T17:17:16+02:00 -type: note -draft: false -tags: [linux] ---- - -Alacritty by default makes all links in the terminal output clickable and this -gets annoying rather quickly. I liked the default behavior of Gnome terminal -where you needed to hold Control key and then you could click and open links. - -To achieve this in Alacritty you need to provide a `hint` in the configuration -file. Config file is located at `~/.config/alacritty/alacritty.yml`. - -```yaml -hints: - enabled: - - regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" - command: xdg-open - post_processing: true - mouse: - enabled: true - mods: Control -``` - -The following should work under any Linux system. For macOS, you will need to -change `command: xdg-open` to something else. - -Now the links will be visible and clickable only when Control key is being -pressed. - -Source: 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 @@ ---- -title: "Development environments with Nix" -url: development-environments-with-nix.html -date: 2023-06-25T16:38:10+02:00 -type: note -draft: false -tags: [random] ---- - -Nix is amazing for making reproducible cross OS development environment. - -First you need to [install Nix package -manager](https://nixos.org/download.html). - -- Create a file `shell.nix` in your project folder. -- In the section that has `python3` etc add programs you want to use. These can - be CLI or GUI applications. It doesn't matter to Nix. - -```nix -{ pkgs ? import {} }: - pkgs.mkShell { - nativeBuildInputs = with pkgs.buildPackages; [ - python3 - tinycc - ]; -} -``` - -And then run it `nix-shell`. By default it will look for `shell.nix` file. If -you want to specify a different file use `nix-shell file.nix`. That is about it. - -When the shell is spawned it could happen that your `PS1` prompt will be -overwritten and your prompt will look differently. In that case you need to -either do `NIX_SHELL_PRESERVE_PROMPT=1 nix shell` or add -`NIX_SHELL_PRESERVE_PROMPT` variable to your `bashrc` or `zshrc` file and set it -to `1`. - -I also have a modified `PS1` prompt for Bash that I use and it also catches the -usage of Nix shell. - -```sh -NIX_SHELL_PRESERVE_PROMPT=1 - -parse_git_branch() { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' -} - -is_inside_nix_shell() { - nix_shell_name="$(basename "$IN_NIX_SHELL" 2>/dev/null)" - if [[ -n "$nix_shell_name" ]]; then - echo " \e[0;36m(nix-shell)\e[0m" - fi -} - -export PS1="[\033[38;5;9m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ " -``` - -And this is what it looks like when you are in a Nix shell. Otherwise that part -of prompt is omitted - -![PS1 Prompt](/notes/ps1-prompt.png) - -More resources: - -- https://nixos.wiki/wiki/Development_environment_with_nix-shell -- https://nixos.wiki/wiki/Main_Page -- https://itsfoss.com/why-use-nixos/ -- 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 @@ ---- -title: "10/GUI 10 Finger Multitouch User Interface" -url: 10gui-10-finger-multitouch-user-interface.html -date: 2023-06-29T14:51:39+02:00 -type: note -draft: false -tags: [graphics] ---- - -Message from 10/GUI team (page 10gui.com does not exist anymore): - -*Over a quarter-century ago, Xerox introduced the modern graphical user -interface paradigm we today take for granted.* - -*That it has endured is a testament to the genius of its design. But the -industry is now at a crossroads: New technologies promise higher-bandwidth -interaction, but have yet to find a truly viable implementation.* - -*10/GUI aims to bridge this gap by rethinking the desktop to leverage technology -in an intuitive and powerful way.* - - 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 @@ ---- -title: "60's IBM Computers Commercial" -url: 60s-ibm-computers-commercial.html -date: 2023-06-29T22:13:45+02:00 -type: note -draft: false -tags: [random] ---- - -Likely aired during an hour-long program during the 1960s, long commercials such -as this typically aired during hour-long programs. They would *not* have aired -during a half-hour program. - - 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 @@ ---- -title: "Set color temperature of displays on i3" -url: set-color-temperature-of-displays-on-i3.html -date: 2023-07-14T09:19:31+02:00 -type: note -draft: false ---- - -I have been using Gnome's night shift for a while now and I have been missing -this feature under i3wm. This can be done with -[redshift](https://linux.die.net/man/1/redshift). - -- On Debian install with `sudo apt install redshift` -- And then manually set it with `redshift -O 3000` -- 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 @@ ---- -title: "Make B/W SVG charts with matplotlib" -url: make-b-w-svg-charts-with-matplotlib.html -date: 2023-08-01T17:04:10+02:00 -type: note -draft: false ---- - -Install pip requirements. - -```sh -pip install matplotlib -pip install pandas -``` - -Example of data being used. - -```text -Epoch,Connect (NLB),Processing (NLB),Waiting (NLB),Total (NLB),Connect (ALB),Processing (ALB),Waiting (ALB),Total (ALB) -1,57.7,315.7,309.4,321.6,9,104.4,98.3,105.7 -2,121.9,114.4,100.3,176.9,5.8,99.1,97.1,101.1 -3,5.3,229.4,231.2,231.4,14.2,83,69.4,87.9 -4,4.2,134.5,112.2,135.3,5.3,132.4,105.5,134.1 -5,5.8,247.4,246.8,248.1,6,74.3,70.2,75.5 -6,9.9,122.9,100.6,122.7,7.5,241.1,79.3,242.3 -7,6.1,170.2,106.4,170.5,7.2,382.4,375.1,383.8 -8,6.6,194.3,201.4,195.5,7.1,130.9,104.8,132.6 -9,6.4,146.1,122.3,147.7,9.4,95.6,74,96.4 -``` - -In the code you can use `df` as dataframes and use the headers like `df["Epoch"]`. -This is how you get a column data with pandas. - -The Python code responsible for generating a chart: - -```python -import csv -import sys - -import matplotlib.pyplot as plt -import pandas as pd - -# Read the data -df = pd.read_csv("data.csv") - -# Settings -plt.title("Connect median NLB vs ALB") -plt.tight_layout(pad=2) -fig = plt.gcf() -fig.set_size_inches(10, 4) - -# Plotting -plt.plot(df["Epoch"], df["Connect (ALB)"], label = "ALB", color="black", linestyle="-") -plt.plot(df["Epoch"], df["Connect (NLB)"], label = "NLB", color="black", linestyle="--") - -# Adding x and y axis labels -plt.xlabel("Epoch", fontstyle="italic") -plt.ylabel("Median value (ms)", fontstyle="italic") - -# Legend -legend = plt.legend() -legend.get_frame().set_linewidth(0) - -# Export as SVG -plt.savefig("plot.svg", format="svg") -``` - -![SVG Chart](/notes/plot.svg) - -The 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 @@ ---- -title: "Floods in Slovenia up close" -url: floods-in-slovenia.html -date: 2023-08-05T07:06:50+02:00 -type: note -draft: false ---- - - - - - -![](/notes/floods/IMG_1469.webp) - -![](/notes/floods/IMG_1470.webp) - - - - 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 @@ ---- -title: "AWS EB PyYAML fix" -url: aws-eb-pyyaml-fix.html -date: 2023-09-18T07:27:29+02:00 -type: note -draft: false ---- - -Recent update of my system completely borked [EB CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-advanced.html) -on my machine. - -I tried installing it with `pip install awsebcli --upgrade --user` and it failed. - -The error was the following. - -```text -Collecting PyYAML<6.1,>=5.3.1 (from awsebcli) - Using cached PyYAML-5.4.1.tar.gz (175 kB) - Installing build dependencies ... done - Getting requirements to build wheel ... error - error: subprocess-exited-with-error - - × Getting requirements to build wheel did not run successfully. - │ exit code: 1 - ╰─> [68 lines of output] -``` - -To fix this issue with PyYAML you must install PyYAML separately. - -Do the following and try installing `eb` again after. - -```sh -echo 'Cython < 3.0' > /tmp/constraint.txt -PIP_CONSTRAINT=/tmp/constraint.txt pip install 'PyYAML==5.4.1' -``` 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 @@ ---- -title: "Compile drawterm on Fedora 38" -url: compile-drawterm-on-fedora-38.html -date: 2023-09-25T09:04:28+02:00 -type: note -draft: false ---- - -First install two dependencies: - -```sh -sudo dnf install libX11-devel libXt-devel -``` - -Clone the repo and compile it: - -```sh -git clone git://git.9front.org/plan9front/drawterm -cd drawterm -CONF=unix make -``` - -That should produce `drawterm` binary. -- cgit v1.2.3