From 0cb6a5c81271a61e930505f3315b1d67bdf22724 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 16 Jul 2023 22:46:06 +0200 Subject: Renamed all the notes files to include date --- .../10gui-10-finger-multitouch-user-interface.md | 25 --- 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 | 41 ++++ 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 | 85 +++++++++ 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 ++ content/notes/60s-ibm-computers-commercial.md | 17 -- .../notes/alacritty-open-links-with-modifier.md | 35 ---- content/notes/bulk-make-thumbnails.md | 21 --- content/notes/cachebusting-in-hugo.md | 17 -- content/notes/catv-weechat-config.md | 21 --- content/notes/convert-mkv.md | 22 --- content/notes/cronjobs-github-with-actions.md | 33 ---- content/notes/curriculum-vitae.md | 99 ---------- content/notes/dcss-new-player-guide.md | 98 ---------- content/notes/dcss-on-4k-displays.md | 30 --- content/notes/development-environments-with-nix.md | 68 ------- content/notes/download-youtube-videos.md | 25 --- content/notes/drawing-pixels-in-plan9.md | 83 --------- content/notes/easy-time-took-in-bash.md | 25 --- content/notes/ewd-manuscripts-ebook.md | 22 --- content/notes/extend-lua-with-custom-c.md | 54 ------ content/notes/extending-dte-editor.md | 52 ------ content/notes/fix-plan9-bootloader.md | 20 -- content/notes/fresh-9front-desktop.md | 14 -- content/notes/git-push-multiple-origins.md | 17 -- content/notes/grep-to-less-maintain-colors.md | 25 --- content/notes/install-plan9port-linux.md | 21 --- content/notes/making-cgit-look-nicer.md | 206 --------------------- content/notes/mass-set-permission.md | 16 -- content/notes/mount-plan9-over-network.md | 23 --- content/notes/non-blocking-shell-exec-csharp.md | 44 ----- content/notes/parse-rss-with-lua.md | 41 ---- content/notes/plan9-screenshot.md | 22 --- content/notes/presentations-with-markdown.md | 78 -------- content/notes/preview-troff-man-pages.md | 20 -- content/notes/run-9front-in-qemu.md | 28 --- content/notes/show-xterm-colors.md | 85 --------- content/notes/tmux-sane-defaults.md | 37 ---- content/notes/write-iso-usb.md | 15 -- content/pages/curriculum-vitae.md | 99 ++++++++++ 70 files changed, 1459 insertions(+), 1459 deletions(-) delete mode 100644 content/notes/10gui-10-finger-multitouch-user-interface.md create mode 100644 content/notes/2023-05-01-cachebusting-in-hugo.md create mode 100644 content/notes/2023-05-05-run-9front-in-qemu.md create mode 100644 content/notes/2023-05-06-git-push-multiple-origins.md create mode 100644 content/notes/2023-05-07-mount-plan9-over-network.md create mode 100644 content/notes/2023-05-08-write-iso-usb.md create mode 100644 content/notes/2023-05-09-catv-weechat-config.md create mode 100644 content/notes/2023-05-10-plan9-screenshot.md create mode 100644 content/notes/2023-05-11-fix-plan9-bootloader.md create mode 100644 content/notes/2023-05-12-install-plan9port-linux.md create mode 100644 content/notes/2023-05-13-download-youtube-videos.md create mode 100644 content/notes/2023-05-14-convert-mkv.md create mode 100644 content/notes/2023-05-15-preview-troff-man-pages.md create mode 100644 content/notes/2023-05-16-mass-set-permission.md create mode 100644 content/notes/2023-05-22-non-blocking-shell-exec-csharp.md create mode 100644 content/notes/2023-05-23-extend-lua-with-custom-c.md create mode 100644 content/notes/2023-05-23-parse-rss-with-lua.md create mode 100644 content/notes/2023-05-24-fresh-9front-desktop.md create mode 100644 content/notes/2023-05-25-dcss-new-player-guide.md create mode 100644 content/notes/2023-05-25-show-xterm-colors.md create mode 100644 content/notes/2023-05-25-tmux-sane-defaults.md create mode 100644 content/notes/2023-05-27-cronjobs-github-with-actions.md create mode 100644 content/notes/2023-05-27-dcss-on-4k-displays.md create mode 100644 content/notes/2023-05-27-drawing-pixels-in-plan9.md create mode 100644 content/notes/2023-05-28-easy-time-took-in-bash.md create mode 100644 content/notes/2023-05-29-grep-to-less-maintain-colors.md create mode 100644 content/notes/2023-05-31-extending-dte-editor.md create mode 100644 content/notes/2023-06-01-ewd-manuscripts-ebook.md create mode 100644 content/notes/2023-06-04-bulk-make-thumbnails.md create mode 100644 content/notes/2023-06-21-presentations-with-markdown.md create mode 100644 content/notes/2023-06-24-making-cgit-look-nicer.md create mode 100644 content/notes/2023-06-25-alacritty-open-links-with-modifier.md create mode 100644 content/notes/2023-06-25-development-environments-with-nix.md create mode 100644 content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md create mode 100644 content/notes/2023-06-29-60s-ibm-computers-commercial.md delete mode 100644 content/notes/60s-ibm-computers-commercial.md delete mode 100644 content/notes/alacritty-open-links-with-modifier.md delete mode 100644 content/notes/bulk-make-thumbnails.md delete mode 100644 content/notes/cachebusting-in-hugo.md delete mode 100644 content/notes/catv-weechat-config.md delete mode 100644 content/notes/convert-mkv.md delete mode 100644 content/notes/cronjobs-github-with-actions.md delete mode 100644 content/notes/curriculum-vitae.md delete mode 100644 content/notes/dcss-new-player-guide.md delete mode 100644 content/notes/dcss-on-4k-displays.md delete mode 100644 content/notes/development-environments-with-nix.md delete mode 100644 content/notes/download-youtube-videos.md delete mode 100644 content/notes/drawing-pixels-in-plan9.md delete mode 100644 content/notes/easy-time-took-in-bash.md delete mode 100644 content/notes/ewd-manuscripts-ebook.md delete mode 100644 content/notes/extend-lua-with-custom-c.md delete mode 100644 content/notes/extending-dte-editor.md delete mode 100644 content/notes/fix-plan9-bootloader.md delete mode 100644 content/notes/fresh-9front-desktop.md delete mode 100644 content/notes/git-push-multiple-origins.md delete mode 100644 content/notes/grep-to-less-maintain-colors.md delete mode 100644 content/notes/install-plan9port-linux.md delete mode 100644 content/notes/making-cgit-look-nicer.md delete mode 100644 content/notes/mass-set-permission.md delete mode 100644 content/notes/mount-plan9-over-network.md delete mode 100644 content/notes/non-blocking-shell-exec-csharp.md delete mode 100644 content/notes/parse-rss-with-lua.md delete mode 100644 content/notes/plan9-screenshot.md delete mode 100644 content/notes/presentations-with-markdown.md delete mode 100644 content/notes/preview-troff-man-pages.md delete mode 100644 content/notes/run-9front-in-qemu.md delete mode 100644 content/notes/show-xterm-colors.md delete mode 100644 content/notes/tmux-sane-defaults.md delete mode 100644 content/notes/write-iso-usb.md create mode 100644 content/pages/curriculum-vitae.md (limited to 'content') diff --git a/content/notes/10gui-10-finger-multitouch-user-interface.md b/content/notes/10gui-10-finger-multitouch-user-interface.md deleted file mode 100644 index 751d1dc..0000000 --- a/content/notes/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-05-01-cachebusting-in-hugo.md b/content/notes/2023-05-01-cachebusting-in-hugo.md new file mode 100644 index 0000000..b889d6b --- /dev/null +++ b/content/notes/2023-05-01-cachebusting-in-hugo.md @@ -0,0 +1,17 @@ +--- +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 new file mode 100644 index 0000000..b4f3de4 --- /dev/null +++ b/content/notes/2023-05-05-run-9front-in-qemu.md @@ -0,0 +1,28 @@ +--- +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 new file mode 100644 index 0000000..2e96a00 --- /dev/null +++ b/content/notes/2023-05-06-git-push-multiple-origins.md @@ -0,0 +1,17 @@ +--- +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 new file mode 100644 index 0000000..bb83202 --- /dev/null +++ b/content/notes/2023-05-07-mount-plan9-over-network.md @@ -0,0 +1,23 @@ +--- +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 new file mode 100644 index 0000000..03b2c11 --- /dev/null +++ b/content/notes/2023-05-08-write-iso-usb.md @@ -0,0 +1,15 @@ +--- +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 new file mode 100644 index 0000000..b730492 --- /dev/null +++ b/content/notes/2023-05-09-catv-weechat-config.md @@ -0,0 +1,21 @@ +--- +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 new file mode 100644 index 0000000..b3ffae3 --- /dev/null +++ b/content/notes/2023-05-10-plan9-screenshot.md @@ -0,0 +1,22 @@ +--- +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 new file mode 100644 index 0000000..b70d42d --- /dev/null +++ b/content/notes/2023-05-11-fix-plan9-bootloader.md @@ -0,0 +1,20 @@ +--- +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 new file mode 100644 index 0000000..49a1e4c --- /dev/null +++ b/content/notes/2023-05-12-install-plan9port-linux.md @@ -0,0 +1,21 @@ +--- +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 new file mode 100644 index 0000000..33fff05 --- /dev/null +++ b/content/notes/2023-05-13-download-youtube-videos.md @@ -0,0 +1,25 @@ +--- +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 new file mode 100644 index 0000000..2219eed --- /dev/null +++ b/content/notes/2023-05-14-convert-mkv.md @@ -0,0 +1,22 @@ +--- +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 new file mode 100644 index 0000000..330ce51 --- /dev/null +++ b/content/notes/2023-05-15-preview-troff-man-pages.md @@ -0,0 +1,20 @@ +--- +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 new file mode 100644 index 0000000..4891ba8 --- /dev/null +++ b/content/notes/2023-05-16-mass-set-permission.md @@ -0,0 +1,16 @@ +--- +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 new file mode 100644 index 0000000..ffad85c --- /dev/null +++ b/content/notes/2023-05-22-non-blocking-shell-exec-csharp.md @@ -0,0 +1,44 @@ +--- +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 new file mode 100644 index 0000000..554a6a4 --- /dev/null +++ b/content/notes/2023-05-23-extend-lua-with-custom-c.md @@ -0,0 +1,54 @@ +--- +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 new file mode 100644 index 0000000..c2cdcbc --- /dev/null +++ b/content/notes/2023-05-23-parse-rss-with-lua.md @@ -0,0 +1,41 @@ +--- +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/feed.rss" + +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 new file mode 100644 index 0000000..21d8d93 --- /dev/null +++ b/content/notes/2023-05-24-fresh-9front-desktop.md @@ -0,0 +1,14 @@ +--- +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 new file mode 100644 index 0000000..ff8493c --- /dev/null +++ b/content/notes/2023-05-25-dcss-new-player-guide.md @@ -0,0 +1,98 @@ +--- +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 new file mode 100644 index 0000000..cc5eca4 --- /dev/null +++ b/content/notes/2023-05-25-show-xterm-colors.md @@ -0,0 +1,85 @@ +--- +title: Display xterm color palette +url: write-iso-usb.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 new file mode 100644 index 0000000..6eb18fa --- /dev/null +++ b/content/notes/2023-06-24-making-cgit-look-nicer.md @@ -0,0 +1,206 @@ +--- +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 new file mode 100644 index 0000000..eb73c4c --- /dev/null +++ b/content/notes/2023-06-25-alacritty-open-links-with-modifier.md @@ -0,0 +1,35 @@ +--- +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 new file mode 100644 index 0000000..6bae302 --- /dev/null +++ b/content/notes/2023-06-25-development-environments-with-nix.md @@ -0,0 +1,68 @@ +--- +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 new file mode 100644 index 0000000..751d1dc --- /dev/null +++ b/content/notes/2023-06-29-10gui-10-finger-multitouch-user-interface.md @@ -0,0 +1,25 @@ +--- +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 new file mode 100644 index 0000000..c97d747 --- /dev/null +++ b/content/notes/2023-06-29-60s-ibm-computers-commercial.md @@ -0,0 +1,17 @@ +--- +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/60s-ibm-computers-commercial.md b/content/notes/60s-ibm-computers-commercial.md deleted file mode 100644 index c97d747..0000000 --- a/content/notes/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/alacritty-open-links-with-modifier.md b/content/notes/alacritty-open-links-with-modifier.md deleted file mode 100644 index eb73c4c..0000000 --- a/content/notes/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/bulk-make-thumbnails.md b/content/notes/bulk-make-thumbnails.md deleted file mode 100644 index 4bab661..0000000 --- a/content/notes/bulk-make-thumbnails.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Bulk thumbnails" -url: bulk-make-thumbnails.html -date: 2023-06-04T20:46:56+02:00 -type: note -draft: false -tags: [bash] ---- - -Make bulk thumbnails of JPGs with ImageMagick. - -```sh -#!/bin/bash - -directory="./images/" -dimensions="360x360" - -for file in "$directory"*.jpg; do - convert "$file" -resize $dimensions "$file" "${file%.*}-thumbnail.jpg" -done -``` diff --git a/content/notes/cachebusting-in-hugo.md b/content/notes/cachebusting-in-hugo.md deleted file mode 100644 index b889d6b..0000000 --- a/content/notes/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/catv-weechat-config.md b/content/notes/catv-weechat-config.md deleted file mode 100644 index b730492..0000000 --- a/content/notes/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/convert-mkv.md b/content/notes/convert-mkv.md deleted file mode 100644 index 2219eed..0000000 --- a/content/notes/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/cronjobs-github-with-actions.md b/content/notes/cronjobs-github-with-actions.md deleted file mode 100644 index b28e4a9..0000000 --- a/content/notes/cronjobs-github-with-actions.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "Cronjobs on Github with Github Actions" -url: cronjobs-github-with-actions.html -date: 2023-05-27T00:35:36+02:00 -type: note -draft: false -tags: [github] ---- - -In the root of your repository create a folder `.github/workflows` and in that -folder create a file a file `cron.yaml`. This file can be named whatever you -wish. But it has to be a `yaml` file. - -File below (`.github/workflows/cron.yaml`) describes an action that will trigger -every six hours and it will curl example.com. - -However. Be sure that you have enough credits. Free account is not that generous -with the minutes they give you for free. Check more about GitHub Actions usage -on their website https://docs.github.com/en/actions. - -```yaml -# .github/workflows/cron.yaml -name: Do a curl every 6 hours -on: - schedule: - - cron: '0 */6 * * *' -jobs: - cron: - runs-on: ubuntu-latest - steps: - - name: Call some url - run: curl 'https://example.com' -``` diff --git a/content/notes/curriculum-vitae.md b/content/notes/curriculum-vitae.md deleted file mode 100644 index 250a6ec..0000000 --- a/content/notes/curriculum-vitae.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Curriculum Vitae -date: 2022-08-27T12:00:00+02:00 -url: curriculum-vitae.html -type: page -draft: false ---- - - - -
- -![](/assets/cv/avatar.gif) - -
- - - -**Mitja Felicijan** - -Email me at *[m@mitjafelicijan.com](mailto:m@mitjafelicijan.com?subject=Website+CV+Contact)* - -## Technical experience - -- **Key languages:** C, Golang, Lua, Python, Bash. -- **Platforms:** GNU/Linux, macOS. -- **Interests:** Zigbee, KNX, Modbus, Machine to Machine, Embedded systems, Operating systems, Distributed systems, IOT, RDBMS, Algorithms, Database engine design, SQL, NoSQL, NewSQL, Big data analytics, Machine learning, Prediction algorithms, Realtime analytics, Systems automation, Natural language processing, Bioinformatics, Game development. - -## Major projects - -- SMS marketing system (2007) -- Yacht management software (2008) -- Smart Home Gateway (2009) -- Moxa UPort 1130 USB to RS485 Universal Linux driver (2009) -- Remote management of electricity meter (2009) -- Remote management of blood pressure monitor (2010) -- Infomat automation system (2010) -- GPS Tourist - GIS Software (2011) -- Minimal GNU/Linux distribution for embedded platforms (2011) -- Digital Jukebox system (2012) -- NanoCloudLogger - Machine to Machine (2012) -- Street Lightning System (2012) -- Smart cabins with hardware sensor management (2013) -- Contextual advertising server (2015) -- Network accessible database engine for caching and in-memory storage (2016) -- Tick database engine specifically designed for storing and processing large amount of sensor data with high write throughput (2016) -- Wireless industrial lighting management system - hardware and software (2016) -- Minimal configuration reverse proxy (2017) -- Industrial IOT platform for deployment on on-premise (2018) -- Custom Platform as a service based on Docker Swarm (2018) -- Toolkit for encoding binary data into DNA sequence (2019) -- Minimal configuration reverse proxy with load balancing and rate limiting (2019) -- E-ink conference room occupancy display, hardware and software solution (2019) -- Caching module for Apache web server (2022) -- Task runner for the command line (2022) -- World of Warcraft Tweaks and Enhancements Addon (2023) - -## Employment history - -- Freelancer (2001 – Present) -- Software developer at Mobinia (2005 – 2007) -- Senior Software Engineer at Milk (2007 – 2009) -- Co-Founder of UTS (2009 – 2015) -- Senior Software Engineer at TSmedia (2015 - 2017) -- Senior Software Engineer at Renderspace (2017 - 2019) -- Senior Software Engineer at Digg (2019 - Present) - -## Awards - -- Regional Award for Innovation by Chamber of Commerce and Industry of Slovenia for project Intelligent system management and regulation of Street Lighting, 2010 -- National Award for Innovation by Chamber of Commerce and Industry of Slovenia for project Intelligent system management and regulation of Street Lighting, 2010 - -## Key responsibilities - -- Embedded platform development. -- Hardware design and driver development. -- Designing, developing and testing systems. -- Implementation of the systems. -- Writing and maintaining user and technical documents. -- Development and maintenance of the project. -- Code revision, testing and output. -- Work on the enhancement suggested by the customers and fixes the bugs reported. diff --git a/content/notes/dcss-new-player-guide.md b/content/notes/dcss-new-player-guide.md deleted file mode 100644 index ff8493c..0000000 --- a/content/notes/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/dcss-on-4k-displays.md b/content/notes/dcss-on-4k-displays.md deleted file mode 100644 index 8dd7095..0000000 --- a/content/notes/dcss-on-4k-displays.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Make DCSS playable on 4k displays" -url: dcss-on-4k-display.html -date: 2023-05-27T19:35:11+02:00 -type: note -draft: false -tags: [dcss] ---- - -Dungeon Crawl Stone Soup has a a very small font by default. On a 4k display, it -is barely readable. This is how I made it playable. - -Make a file `~/.crawlrc` with the following content: - -```ini -# Adjust the sizes to your liking. - -tile_font_crt_size = 32 -tile_font_stat_size = 32 -tile_font_msg_size = 32 -tile_font_tip_size = 32 -tile_font_lbl_size = 32 -tile_sidebar_pixels = 64 -``` - -To zoom in and out in viewport, press `Ctrl+` and `Ctrl-` respectively. - -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/content/notes/development-environments-with-nix.md b/content/notes/development-environments-with-nix.md deleted file mode 100644 index 6bae302..0000000 --- a/content/notes/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/download-youtube-videos.md b/content/notes/download-youtube-videos.md deleted file mode 100644 index 33fff05..0000000 --- a/content/notes/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/drawing-pixels-in-plan9.md b/content/notes/drawing-pixels-in-plan9.md deleted file mode 100644 index 473ccaf..0000000 --- a/content/notes/drawing-pixels-in-plan9.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: "Drawing Pixels in Plan9" -url: drawing-pixels-in-plan9.html -date: 2023-05-27T17:41:33+02:00 -type: note -draft: false -tags: [plan9, graphics] ---- - -I have started exploring Plan9's graphics capabilities. This is a hello world -alternative for drawing that draws a yellow square on a blue background. - -More information: - -- [draw.h header file](https://github.com/0intro/plan9/blob/main/sys/include/draw.h) - contains all the drawing functions -- [draw man page](https://9fans.github.io/plan9port/man/man3/draw.html) - has a bit more digestable descriptions of the draw functions -- [graphics man page](https://9fans.github.io/plan9port/man/man3/graphics.html) - has a bit more digestable descriptions of the graphics functions -- [all man pages](https://9fans.github.io/plan9port/man/man3/) - can be a valuable resource for learning about the system - -![Plan9 Howdy World!](/notes/plan9-pixels.png) - -```c -// main.c -#include -#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 - - #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/extending-dte-editor.md b/content/notes/extending-dte-editor.md deleted file mode 100644 index a82ab1b..0000000 --- a/content/notes/extending-dte-editor.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: "Extending dte editor" -url: extending-dte-editor.html -date: 2023-05-31T08:12:45+02:00 -type: note -draft: false -tags: [dte] ---- - -[`dte`](https://craigbarnes.gitlab.io/dte/) is an interesting editor I started -using lately more and more. Since it is using -[`execvp()`](https://linux.die.net/man/3/execvp) it can be easily extended. I -needed comment/uncomment feature so I created a small utility that does this for -me. Code lives on repository [dte -extensions](https://git.mitjafelicijan.com/dte-extensions.git/about/) but this -utilities can be used for whatever you want. Make sure you have version 1.11 or -above. - -Next one will be invoking formatter based on the type of a file. - -My config that works for me. - -```sh -set show-line-numbers true; -set tab-width 4; -set case-sensitive-search false; - -# Special aliases -alias m_comment 'exec -s -i line -o buffer -e errmsg ~/.dte/bin/comment' -alias m_format 'save; exec go fmt .; reload' -alias m_duplicate 'copy;paste'; - -# Useful aliases. -alias m_force_close 'quit -f'; -alias m_reload 'close; open $FILE' - -# Key bindings. -bind M-s save; -bind M-q m_force_close; -bind M-z refresh; -bind C-down blkdown; -bind C-up blkup; -bind C-_ m_comment; -bind M-. m_format; -bind C-d m_duplicate; - -# Syntax highlighting. -hi preproc magenta; -hi keyword red; -hi linenumber blue; -hi comment cyan; -``` diff --git a/content/notes/fix-plan9-bootloader.md b/content/notes/fix-plan9-bootloader.md deleted file mode 100644 index b70d42d..0000000 --- a/content/notes/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/fresh-9front-desktop.md b/content/notes/fresh-9front-desktop.md deleted file mode 100644 index 21d8d93..0000000 --- a/content/notes/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/git-push-multiple-origins.md b/content/notes/git-push-multiple-origins.md deleted file mode 100644 index 2e96a00..0000000 --- a/content/notes/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/grep-to-less-maintain-colors.md b/content/notes/grep-to-less-maintain-colors.md deleted file mode 100644 index 6fc40a1..0000000 --- a/content/notes/grep-to-less-maintain-colors.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Grep to Less that maintain colors" -url: grep-to-less-maintain-colors.html -date: 2023-05-29T21:27:07+02:00 -type: note -draft: false -tags: [bash] ---- - -I often use `grep` to search for todo's in my code and other people's code and -then pipe them in `less` and I missed having colors that grep outputs in `less`. - -- Grep's `--color=always` use markers to highlight the matching strings. -- Less's `-R` option outputs "raw" control characters. - -You could use `alias grep='grep --color=always'` and `alias less='less -R'` or -create todo function in your `.bashrc` that accepts first argument as search -string. - -```sh -# This is where the magic happens. -grep --color=always -rni "TODO:" | less -R -``` - -![Less and grep](/notes/grep-less.png) diff --git a/content/notes/install-plan9port-linux.md b/content/notes/install-plan9port-linux.md deleted file mode 100644 index 49a1e4c..0000000 --- a/content/notes/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/making-cgit-look-nicer.md b/content/notes/making-cgit-look-nicer.md deleted file mode 100644 index 6eb18fa..0000000 --- a/content/notes/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/mass-set-permission.md b/content/notes/mass-set-permission.md deleted file mode 100644 index 4891ba8..0000000 --- a/content/notes/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/mount-plan9-over-network.md b/content/notes/mount-plan9-over-network.md deleted file mode 100644 index bb83202..0000000 --- a/content/notes/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/non-blocking-shell-exec-csharp.md b/content/notes/non-blocking-shell-exec-csharp.md deleted file mode 100644 index ffad85c..0000000 --- a/content/notes/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/parse-rss-with-lua.md b/content/notes/parse-rss-with-lua.md deleted file mode 100644 index c2cdcbc..0000000 --- a/content/notes/parse-rss-with-lua.md +++ /dev/null @@ -1,41 +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/feed.rss" - -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/plan9-screenshot.md b/content/notes/plan9-screenshot.md deleted file mode 100644 index b3ffae3..0000000 --- a/content/notes/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/presentations-with-markdown.md b/content/notes/presentations-with-markdown.md deleted file mode 100644 index 49ea53e..0000000 --- a/content/notes/presentations-with-markdown.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "Simple presentations with Markdown" -url: presentations-with-markdown.html -date: 2023-06-21T08:54:48+02:00 -type: note -draft: false -tags: [random] ---- - -A simple way to make presentations without using desktop apps or using online -services is https://github.com/remarkjs/remark. - -First create `index.html` and be sure you make changes to `config` variable. - -```html - - - - - - - - - - - - - - - - -``` - -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/preview-troff-man-pages.md b/content/notes/preview-troff-man-pages.md deleted file mode 100644 index 330ce51..0000000 --- a/content/notes/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/run-9front-in-qemu.md b/content/notes/run-9front-in-qemu.md deleted file mode 100644 index b4f3de4..0000000 --- a/content/notes/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/show-xterm-colors.md b/content/notes/show-xterm-colors.md deleted file mode 100644 index cc5eca4..0000000 --- a/content/notes/show-xterm-colors.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Display xterm color palette -url: write-iso-usb.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 + img { + width: auto !important; + left: initial !important; + margin: initial !important; + border: 0 !important; + } + + +
+ +![](/assets/cv/avatar.gif) + +
+ + + +**Mitja Felicijan** + +Email me at *[m@mitjafelicijan.com](mailto:m@mitjafelicijan.com?subject=Website+CV+Contact)* + +## Technical experience + +- **Key languages:** C, Golang, Lua, Python, Bash. +- **Platforms:** GNU/Linux, macOS. +- **Interests:** Zigbee, KNX, Modbus, Machine to Machine, Embedded systems, Operating systems, Distributed systems, IOT, RDBMS, Algorithms, Database engine design, SQL, NoSQL, NewSQL, Big data analytics, Machine learning, Prediction algorithms, Realtime analytics, Systems automation, Natural language processing, Bioinformatics, Game development. + +## Major projects + +- SMS marketing system (2007) +- Yacht management software (2008) +- Smart Home Gateway (2009) +- Moxa UPort 1130 USB to RS485 Universal Linux driver (2009) +- Remote management of electricity meter (2009) +- Remote management of blood pressure monitor (2010) +- Infomat automation system (2010) +- GPS Tourist - GIS Software (2011) +- Minimal GNU/Linux distribution for embedded platforms (2011) +- Digital Jukebox system (2012) +- NanoCloudLogger - Machine to Machine (2012) +- Street Lightning System (2012) +- Smart cabins with hardware sensor management (2013) +- Contextual advertising server (2015) +- Network accessible database engine for caching and in-memory storage (2016) +- Tick database engine specifically designed for storing and processing large amount of sensor data with high write throughput (2016) +- Wireless industrial lighting management system - hardware and software (2016) +- Minimal configuration reverse proxy (2017) +- Industrial IOT platform for deployment on on-premise (2018) +- Custom Platform as a service based on Docker Swarm (2018) +- Toolkit for encoding binary data into DNA sequence (2019) +- Minimal configuration reverse proxy with load balancing and rate limiting (2019) +- E-ink conference room occupancy display, hardware and software solution (2019) +- Caching module for Apache web server (2022) +- Task runner for the command line (2022) +- World of Warcraft Tweaks and Enhancements Addon (2023) + +## Employment history + +- Freelancer (2001 – Present) +- Software developer at Mobinia (2005 – 2007) +- Senior Software Engineer at Milk (2007 – 2009) +- Co-Founder of UTS (2009 – 2015) +- Senior Software Engineer at TSmedia (2015 - 2017) +- Senior Software Engineer at Renderspace (2017 - 2019) +- Senior Software Engineer at Digg (2019 - Present) + +## Awards + +- Regional Award for Innovation by Chamber of Commerce and Industry of Slovenia for project Intelligent system management and regulation of Street Lighting, 2010 +- National Award for Innovation by Chamber of Commerce and Industry of Slovenia for project Intelligent system management and regulation of Street Lighting, 2010 + +## Key responsibilities + +- Embedded platform development. +- Hardware design and driver development. +- Designing, developing and testing systems. +- Implementation of the systems. +- Writing and maintaining user and technical documents. +- Development and maintenance of the project. +- Code revision, testing and output. +- Work on the enhancement suggested by the customers and fixes the bugs reported. -- cgit v1.2.3