index // links

SSG

Posted: Tue, 22-10-2025.

Suddenly I wanted to redesign my blog into one long page. I made really simple static site generator in python. This is the first time I used uv. I write blog posts in markdown and place them inside md directory. For all files in md directory, if there is no corresponding html file in tmp directory or it is newer, I will convert it using markdown library to html and place it in tmp directory. Then I join all html files inside tmp directory into single HTML.


My Youtube Channel

Posted: Tue, 17-11-2024.

I made a youtube channel and posted my first video. Link here. I always fail to verify my phone number. So I cannot post videos longer than 15 minutes for now.

My first video is about creating a vim plugin fsticky. I recorded with obs-studio and then reduced the file size using ffmpeg with the following command

ffmpeg -i input.mp4 -vcodec libx264 -crf 24 output.mp4

This is not intended as tutorial. I just record what I think interesting. I don't record with my own voice because my pronounciation is bad. Also I don't have a good setup for recording audio. But I will use text to speech voice. The one I use is piper. a fast, local neural text to speech system. Actually this is what my next video about. I will write a wrapper around piper. So I can call that inside vim and passing curently selected text to say.


Porting Old Sketches

Posted: Tue, 26-11-2024.

I used processing in 2022 and p5 in 2023. Many of my sketches are just static designs. Now I port that to vanila javascript with html canvas. This is part of my new project Element of Creative Coding (EoCC) where I try to categorize, implement, and document aspects and techniques in creative coding as I am learning. Here is the link: eocc.

I try to minimize dependecies. Every sketch will have exactly two files: sketch-name.html and sketch-name.js. There are no separate js files for helper functions. No CSS. I want it to be easy to copy and run individual sketch on others machine.

This project has no rigid plan and no deadline. Any time I find something intresting I try to build that and add to this collection with some explanations. More about this project on future post.


Finished Computer Graphics from Scratch

Posted: Sun, 17-11-2024.

I followed Computer Graphics from Scratch book by Gabriel Gambetta. Here is the online version I port the provided demo code from javascript to c. This is by far my biggest c project. See here.

I don't use external libraries. The image result is in ppm format. File ppm.h on the root is used for managing ppm image. I open the image using feh:

feh --force-aliasing filename.ppm

Some chapters has more than one demo but here I combine them per chapter. I should refactor them.

I found that I improved more by just searching and learning the particular thing I need than reading the whole book.


My i3 Config

Posted: Sun, 22-09-2024. Edited: Sun, 24-11-2024.

First, I ran this to generate the config file:

$ i3-config-wizard

Here I chose Windows key as my mod key.

I made bindings to adjust volume and brightness.

bindsym $mod+F1 exec amixer sset 'Master' toggle
bindsym $mod+F3 exec amixer sset 'Master' 5%-
bindsym $mod+Shift+F3 exec amixer sset 'Master' 5%+
bindsym $mod+F5 exec xbacklight -0.5
bindsym $mod+Shift+F5 exec xbacklight +0.5

I increased the font size for window title and bar.

font pango:monospace 10

I added wallpaper.

exec_always feh --bg-fill +0+0 ~/Pictures/wallpaper.jpg

I changed tab bar font color because it is hard to see.

client.unfocused #333333 #444444 #ffffff #292d2e #222222

I changed the background color of bar.

colors {
    background #282A2E
}

Disable mouse wheel on bar.

bindsym button4 nop
bindsym button5 nop

My keyboard seldom not working properly and I cannot exit i3. This is my temporary solution.

bindsym --release button3 exec "i3-nagbar -t warning -m 'Do you really want to exit i3?' -B 'Yes, exit i3' 'i3-msg exit'"

I set the default terminal to alacritty.

bindsym $mod+Return exec alacritty

I added binding to scrot (screen capture).

bindsym $mod+F11 exec scrot -F ~/Pictures/SS/'%Y-%m-%d-%H%M%S.png'

For i3status, I set the color to false and set the interval to 5 second.

general {
        colors = false
        interval = 5
}

I used these modules: battery, memory, volume, and tztime.


Reminder for Journaling

Posted: Sun, 14-07-2024. Edited: Mon, 13-10-2025.

I keep forgeting to write my journal. My solution is to create a program that checks and reminds me if I haven't filled my journal whenever I open a terminal.

I only use txt file on vim for journaling. Nothing fancy. I don't like note taking app like obsidian and notion, because too many buttons and many features that I will never use. I use a subset of markdown syntax for organizing my journal:

# Journal

## 2024

### 07-11-24
- Some interesting events.
- Today I learned ....

### 06-11-24
- Finished chapter 1 of "insert book name"
- Tried installing new OS.

So, here is the code: journalreminder.c

First, it checks the last modified date of a given filename argument, in this case my journal.txt file. And subtract that to today's date. Then it prints a message if the date difference is not zero.

To run that everytime I open a terminal I added the following line to my .bashrc file:

~/.dotfiles/utils/journalreminder ~/Meta/journal.txt

One of its limitation is if I forgot to write journal for, say 5 days, and now I write it but only for today's date, it will not show the message again. Though that also what I intended: if I forget to write for one day, the reason might be there is nothing interesting to write that day.


Another Attempt to Create a Blog

Posted: Thu, 11-07-2024. Edited: Mon, 13-10-2025.

Let's start with my list of failed blog/web projects:

In this attempt, I made the following principles:

Blog tree:

- index.html
- style.css
- posts/
    - post1.html
    - post2.html
    - ...

I will stick to this structure for every post:

For my coping, I call this HTML meditation. I write the layout once and never change it. So, in 10 years it will look nostalgic. I am writing this on vim. I decided to less worried about my English. I am bad at writing English. I will mostly write bullet list because it is easier than paragraph.

Some inspirations: