Tips and tricks

Firefox 的 Profile 文件夹可以在这里获取:Firefox 左上角菜单栏 > Help > More Troubleshooting Information > Application Basics > Profile Folder. 在这个 Profile folder 里创建一个叫做 user.js 的文件,就可以实现导出 Firefox 的全局用户设置(修改过的 Firefox 的默认设置)。 所有在 about:config 里修改的设置都在一个叫做 prefs.js 的文件里。=> Prefs.js file 我的 Firefox 用户设置(about:config): mousewheel.with_control.action: 3 Reference: https://support.mozilla.org/en-US/questions/1197798 Change author name in commit message: git config --global user.name <name> git config --global user.email <email> 安装 LazyVim 之后,LSP 的下载会遇到一些网络问题,比如每次都是 pyright 由于一些网络原因安装失败:set -Ux https_proxy 127.0.0.1:7890 和 set -Ux http_proxy 127.0.0.1:7890 都不好使,使用 sing-box 也不行。这时只需要取消系统代理就可以成功联网安装。 ...

2025-01-08

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. --include '*/': Includes all directories (and subdirectories) in the transfer. --exclude '*': Excludes all files.

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.1 ...

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. For VS Code These two environment variables: GTK_USE_PORTAL=1, GDK_DEBUG=portals. ...

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? I see Asahi Lina smoothly using Kate to open projects and files across multiple Mac machines around her to edit back and forth during development. There must be some way to make this work. ...

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). So the full path of btrbk_snapshots will be /btrbk_snapshots, which located just under the root directory. It’s like the “destination” of snapshots. subvolume home: home is also relative to / which set above. It’s the “source” of snapshots. There are also a target field can be set: target /mnt/btrbk_backup, but it’s optional. The target is where the “backup” subvolumes to be created (refer to the man page of btrbk.conf via man btrbk.conf), while the snapshot_dir is where “snapshot” to be stored. incremental strict: which means “non-incremental (initial) backups are never created” (man btrbk.conf). What is snapshot? ...

2023-12-01