Hello, I’m thomjiji

This website is a mix of my blog, my learning journey, and what I’m up to recently ^^.

Create dummy directories using Rsync

Use rsync to create dummy dirs: rsync -avPih --include '*/' --exclude '*' videos/ ~/Desktop/videos-dummy/ Here’s a breakdown of the command: -avPih: These flags stand for: -a: Archive mode, which preserves permissions, timestamps, symbolic links, etc. -v: Verbose, which provides detailed output. -P: Combines –progress and –partial, showing progress during transfer and allowing for partial transfers to be resumed. -i: Output a change-summary for all updates. -h: Output numbers in a human-readable format....

2024-06-25

Best practice for grading stack in Baselight

Colour Online: Developing Digital Images > Best Practice Stack Start at 59:04:

2024-03-31

Setup Rime on Fedora Asahi Remix

Install fcitx5 and fcitx5-rime via sudo dnf install fcitx5-rime fcitx5. Go to System Setting > Input Devices > Virtual Keyboard, select “Fcitx 5”. Edit environment file via: sudo vi /etc/environment. Add the following content, reference: INPUT_METHOD=fcitx XMODIFIERS=@im=fcitx Open Input Method Selector > Use fcitx5 > Log out. Clone 雾凇拼音 repo into ~/.local/share/fcitx5/, rename it to rime: $ mv rime-ice rime Restart fcitx5 in the lower right corner of your Desktop....

2023-12-30

Use mouse wheel to scroll less in iTerm2

在 iTerm2 中使用 less command 有一个奇怪的点:你不能用鼠标来滚动页面。只能使用 Vim 的 keybinding Ctrl+d 和 Ctrl+u 来上下翻页。而且当你比如在查看一个 command 的 man page 时,因为 man page 默认是使用 less 来打开的,你查看完某个 man page 按 q 退出,然后使用鼠标滚轮往上面滚一下,滚到上面一屏,你会发现你的 Terminal 变得很乱,有很多刚刚你查看的那个 man page 的残留。 我的需求总结来说就是: 能够在 less 里使用鼠标滚轮来翻页,滚动。 退出 less 之后不要有残留。 其实,这里有一个概念叫作 alternate screen。你用 less 打开查看一个什么文件的时候进入的就是一个 alternate sceen,按 q 退出就是退出那个 alternate screen,回到 normal screen。Alternate screen 就是一个单独的 buffer,独立于当前 terminal 的。 When activated, the current screen is saved and replaced with the alternate screen....

2023-12-17

Use native file picker on KDE Plasma

For Firefox Starting with version 64, Firefox can optionally use XDG Desktop Portals to handle various desktop features, such as opening a file picker, or handling MIME types. — Arch Wiki | Firefox | XDG Desktop Portal integration Type about:config in Firefox address bar. Search widget.use-xdg-desktop-portal.file-picker, set it to 1. 0 – Never 1 – Always 2 – Auto (typically depends on whether Firefox is run from within Flatpak or whether the GDK_DEBUG=portals environment is set) Done....

2023-12-09

Pin apps to KDE Panel, not KDE Task Manager

比如你想把 Konsole 和 Firefox 这些最最常用的 app pin 到底部的 bar/dock 上(实际上 KDE 叫它 Panel),最直观的,你下意识的右键 Task Manager 上已经打开的 app,这里有一个“Pin to Task Manager”的选项,勾选上它。但这好像不是你想要的,因为你发现即使 pin 上去了,只要你打开那个 app 的一个 instance,那个刚刚被你 pin 上去的 app 就又不见了。这似乎不是你期待中的“pin”。这时你想要打开那个 app 的第二个 instance,就没法去到老地方,你最初 pin 它的那个地方打开。得找到现在的正在运行的那个 instance 所在的 Task Manager 的地方,右键 > “Open a New Window”。 其实,你刚刚 pin 上去的那个地方,是 Task Manager 的区域。Task Manager 外层还有一个区域,叫作 Panel。你应该,或者说你其实想把它 pin 到 Panel 上。这样不管你开几个 instance,那个 app 的图标还是在那,当你想开第 n+1 的 instance 的时候,还是去那个 pin 的地方点一下就行了。 总的来说,KDE 底部栏的层级是这样的: Panel: Application Launcher Pager Task Manager System tray Digital clock Peak at Desktop 你其实想把 Konsole 和 Firefox pin 到这里:...

2023-12-04

sshfs

How to mount remote machine’s directory on current host? This question originally came up when I wanted to use Kate to edit a configuration file on macOS. I normally ssh into macOS, cd to that directory, and then type kate <file> to try opening the file for editing. But huh? There’s no kate command. Oh right, because I’m in the macOS environment, of course there’s no kate! But this is a problem - am I restricted to only using vi to edit remote files?...

2023-12-03

gpg-agent doesn't work anyway!

Solved by this command: gpg-connect-agent updatestartuptty /bye >/dev/null

2023-12-02

btrfs and btrbk

/etc/btrbk/btrbk.conf config file: volume / snapshot_dir btrbk_snapshots subvolume home incremental strict Key points: volume /: “Base path within a btrfs filesystem containing the subvolumes to be backuped (usually the mount-point of a btrfs filesystem mounted with subvolid=5 option).” In this case, we use the existing root directory — which is already a btrfs filesystem (by default on Fedora). btrbk refer this / (next to volume) as “<volume-directory>”. snapshot_dir btrbk_snapshots: btrbk_snapshots is relative to the volume set above, which in this case the / (root directory)....

2023-12-01

GPG key for SSH authentication

Using GPG key for ssh authentication reduces the effort involved in managing SSH keys, which is the main reason I want to learn this technique. GPG key for all (not just one GPG key possibly).

2023-11-28