From 1100562e29f6476448b656dbddd4cf22505523f6 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 10 Mar 2024 14:59:14 +0100 Subject: Move back to JBMAFP --- .../2022-08-13-algae-spotted-on-river-sava.md | 31 --- _posts/notes/2023-05-01-cachebusting-in-hugo.md | 18 -- _posts/notes/2023-05-05-run-9front-in-qemu.md | 29 --- .../notes/2023-05-06-git-push-multiple-origins.md | 18 -- .../notes/2023-05-07-mount-plan9-over-network.md | 24 --- _posts/notes/2023-05-08-write-iso-usb.md | 16 -- _posts/notes/2023-05-09-catv-weechat-config.md | 22 --- _posts/notes/2023-05-10-plan9-screenshot.md | 23 --- _posts/notes/2023-05-11-fix-plan9-bootloader.md | 21 --- _posts/notes/2023-05-12-install-plan9port-linux.md | 22 --- _posts/notes/2023-05-13-download-youtube-videos.md | 26 --- _posts/notes/2023-05-14-convert-mkv.md | 23 --- _posts/notes/2023-05-15-preview-troff-man-pages.md | 21 --- _posts/notes/2023-05-16-mass-set-permission.md | 17 -- .../2023-05-22-non-blocking-shell-exec-csharp.md | 45 ----- .../notes/2023-05-23-extend-lua-with-custom-c.md | 55 ------ _posts/notes/2023-05-23-parse-rss-with-lua.md | 41 ---- _posts/notes/2023-05-24-fresh-9front-desktop.md | 15 -- _posts/notes/2023-05-25-dcss-new-player-guide.md | 99 ---------- _posts/notes/2023-05-25-show-xterm-colors.md | 85 --------- _posts/notes/2023-05-25-tmux-sane-defaults.md | 38 ---- .../2023-05-27-cronjobs-github-with-actions.md | 34 ---- _posts/notes/2023-05-27-dcss-on-4k-displays.md | 31 --- _posts/notes/2023-05-27-drawing-pixels-in-plan9.md | 84 --------- _posts/notes/2023-05-28-easy-time-took-in-bash.md | 26 --- .../2023-05-29-grep-to-less-maintain-colors.md | 26 --- _posts/notes/2023-05-31-extending-dte-editor.md | 53 ------ _posts/notes/2023-06-01-ewd-manuscripts-ebook.md | 23 --- _posts/notes/2023-06-04-bulk-make-thumbnails.md | 22 --- .../2023-06-21-presentations-with-markdown.md | 79 -------- _posts/notes/2023-06-24-making-cgit-look-nicer.md | 207 --------------------- ...023-06-25-alacritty-open-links-with-modifier.md | 36 ---- ...2023-06-25-development-environments-with-nix.md | 69 ------- ...29-10gui-10-finger-multitouch-user-interface.md | 26 --- .../2023-06-29-60s-ibm-computers-commercial.md | 18 -- ...-fix-screen-tearing-on-debian-12-xorg-and-i3.md | 23 --- ...nline-radio-streaming-with-mpv-from-terminal.md | 15 -- ...7-14-set-color-temperature-of-displays-on-i3.md | 16 -- ...23-08-01-make-b-w-svg-charts-with-matplotlib.md | 71 ------- _posts/notes/2023-08-05-floods-in-slovenia.md | 20 -- _posts/notes/2023-09-18-aws-eb-pyyaml-fix.md | 36 ---- .../2023-09-25-compile-drawterm-on-fedora-38.md | 24 --- ...4-using-ffmpeg-to-combine-video-side-by-side.md | 41 ---- .../2023-11-05-add-lazy-loading-to-jekyll-posts.md | 34 ---- .../notes/2023-11-07-personal-sane-vim-defaults.md | 60 ------ _posts/notes/2024-02-15-extract-lines-from-file.md | 20 -- _posts/notes/2024-02-21-dcss-online-rc-defaults.md | 35 ---- ...2024-02-23-uninstall-ollama-from-a-linux-box.md | 26 --- 48 files changed, 1844 deletions(-) delete mode 100644 _posts/notes/2022-08-13-algae-spotted-on-river-sava.md delete mode 100644 _posts/notes/2023-05-01-cachebusting-in-hugo.md delete mode 100644 _posts/notes/2023-05-05-run-9front-in-qemu.md delete mode 100644 _posts/notes/2023-05-06-git-push-multiple-origins.md delete mode 100644 _posts/notes/2023-05-07-mount-plan9-over-network.md delete mode 100644 _posts/notes/2023-05-08-write-iso-usb.md delete mode 100644 _posts/notes/2023-05-09-catv-weechat-config.md delete mode 100644 _posts/notes/2023-05-10-plan9-screenshot.md delete mode 100644 _posts/notes/2023-05-11-fix-plan9-bootloader.md delete mode 100644 _posts/notes/2023-05-12-install-plan9port-linux.md delete mode 100644 _posts/notes/2023-05-13-download-youtube-videos.md delete mode 100644 _posts/notes/2023-05-14-convert-mkv.md delete mode 100644 _posts/notes/2023-05-15-preview-troff-man-pages.md delete mode 100644 _posts/notes/2023-05-16-mass-set-permission.md delete mode 100644 _posts/notes/2023-05-22-non-blocking-shell-exec-csharp.md delete mode 100644 _posts/notes/2023-05-23-extend-lua-with-custom-c.md delete mode 100644 _posts/notes/2023-05-23-parse-rss-with-lua.md delete mode 100644 _posts/notes/2023-05-24-fresh-9front-desktop.md delete mode 100644 _posts/notes/2023-05-25-dcss-new-player-guide.md delete mode 100644 _posts/notes/2023-05-25-show-xterm-colors.md delete mode 100644 _posts/notes/2023-05-25-tmux-sane-defaults.md delete mode 100644 _posts/notes/2023-05-27-cronjobs-github-with-actions.md delete mode 100644 _posts/notes/2023-05-27-dcss-on-4k-displays.md delete mode 100644 _posts/notes/2023-05-27-drawing-pixels-in-plan9.md delete mode 100644 _posts/notes/2023-05-28-easy-time-took-in-bash.md delete mode 100644 _posts/notes/2023-05-29-grep-to-less-maintain-colors.md delete mode 100644 _posts/notes/2023-05-31-extending-dte-editor.md delete mode 100644 _posts/notes/2023-06-01-ewd-manuscripts-ebook.md delete mode 100644 _posts/notes/2023-06-04-bulk-make-thumbnails.md delete mode 100644 _posts/notes/2023-06-21-presentations-with-markdown.md delete mode 100644 _posts/notes/2023-06-24-making-cgit-look-nicer.md delete mode 100644 _posts/notes/2023-06-25-alacritty-open-links-with-modifier.md delete mode 100644 _posts/notes/2023-06-25-development-environments-with-nix.md delete mode 100644 _posts/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md delete mode 100644 _posts/notes/2023-06-29-60s-ibm-computers-commercial.md delete mode 100644 _posts/notes/2023-07-10-fix-screen-tearing-on-debian-12-xorg-and-i3.md delete mode 100644 _posts/notes/2023-07-10-online-radio-streaming-with-mpv-from-terminal.md delete mode 100644 _posts/notes/2023-07-14-set-color-temperature-of-displays-on-i3.md delete mode 100644 _posts/notes/2023-08-01-make-b-w-svg-charts-with-matplotlib.md delete mode 100644 _posts/notes/2023-08-05-floods-in-slovenia.md delete mode 100644 _posts/notes/2023-09-18-aws-eb-pyyaml-fix.md delete mode 100644 _posts/notes/2023-09-25-compile-drawterm-on-fedora-38.md delete mode 100644 _posts/notes/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md delete mode 100644 _posts/notes/2023-11-05-add-lazy-loading-to-jekyll-posts.md delete mode 100644 _posts/notes/2023-11-07-personal-sane-vim-defaults.md delete mode 100644 _posts/notes/2024-02-15-extract-lines-from-file.md delete mode 100644 _posts/notes/2024-02-21-dcss-online-rc-defaults.md delete mode 100644 _posts/notes/2024-02-23-uninstall-ollama-from-a-linux-box.md (limited to '_posts/notes') 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 @@ ---- -title: Aerial photography of algae spotted on river Sava -permalink: /aerial-photography-of-algae-spotted-on-river-sava.html -date: 2022-08-13T12:00:00+02:00 -layout: post -type: note -draft: false ---- - -This is a bit of a different post than I usually write, but quite interesting -one to me. River Sava has plenty of hydropower plants located down the stream. -This makes regulating the strength of a current easier than normally. Because of -lower stream strength and high temperatures, algae has formed on the river. -This is the first time I've seen something like this in my whole life. - -Below are some photographs taken from a DJI drone capturing the event. - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-0.jpg){:loading="lazy"} - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-1.jpg){:loading="lazy"} - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-2.jpg){:loading="lazy"} - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-3.jpg){:loading="lazy"} - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-4.jpg){:loading="lazy"} - -![Algae on Sava](/assets/posts/algae-sava/dji-algae-5.jpg){:loading="lazy"} - -I will try to get more photos of this in the future days and if something -intriguing 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 @@ ---- -title: Cache busting in Hugo -permalink: /cachebusting-in-hugo.html -date: 2023-05-01T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Run 9front in Qemu -permalink: /run-9front-in-qemu.html -date: 2023-05-05T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Push to multiple origins at once in Git -permalink: /git-push-multiple-origins.html -date: 2023-05-06T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Mount Plan9 over network -permalink: /mount-plan9-over-network.html -date: 2023-05-07T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Write ISO to USB Key -permalink: /write-iso-usb.html -date: 2023-05-08T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: "#cat-v on weechat configuration" -permalink: /catv-weechat-config.html -date: 2023-05-09T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Take a screenshot in Plan9 -permalink: /plan9-screenshot.html -date: 2023-05-10T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Fix bootloader not being written in Plan9 -permalink: /fix-plan9-bootloader.html -date: 2023-05-11T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Install Plan9port on Linux -permalink: /install-plan9port-linux.html -date: 2023-05-12T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Download list of YouTube files -permalink: /download-youtube-videos.html -date: 2023-05-13T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Convert all MKV files into other formats -permalink: /convert-mkv.html -date: 2023-05-14T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Previews how man page written in Troff will look like -permalink: /preview-troff-man-pages.html -date: 2023-05-15T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Change permissions of matching files recursively -permalink: /mass-set-permission.html -date: 2023-05-16T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Execute not blocking async shell command in C# -permalink: /non-blocking-shell-exec-csharp.html -date: 2023-05-22T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Extend Lua with custom C functions using Clang -permalink: /extend-lua-with-custom-c.html -date: 2023-05-23T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: Parse RSS feeds with Lua -permalink: /parse-rss-with-lua.html -date: 2023-05-23T12:00:00+02:00 -layout: post -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/_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 @@ ---- -title: My brand new Plan9/9front desktop -permalink: /fresh-9front-desktop.html -date: 2023-05-24T12:00:00+02:00 -layout: post -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](/assets/notes/9front-desktop.png){:loading="lazy"} - 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 @@ ---- -title: Dungeon Crawl Stone Soup - New player guide -permalink: /dcss-new-player-guide.html -date: 2023-05-25T22:00:00+02:00 -layout: post -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](/assets/notes/dcss-quickstart.pdf) - Very short introduction to the - game -- [DCSS Manual](/assets/notes/dcss_manual.pdf) - Extensive manual about the game - -![Dungeon Crawl Stone Soup](/assets/notes/dcss.jpg){:loading="lazy"} - -**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/_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 @@ ---- -title: Display xterm color palette -permalink: /xterm-color-palette.html -date: 2023-05-25T12:00:00+02:00 -layout: post -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](/assets/notes/xterm-palette.png){:loading="lazy"} - -```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/_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 @@ ---- -title: "Making cgit look nicer" -permalink: /making-cgit-look-nicer.html -date: 2023-06-24T13:33:58+02:00 -layout: post -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/_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 @@ ---- -title: "Alacritty open links with modifier" -permalink: /alacritty-open-links-with-modifier.html -date: 2023-06-25T17:17:16+02:00 -layout: post -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/_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 @@ ---- -title: "Development environments with Nix" -permalink: /development-environments-with-nix.html -date: 2023-06-25T16:38:10+02:00 -layout: post -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](/assets/notes/ps1-prompt.png){:loading="lazy"} - -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/_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 @@ ---- -title: "10/GUI 10 Finger Multitouch User Interface" -permalink: /10gui-10-finger-multitouch-user-interface.html -date: 2023-06-29T14:51:39+02:00 -layout: post -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/_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 @@ ---- -title: "60's IBM Computers Commercial" -permalink: /60s-ibm-computers-commercial.html -date: 2023-06-29T22:13:45+02:00 -layout: post -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/_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 @@ ---- -title: "Fix screen tearing on Debian 12 Xorg and i3" -permalink: /fix-screen-tearing-on-debian-12-xorg-and-i3.html -date: 2023-07-10T04:21:48+02:00 -layout: post -type: note -draft: false ---- - -I have been experiencing some issues with Intel® Integrated HD Graphics 3000 -under Debian 12 with Xorg and i3. Using `picom` compositor didn't help. To fix -this issue create new file `/etc/X11/xorg.conf.d/20-intel.conf` as root and put -the following in the file. - -```txt -Section "Device" - Identifier "Intel Graphics" - Driver "intel" - Option "TearFree" "true" -EndSection -``` - -Reboot 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 @@ ---- -title: "Online radio streaming with MPV from terminal" -permalink: /online-radio-streaming-with-mpv-from-terminal.html -date: 2023-07-10T03:34:45+02:00 -layout: post -type: note -draft: false ---- - -Recently I have been using my Thinkpad x220 more and there are some constraints -I have faced with it. CPU is not as powerful as on my main machine and I really -want to listen to some music while using the machine. Browsers really are bloat. - -Check out this site https://streamurl.link/ and copy the stream url and then do -`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 @@ ---- -title: "Set color temperature of displays on i3" -permalink: /set-color-temperature-of-displays-on-i3.html -date: 2023-07-14T09:19:31+02:00 -layout: post -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/_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 @@ ---- -title: "Make B/W SVG charts with matplotlib" -permalink: /make-b-w-svg-charts-with-matplotlib.html -date: 2023-08-01T17:04:10+02:00 -layout: post -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](/assets/notes/plot.svg){:loading="lazy"} - -The 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 @@ ---- -title: "Floods in Slovenia up close" -permalink: /floods-in-slovenia.html -date: 2023-08-05T07:06:50+02:00 -layout: post -type: note -draft: false ---- - - - - - -![](/assets/notes/floods/IMG_1469.webp){:loading="lazy"} - -![](/assets/notes/floods/IMG_1470.webp){:loading="lazy"} - - - - 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 @@ ---- -title: "AWS EB PyYAML fix" -permalink: /aws-eb-pyyaml-fix.html -date: 2023-09-18T07:27:29+02:00 -layout: post -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/_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 @@ ---- -title: "Compile drawterm on Fedora 38" -permalink: /compile-drawterm-on-fedora-38.html -date: 2023-09-25T09:04:28+02:00 -layout: post -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. 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 @@ ---- -title: "Using ffmpeg to combine videos side by side" -permalink: /using-ffmpeg-to-combine-video-side-by-side.html -date: 2023-11-04T09:04:28+02:00 -layout: post -type: note -draft: false ---- - -I had a 4 webm videos (each 492x451) that I wanted to combine to be played side -by side and I tried [iMovie](https://support.apple.com/imovie) and -[Kdenlive](https://kdenlive.org/) and failed to do it in an easy way. I needed -this for Github readme file so it also needed to be a GIF. - -The following is the [ffmpeg](https://ffmpeg.org/) version of it. - -```sh -ffmpeg -y \ - -i 01.webm \ - -i 02.webm \ - -i 03.webm \ - -i 04.webm \ - -filter_complex "\ - [0:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a0]; \ - [1:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a1]; \ - [2:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a2]; \ - [3:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a3]; \ - [a0][a1][a2][a3] xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0, scale=1000:-1 [v]" \ - -map "[v]" \ - -crf 23 \ - -preset veryfast \ - trigraphs.gif -``` - -- This will produce `trigraphs.gif` that is also scaled to max 1000px in width - (refer to `scale=1000:-1`). -- The important part for 4x1 stack is `xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0`. -- This will also cap frame rate to 6 (refer to `fps=6`) since that is enough and - this makes playback of GIFs smoother in a browser. - -![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 @@ ---- -title: "Add lazy loading of images in Jekyll posts" -permalink: /add-lazy-loading-to-jekyll-posts.html -date: 2023-11-05T09:04:28+02:00 -layout: post -type: note -draft: false ---- - -Normally you define images with `![]()` in markdown files. But jekyll also -provides a way to adding custom attributes to tags with `{:attr="value"}`. - -If you have lots of posts this command will append `{:loading="lazy"}` to all -images in all your markdown files. - -```md -![image-title](/path/to/your/image.jpg) -``` - -will become - -```md -![image-title](/path/to/your/image.jpg){:loading="lazy"} -``` - -Shell line bellow. Go into the folder where your posts are (probably `_posts`). - -```sh -find . -type f -name "*.md" -exec sed -i -E 's/(\!\[.*\]\((.*?)\))$/\1{:loading="lazy"}/' {} \; -``` - -Under the hood this adds `loading="lazy"` to HTML `img` nodes. - -That 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 @@ ---- -title: "Personal sane Vim defaults" -permalink: /apersonal-sane-vim-defaults.html -date: 2023-11-07T01:04:28+02:00 -layout: post -type: note -draft: false ---- - -I have found many "sane" default configs on the net and this is my favorite -personal list. This is how my `.vimrc` file looks like. - -```vimrc -" General sane defaults. -syntax enable -colorscheme sorbet -nnoremap q: -set nocompatible -set relativenumber -set nohlsearch -set smartcase -set ignorecase -set incsearch -set autoindent -set nowrap -set nobackup -set noswapfile -set autoread -set wildmenu -set encoding=utf8 -set backspace=2 -set scrolloff=4 -set spelllang=en_us - -" Status Line enhancements. -set laststatus=2 -set statusline=%f%m%=%y\ %{strlen(&fenc)?&fenc:'none'}\ %l:%c\ %L\ %P -hi StatusLine cterm=NONE ctermbg=black ctermfg=brown -hi StatusLineNC cterm=NONE ctermbg=black ctermfg=darkgray - -" Commenting blocks of code. -augroup commenting_blocks_of_code - autocmd! - autocmd FileType c,cpp,go,scala let b:comment_leader = '// ' - autocmd FileType sh,ruby,python let b:comment_leader = '# ' - autocmd FileType conf,fstab let b:comment_leader = '# ' - autocmd FileType lua let b:comment_leader = '-- ' - autocmd FileType vim let b:comment_leader = '" ' -augroup END -noremap ,cc :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch -noremap ,cu :silent s/^\V=escape(b:comment_leader,'\/')//e:nohlsearch - -" Language specific indentation. -filetype plugin indent on -autocmd Filetype make,go,c,cpp setlocal noexpandtab tabstop=4 shiftwidth=4 -autocmd Filetype html,js,css setlocal expandtab tabstop=2 shiftwidth=2 -``` - -I keep it pretty vanilla so this is about everything I have in the file. - 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 @@ ---- -title: "Extract lines from a file with sed" -permalink: /extract-lines-from-file-with-sed.html -date: 2024-02-15T10:04:28+02:00 -layout: post -type: note -draft: false ---- - -Easy way to extract line ranges (from line 200 to line 210) with sed. - -```sh -sed -n '200,210p' data/Homo_sapiens.GRCh38.dna.chromosome.18.fa - -# then pipe it to a new file with - -sed -n '200,210p' data/Homo_sapiens.GRCh38.dna.chromosome.18.fa > new.fa -``` - -`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 @@ ---- -title: "Sane default for Dungeon Crawl Stone Soup Online edition" -permalink: /dcss-online-rc-defaults.html -date: 2024-02-21T06:35:11+02:00 -layout: post -type: note -draft: false -tags: [dcss] ---- - -I mostly play Dungeon Crawl Stone Soup online on Ohio, USA: cbro.berotato.org server and -when you start playing you can select the version you want to play. Each instance also -has `rc` file that can customize the way the game behave. - -This is my sane defaults config. It zooms in the game without needing to zoom in the -browser and it also adds a bit of delays in exploring and it stops at fight. - -```ini -autofight_stop = 80 -explore_auto_rest = true -explore_delay = 20 - -tile_cell_pixels = 48 -tile_font_crt_size = 24 -tile_font_stat_size = 24 -tile_font_msg_size = 24 -tile_font_tip_size = 24 -tile_font_lbl_size = 24 -tile_map_pixels = 0 -tile_filter_scaling = false -``` - -All the possible options are documented in the [Dungeon Crawl Stone Soup Options -Guide](https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt) -file. 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 @@ ---- -title: Uninstall Ollama from a Linux box -permalink: /uninstall-ollama-from-a-linux-box.html -date: 2024-02-23 -layout: post -draft: false -type: note ---- -I have had some issues with Ollama not being up-to-date. If Ollama is installed with a curl command, it adds a systemd service. - -```sh -sudo systemctl stop ollama -sudo systemctl disable ollama -sudo rm /etc/systemd/system/ollama.service -sudo systemctl daemon-reload - -sudo rm /usr/local/bin/ollama - -sudo userdel ollama -sudo groupdel ollama - -rm -r ~/.ollama -sudo rm -rf /usr/share/ollama -``` - -That is about it. \ No newline at end of file -- cgit v1.2.3