arch-linux
Top 20 OpenSSH Server Best Security Practices - nixCraft
My 10 Linux and UNIX Command Line Mistakes - nixCraft
atuinsh/atuin: ✨ Magical shell history
Wayland
wayland hypr
windowrulev2 = opacity 1 override 1 override 1 override,class:^(.*)$
- this disable blur effect
yay + pacman - reflector —country Canada —fastest 10 —threads 8 —save /etc/pacman.d/mirrorlist systemctl + ip + networkctl
sudo netstat -tunapl
- check which one is keep using my network (AU) Wayland Diagnose Detect GTKIM_MODULE being set and Kayland Tnput method frontend is marking. It is recossended to unset GTK_TH MODULE and use Wayland input method P —
For more details see https://fcitx-im.ong/miki/ Using_Feitu_5_on Hayland
hchunhui/librime-lua: Extending RIME with Lua scripts
- extend rime lua
- oh my rime
- ibus
【心得】Steam Deck 桌面模式下安裝速成輸入法 @Steam 綜合討論板 哈啦板 - 巴哈姆特 rime/rime-cantonese: Rime Cantonese input schema | 粵語拼音輸入方案 sudo pacman -S fcitx5 fcitx5-qt fcitx5-gtk fcitx5-rime fcitx5-configtool
Installing Arch Linux with Full Disk Encryption (LVM on LUKS) Arch Linux Post-Installation Configuration | ejmastnak
systemctl enable fstrim.timr
hyprshade on blue-light-filter
kvm, qmenu
grub + sddm + plasm + desktop path
wayland default app setting haven’t setup
- anki env
QT_QPA_PLATFORM=wayland
ANKI_WAYLAND=1
- install qt6-wayland
-
hyde cli → theme (learned about kitty),script and config - some got the optimization setting , for gaming and library
pacman/Tips and tricks - ArchWiki
-
xdg-mime query default inode/directory
-
aria2 settting - Powerpill - ArchWiki Solid state drive - ArchWiki Improving performance/Boot process - ArchWiki Swap - ArchWiki Kernel - ArchWiki
alias tl=“tldr —list | fzf —preview ‘tldr {} —color always’ | xargs tldr”
default file manager
xdg-mime query default inode/directory
- xdg-mime default org.gnome.Nautilus.desktop inode/directory
dragon-drop
Image
nsxiv sxiv imv (better in Wayland)
using pkill fzf name
Wiki for leanring
Category:Software - Gentoo wiki
- Great wiki like arch linuxfiliparag/wikiman: Wikiman is an offline search engine for manual pages, Arch Wiki, Gentoo Wiki and other documentation.
- offline wiki for arch linux terminal
utility for browsering
- Bat
- bat extra
- batpipe and batgrep
- batdiff
delta → git diff
ouch → extract and compress
Rsync
- backup
- ssh
- network backup
rsync -avz source destination
rclone
rclone move -v —drive-chunk-size 128M —fast-list —checkers 256 —progress —transfers (how many files uploading at the same time)
rclone move -v —drive-upload-cutoff 10G —drive-chunk-size 128M —progress done/ pcloud:backup/jp/2024-01-02damn && poweroff
—multi-thread-cutoff 5G
transfers and checkers ⇒ for long list of files
pgrep -a → show what is the command line of that command
fc → previous
Finding which port is being Used
Verify if any other service is using port 873:
sudo lsof -i :873
Useful tmux
tmuxinator/tmuxinator: Manage complex tmux sessions easily tmuxp - ArchWiki
greymd/tmux-xpanes: Awesome tmux-based terminal divider
- ssh
Read The Tao of tmux | Leanpub Practical Tmux — mutelight.org
Vmware setup
After the first installation, please:
-
install the appropriate headers package(s) for your installed kernel(s): linux-headers for default kernel, linux-lts-headers for LTS kernel…
-
reboot or load vmw_vmci and vmmon kernel modules (modprobe -a vmw_vmci vmmon)
-
Enable the services you need (using .service units to activate them during boot or .path units to activate them when a VM is started) :
vmware-networks: to have network access inside VMs
vmware-usbarbitrator: to connect USB devices inside VMs
- KVM/ qmenu(built-in linux ) PCI passthrough via OVMF - ArchWiki
keneral load : intel_iommu=on iommu=pt
QEMU-KVM Installation for Arch Linux
- clear github guilde line for arch linux
there is two usage for libvirt libvirt: Libvirt Daemons
Performance Tuning Guide | Red Hat Product Documentation
- performance tuning guide
linux/virt/kvm/kvm_main.c at master · torvalds/linux
- source code kvm Running virt-manager and libvirt on macOS
Screenshot to text
Easy OCR · Issue #1344 · flameshot-org/flameshot
- flameshot gui —raw | convert -resize 400% png:- png:- | tesseract -l eng stdin stdout | wl-copy
grim -g "$(slurp)" - | tesseract -l eng stdin stdout | wl-copy
optimize size and copy to my wl-copy
#!/usr/bin/env sh
grim -g "$(slurp)" - | pngquant --quality=65-80 - | wl-copy -t image/png
optimize active window screenshot to png to wl-copy
#!/usr/bin/env sh
hyprshot -m window -m active -r - | pngquant --quality=65-80 - | wl-copy -t image/png
Hyprshot/hyprshot at main · Gustash/Hyprshot
- should study hyprshot → it is just a script for hyprland
- Cracking drm
udemy backup
Puyodead1/udemy-downloader: A Udemy downloader that can download courses, with DRM support.
Docker
- vpn docker
some key to stop the gui
ctrl + alt +f11 → put gui to sleep alt +f1-f7 to bring back the gui
ctrl shift + f1 → backto login page wtf
ctrl + alt → escape key in virt manager
Backup method
borgbase/vorta: Desktop Backup Client for Borg Backup
Vpn
用Wireguard做一個瀏覽特定域名才生效的VPN · Reguna
OpenWrt:Don’t VPN Everything! - Split Tunnel Your Traffic - Policy Based Routing
OPNsense:WireGuard Selective Routing to External VPN Endpoint
Keyboard layout (Traditional chinese)
Using Fcitx 5 on Wayland - Fcitx
Coding Linux:
basecamp/omakub: Opinionated Ubuntu Setup
any linux inside your terminal
- dotfile for ubuntu linux (coding)
Gaming :
從Windows到Linux:VFIO及Looking Glass介紹 · Reguna
pufferffish/wireproxy: Wireguard client that exposes itself as a socks5 proxy
我都將屋企部PC轉左做arch 差唔多兩年,除左開唔到HDR之外其實九成半steam既game都係直接玩到,淨返半成轉下proton version 同睇下proton db基本上都行到
有啲rpg maker /唔係steam既game先要用window VM玩
雖然仲有window留低不過唔係debug同試野都唔開
bottlesdevs/Bottles: Run Windows software and games on Linux
Optimization
Virtualization Tuning and Optimization Guide | Red Hat Product Documentation
Virtualization Deployment and Administration Guide | Red Hat Product Documentation
Accounting in linux
ledger/ledger: Double-entry accounting system with a command-line reporting interface
Airdrop file sharing
localsend/localsend: An open-source cross-platform alternative to AirDrop
SnapDrop/snapdrop: A Progressive Web App for local file sharing
- online airdrop
grishka/NearDrop: An unofficial Google Nearby Share/Quick Share app for macOS - google neardrop - same wifi network only
Rice , nice theme
v1ewp0rt/evilware-theme: SCI-FI SCIENTIST LINUX THEME
Pickup some newest great terminal apps
New Terminal Tools - Terminal Trove - jhspetersson/fselect: Find files with SQL-like queries
tl is an alias for tldr —list | fzf —preview ‘tldr {} —color always’ | xargs tldr
Python set up
Cheatsheet: pyenv, virtualenvwrapper, and pip
- mac version
pacman -S pyenv yay -S pyenv-virtualenvwrapper pyenv virtualenvwrapper
eval “HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV=“true”
switch to python version you want,
pyenv global 3.7.4 pyenv local 3.7.4
Create virtualenv (with virtualenvwrapper),
mkvirtualenv
- it seems uv(rust python manager → fixed all the issue and fast as fuck)
Uvx
uv + ruff
python formatter + pipx(enhanced)
dprint/dprint: Pluggable and configurable code formatting platform written in Rust.
-
temrimnal format all in one
-
pyenv → zsh completion 2025-01-25
#compdef pyenv
if [[ ! -o interactive ]]; then
return
fi
local state line
typeset -A opt_args
_arguments -C \
{--help,-h}'[Show help]' \
{--version,-v}'[Show pyenv version]' \
'(-): :->command' \
'*:: :->option-or-argument'
case "$state" in
(command)
local -a commands
commands=(${(f)"$(pyenv commands)"})
_describe -t commands 'command' commands
;;
(option-or-argument)
local -a args
args=(${(f)"$(pyenv completions ${line[1]})"})
_describe -t args 'arg' args
;;
esac
return
Mongo db connection
Mouseless
moverest/wl-kbptr: Control the mouse pointer with the keyboard on Wayland. jbensmann/mouseless: A replacement for the mouse in Linux
- go
jtroo/kanata: Improve keyboard comfort and usability with advanced customization
- home row enable
wallpaper
dharmx/walls: All of my wallpapers in one repo.
font
man page
plp13/qman: A more modern man page viewer for our terminals
-
tealdear
TERM=tmux-256color infocmp -1 | grep -E 'ritm|sitm'
set -g default-terminal “tmux-256color” set -as terminal-overrides ’,*:sitm=\E[3m’ -
set font in vim set t_ZH=[3m set t_ZR=[23m
-
tl is an alias for tldr —list | fzf —preview ‘tldr {} —color always’ | xargs tldr
Disk
dundee/gdu: Fast disk usage analyzer with console interface written in Go
Site Generator
Static Site Generators - Top Open Source SSGs | Jamstack
Encoding utf8 , gkb
9.2. Using the convmv tool | Red Hat Product Documentation iconv —list convmv —list Supported Encodings
# traditonal
convmv -f cp950 -t UTF-8 -r --notest *
# simpified chinese
convmv -f cp935 -t UTF-8 -r --notest *
# cp 935
## --nosmart -> still do done it
## simpified chin could be cp936
- proper way Linux console - ArchWiki
en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_TW.UTF-8 UTF-8
sudo locale-gen
Set the system-wide locale in /etc/locale.conf:
For console support, edit /etc/default/console-setup and set:
text CHARMAP=“UTF-8”
Restart the console-setup service:
text sudo systemctl daemon-reload sudo systemctl restart console-setup.service
and install font
flux for arch , redshift , wlsunset
gammastep-wayland-git [general] temp-day=5500 temp-night=4000 ; Disable the smooth fade between temperatures when Redshift starts and stops. ; 0 will cause an immediate change between screen temperatures. ; 1 will gradually apply the new screen temperature over a couple of seconds. fade=1 location-provider=manual adjustment-method=wayland dawn-time=8:00-9:45 dusk-time=18:35-20:15 gamma=0.8 [manual] lat=43.70011 lon=-79.4163 ; [randr] ; screen=0
- webcam → light sensor O_O
Installing ebook management and its cli:
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
Making web into desktop apps:
debtap Pake 的高级用法 · tw93/Pake Wiki
- or just thorium install desktop
Adding monitor (ipad)
Gnome has made it super simple to extend your monitor as virtual displays with any tablet!!! : gnome
Thorium (fastest browser )
ThoriumOS Developer Guide Thorium Optimizations
--ozone-platform-hint=wayland --enable-features=WaylandPerSurfaceScale --disable-features=ScrollableTabStrip,Thorium2024 --flag-switches-end
- this fix the adding desktop package
CachyOS
Reinstall the original pacman from Arch Linux: Terminal window
sudo pacman -S core/pacman
Execute the following command: Terminal window
This avoids getting %INSTALLED_DB% warnings
sudo find /var/lib/pacman/local/ -type f -name “desc” -exec sed -i ’/^%INSTALLED_DB%$/,+2d’ {} ;
Create a backup of the pacman config file: Terminal window
sudo mv /etc/pacman.conf.bak /etc/pacman.conf
Switch back to the default Arch Linux packages with the following commands: Terminal window
pacman -Qqn | sudo pacman -S - sudo pacman -Syu
- currently using grub to config kernel
sudo grub-mkconfig -o /boot/grub/grub.cfg
Optimizing Linux for Slow Computers | AkitaOnRails.com
It’s about Responsiveness, not performance! (for most user case)
SSD optimization: SSDOptimization - Debian Wiki
sudo sysctl -w vm.swappiness=50
- however I am currently using zram, I don’t know wheather turn on or off
GitHub - orhun/systeroid: A more powerful alternative to sysctl(8) with a terminal user interface 🐧
1 → Ultra speed
checking :
cat /sys/block/DEVICE_NAME/queue/scheduler
- systeroid-tui [options] → really useful
Sched-ext Tutorial
arighi (Andrea Righi) · GitHub arighi’s blog Accelerating micro-VM boot time with sched_ext
-
change kernals with speed in a virtualized snapshot
-
nvida engineer
-
disble ananicy(cpp)
rustland compiling kernel while gamming
- check wheather kernel is using this or not
cat /sys/kernel/sched_ext/state /sys/kernel/sched_ext/*/ops 2>/dev/null
-This guide explains how to use scx_loader with the dbus-send command.
-
Starting scx_rusty with its default arguments
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartScheduler string:scx_rusty uint32:0
-
Starting a scheduler with arguments
# This example starts scx_bpfland with the following flags: -k -c 0 dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartSchedulerWithArgs string:scx_bpfland array:string:"-k","-c","0"
-
Stopping the currently running scheduler
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StopScheduler
-
Switching to another scheduler in Mode 2
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.SwitchScheduler string:scx_lavd uint32:2 # This switches to scx_lavd with the scheduler mode 2 meaning it starts LAVD in powersaving
-
Switching to another scheduler with arguments
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.SwitchSchedulerWithArgs string:scx_bpfland array:string:"-k","-c","0"
-
Getting the currently running scheduler
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:CurrentScheduler
-
-
Getting a list of the supported schedulers
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:SupportedSchedulers
-
scxschedsrust at main · sched-extscx · GitHub
- explain each model pros and cons
lavd → producion ready and good for arm even
sched_ext a BPF-extensible scheduler class (Part 1) sched_ext scheduler architecture and interfaces (Part 2) mac-linux
system-boot:
bootctl
sudo bootctl status sudo bootctl set-default 2024-12-25_21-01-02_linux.conf sudo bootctl update Persistent block device naming - ArchWiki
ls -l /dev/disk/by-partuuid/
conf
Disk, finding replicates file
pkolaczk/fclones: Efficient Duplicate File Finder qarmin/czkawka: Multi functional app to find duplicates, empty folders, similar images etc.
Remote
- Gametype:
LizardByte/Sunshine: Self-hosted game stream host for Moonlight. moonlight-stream/moonlight-qt: GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
- connection
Auto install optional dependencies
sudo pacman -S --needed --asdeps $(expac -Ss '%o' <pkg_name>)
I think this is better if one is using repos that may contain duplicate/similar entries(e.g. Chaotic AUR):
`sudo pacman -S —needed —asdeps $(expac -1S “%n\n%o” <pkg_name>)
clang
Dealing with zombie
Checking with kernel
GitHub - orhun/systeroid: A more powerful alternative to sysctl(8) with a terminal user interface 🐧
show information about a parameter
systeroid —explain oom_dump_tasks
replacing sysctl
system maintenace:
# This code is almost entirely taken from Mr. Cejas's blog: https://fernandocejas.com/blog/engineering/2022-03-30-arch-linux-system-maintance/
echo "Updating system"
yay -Syu
echo "Clearing pacman cache"
pacman_cache_space_used="$(du -sh /var/cache/pacman/pkg/)"
paccache -r
echo "Space saved: $pacman_cache_space_used"
echo "Removing orphan packages"
yay -Qdtq | yay -Rns -
echo "Clearing ~/.cache"
home_cache_used="$(du -sh ~/.cache)"
rm -rf ~/.cache/
echo "Spaced saved: $home_cache_used"
echo "Clearing system logs"
sudo journalctl --vacuum-time=7d
Great rice (not minimal)
end-4/dots-hyprland: i hate minimalism so…
using wev
wev to check keboard in hyprland: bindl = , XF86Launch5 , exec, playerctl —player=mpv play-pause
Yay
yay -S guix —noconfirm
sudo -E yay -S guix
The error message “The working directory cannot be longer than 36 bytes.” suggests that the build process is failing due to a path length restriction in the build system.
Solutions:
1. Move the Build Directory to a Shorter Path
Since the issue is with /home/peter/.cache/yay/guix/src/guix-1.4.0
, try moving the build directory to a shorter path, such as /tmp/guix-build/
.
mkdir -p /tmp/guix-build
cd /tmp/guix-build
yay -G guix # Download PKGBUILD without building
cd guix
makepkg -si
This will build Guix in a shorter directory path.
2. Use the BUILDDIR
Environment Variable
You can specify a custom directory for building packages by setting BUILDDIR
in makepkg.conf
:
- Open your
makepkg.conf
file:nano /etc/makepkg.conf
- Look for
BUILDDIR
and change it to a shorter location:BUILDDIR=/tmp/makepkg
- Save the file (
Ctrl + X
, thenY
, thenEnter
). - Try running the build again.
3. Build Manually Without yay
Since yay
uses ~/.cache/yay/
(which results in long paths), you can manually build the package:
git clone https://aur.archlinux.org/guix.git
cd guix
makepkg -si
This avoids the yay
cache directory issue.
4. Use yay
with a Custom Build Directory
If you want to keep using yay
but avoid the path issue:
yay --builddir /tmp/yay-build -S guix
This tells yay
to use /tmp/yay-build/
as the build directory.
Conclusion
The easiest fix is moving the build directory to a shorter path (e.g., /tmp/guix-build/
). If you use yay
, you can either modify makepkg.conf
or run yay
with the --builddir
flag.
Let me know if you need more help! 🚀
C library
sudo ldconfig
Configure symlinks and cache for shared library dependencies. More information: https://manned.org/ldconfig.
Update symlinks and rebuild the cache (usually run when a new library is installed):
sudo ldconfig
ldd $(which sioyek) | grep mupdf
If downgrade doesn’t work, manually install the old package from the Arch Linux Archive.
Find the package here: 👉 https://archive.archlinux.org/packages/m/mupdf/
/Documents/Golden Mission
tracing which lib using this file
pacman -Qo /usr/lib/libmupdf.so.25.6
/usr/lib/libmupdf.so.25.6 is owned by libmupdf 1.25.6-1
-
for deleting the file sudo pacman -Rns mupdf-tools
sioyek record 2025-04-02 sioyek-build
interisting package: ncmpcpp/ncmpcpp: Featureful ncurses based MPD client inspired by ncmpc topgrade-rs/topgrade: Upgrade all the things