From 7772331aa5df0b8106f3523a0070269fae735894 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 17 Mar 2024 21:09:42 -0700 Subject: xyzca init --- home/xyz/.bashrc | 2 +- home/xyz/.config/myconf/pacman_Qqme | 1 - home/xyz/.config/myconf/pacman_Qqne | 1 - home/xyz/.config/myconf/sye | 1 - home/xyz/.local/share/qBittorrent/nova3/engines/jackett.json | 6 ------ 5 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 home/xyz/.local/share/qBittorrent/nova3/engines/jackett.json (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 33d8cd11..4d81b50f 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -29,7 +29,7 @@ esac # tput is better for different terminals? # but also need \[ and \] around color code for PS1! but seems no need for printf in script? why? # setaf and sgr0 see `man terminfo` -PS1="\[$(tput setaf 5)\][\u@\h \W]\$ \[$(tput sgr0)\]" +PS1="\[$(tput setaf 6)\][\u@\h \W]\$ \[$(tput sgr0)\]" # https://github.com/LukeSmithxyz/voidrice/blob/master/.config/shell/aliasrc for cmd in hardcode-fixer ventoy units_cur fbgrab powertop nft rpi-imager fdisk dmesg; do diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index 4e8e5af9..49e49a7d 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -5,7 +5,6 @@ bash-complete-alias dashbinsh grub-hook htop-vim -jackett-bin librespeed-cli neofetch-git neovim-plug diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index b8907d10..0d6c35db 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -30,7 +30,6 @@ posix-software-development posix-user-portability posix-xsi python-pip -qbittorrent-nox rebuild-detector reflector rsync diff --git a/home/xyz/.config/myconf/sye b/home/xyz/.config/myconf/sye index a0dc6868..9f1da6e7 100644 --- a/home/xyz/.config/myconf/sye +++ b/home/xyz/.config/myconf/sye @@ -1,6 +1,5 @@ UNIT FILE STATE PRESET getty@.service enabled enabled -jackett.service enabled disabled nftables.service enabled disabled sshd.service enabled disabled systemd-network-generator.service enabled enabled diff --git a/home/xyz/.local/share/qBittorrent/nova3/engines/jackett.json b/home/xyz/.local/share/qBittorrent/nova3/engines/jackett.json deleted file mode 100644 index 5b715a13..00000000 --- a/home/xyz/.local/share/qBittorrent/nova3/engines/jackett.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "api_key": "qsl99mxd991t5f3azf9bcgf22cbbjeum", - "thread_count": 20, - "tracker_first": false, - "url": "http://127.0.0.1:9117" -} -- cgit v1.2.3-70-g09d2 From fef849e7c6212ed2d8c47f6c5d5e7cfc8592fc87 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 18 Mar 2024 05:16:39 +0000 Subject: no jackett, one less service --- home/xyz/.config/myconf/sye | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/sye b/home/xyz/.config/myconf/sye index 9f1da6e7..23d37551 100644 --- a/home/xyz/.config/myconf/sye +++ b/home/xyz/.config/myconf/sye @@ -14,4 +14,4 @@ remote-fs.target enabled enabled paccache.timer enabled disabled pacman-filesdb-refresh.timer enabled disabled -15 unit files listed. +14 unit files listed. -- cgit v1.2.3-70-g09d2 From 724688b2fb519d5fd39bf88c39353ec2df319d9e Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 18 Mar 2024 05:17:43 +0000 Subject: ca default use xfs. I may switch to ext4 in the future. But for now I will try xfs --- home/xyz/.config/myconf/pacman_Qqne | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 0d6c35db..780b4d53 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -46,5 +46,6 @@ unzip vidir2-git wireguard-tools xdg-user-dirs +xfsprogs zip zoxide -- cgit v1.2.3-70-g09d2 From 0e4a49e53b2c241e9ef32edf5e3080f6a8e443ff Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 20 Mar 2024 09:11:09 +0000 Subject: remove rustup, do `rustup toolchain remove stable` first, to save storage --- home/xyz/.config/myconf/pacman_Qqne | 1 - 1 file changed, 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 780b4d53..1b50d72a 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -33,7 +33,6 @@ python-pip rebuild-detector reflector rsync -rustup shellcheck speedtest-cli strace -- cgit v1.2.3-70-g09d2 From 63d5617fa2a44f7bf8e093703ad65dbecd0e3452 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 31 Mar 2024 04:13:54 +0000 Subject: update --- home/xyz/.config/myconf/pacman_Qqme | 1 - 1 file changed, 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index 49e49a7d..920f3141 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -1,5 +1,4 @@ absolutely-proprietary -asp atool2-git bash-complete-alias dashbinsh -- cgit v1.2.3-70-g09d2 From e21eb708e394dc4c1b1997013f829ab502ce7415 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Thu, 4 Apr 2024 13:00:17 +0000 Subject: working on mail server... --- home/xyz/.config/myconf/pacman_Qqme | 1 + home/xyz/.config/myconf/pacman_Qqne | 4 ++++ home/xyz/.config/myconf/sye | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index 920f3141..6ff8423a 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -1,4 +1,5 @@ absolutely-proprietary +acme.sh-systemd atool2-git bash-complete-alias dashbinsh diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 1b50d72a..66f2ef1a 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -3,6 +3,7 @@ base-devel bash-completion dash devtools +dovecot fio fsh-git fzf @@ -15,6 +16,7 @@ lf linux lostfiles lsof +mailutils man-pages moreutils neovim @@ -29,11 +31,13 @@ posix-c-development posix-software-development posix-user-portability posix-xsi +postfix python-pip rebuild-detector reflector rsync shellcheck +socat speedtest-cli strace systemd-resolvconf diff --git a/home/xyz/.config/myconf/sye b/home/xyz/.config/myconf/sye index 23d37551..c5147c99 100644 --- a/home/xyz/.config/myconf/sye +++ b/home/xyz/.config/myconf/sye @@ -11,7 +11,8 @@ systemd-timesyncd.service enabled enabled systemd-networkd.socket enabled disabled systemd-userdbd.socket enabled enabled remote-fs.target enabled enabled +acme.sh.timer enabled disabled paccache.timer enabled disabled pacman-filesdb-refresh.timer enabled disabled -14 unit files listed. +15 unit files listed. -- cgit v1.2.3-70-g09d2 From d351d94de2a62610022e013ec4a2cefa46300d1f Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Fri, 5 Apr 2024 12:26:41 +0000 Subject: more email server configs: packages and services --- home/xyz/.config/myconf/pacman_Qqne | 2 ++ home/xyz/.config/myconf/sye | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 66f2ef1a..912426c0 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -23,6 +23,8 @@ neovim nethogs nftables openbsd-netcat +opendkim +opendmarc openssh p7zip pacman-contrib diff --git a/home/xyz/.config/myconf/sye b/home/xyz/.config/myconf/sye index c5147c99..8d845498 100644 --- a/home/xyz/.config/myconf/sye +++ b/home/xyz/.config/myconf/sye @@ -1,6 +1,10 @@ UNIT FILE STATE PRESET +dovecot.service enabled disabled getty@.service enabled enabled nftables.service enabled disabled +opendkim.service enabled disabled +opendmarc.service enabled disabled +postfix.service enabled disabled sshd.service enabled disabled systemd-network-generator.service enabled enabled systemd-networkd-wait-online.service enabled enabled @@ -15,4 +19,4 @@ acme.sh.timer enabled disabled paccache.timer enabled disabled pacman-filesdb-refresh.timer enabled disabled -15 unit files listed. +19 unit files listed. -- cgit v1.2.3-70-g09d2 From 1e20d2372ee99457c1efc609914015657b71f4ed Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Tue, 9 Apr 2024 01:10:31 -0700 Subject: swith to new ca server; wireguard no need --- etc/nftables.conf | 30 ++-------------------- etc/services | 1 - etc/sysctl.d/99-sysctl.conf | 7 ----- .../multi-user.target.wants/wg-quick@wg0.service | 1 - home/xyz/.config/myconf/pacman_Qqne | 1 - 5 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 etc/sysctl.d/99-sysctl.conf delete mode 120000 etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service (limited to 'home') diff --git a/etc/nftables.conf b/etc/nftables.conf index c4ca7f45..22e38dfe 100644 --- a/etc/nftables.conf +++ b/etc/nftables.conf @@ -3,17 +3,11 @@ # IPv4/IPv6 Simple & Safe firewall ruleset. # More examples in /usr/share/nftables/ and /usr/share/doc/nftables/examples/. -# references, some codes from: -# https://wiki.archlinux.org/title/Nftables -# https://www.procustodibus.com/blog/2021/11/wireguard-nftables -# https://wiki.gentoo.org/wiki/Nftables/Examples#Basic_NAT +# some codes from https://wiki.archlinux.org/title/Nftables # needed for reload config using `sudo systemctl restart nftables` or `sudo nft -f /etc/nftables.conf` flush ruleset -define pub_iface = "eth0" -define wg_iface = "wg0" - table inet my_table { chain my_input { @@ -23,7 +17,6 @@ table inet my_table { ct state invalid drop comment "early drop of invalid connections" ct state {established, related} accept comment "allow tracked connections" iifname lo accept comment "allow from loopback" - iifname $wg_iface accept comment "allow from wireguard" ip protocol icmp accept meta l4proto ipv6-icmp accept @@ -32,7 +25,7 @@ table inet my_table { #tcp dport qbt accept #udp dport qbt accept #tcp dport iperf3 accept - udp dport wireguard accept + #udp dport wireguard accept # for acme.sh standalone mode builtin webserver to renew ssl cert tcp dport http accept # email related ports @@ -52,12 +45,6 @@ table inet my_table { type filter hook forward priority filter policy drop # Drop everything forwarded to us. We do not forward. That is routers job. - - # needed for wireguard? - #iifname $wg_iface oifname $pub_iface accept - #iifname $pub_iface oifname $wg_iface accept - iifname $wg_iface accept - oifname $wg_iface accept } chain my_output { @@ -66,16 +53,3 @@ table inet my_table { # Accept every outbound connection } } - -# needed to wireguard NAT masquerade VPN traffic -# Need inet to masquerade both ipv4 and ipv6? If use ip it will only masquerade ipv4? If use ip6 it will only masquerade ipv6? -# https://wiki.nftables.org/wiki-nftables/index.php/Nftables_families -table inet nat { - # newer kernel no need for `chain prerouting { type nat hook prerouting priority -100; policy accept; }`, more see https://www.procustodibus.com/blog/2021/11/wireguard-nftables/ - # for all packets to $pub_iface, after routing, replace source address with primary IP of $pub_iface interface - chain postrouting { - type nat hook postrouting priority 100 - policy accept - oifname $pub_iface masquerade - } -} diff --git a/etc/services b/etc/services index b1b9f5bc..500c6ac7 100644 --- a/etc/services +++ b/etc/services @@ -11507,7 +11507,6 @@ nusrp 49001/tcp nusdp-disc 49001/udp inspider 49150/tcp # my services -wireguard 49432/udp # My ISP verizon block incomming to gateway port 22. So I need to use another port to ssh into my home server. # https://www.reddit.com/r/verizon/comments/to1q43/verizon_5g_home_internet_blocking_ssh_service_port/ ssh-isp 49812/tcp diff --git a/etc/sysctl.d/99-sysctl.conf b/etc/sysctl.d/99-sysctl.conf deleted file mode 100644 index b9677c02..00000000 --- a/etc/sysctl.d/99-sysctl.conf +++ /dev/null @@ -1,7 +0,0 @@ -# at least `net.ipv4.ip_forward = 1` is needed for wireguard masquerade? to work. Without will result into can't ping ips, can't curl websites, browser can't visit websites -# ka seems has this as default, maybe arch linux cloud-init image has this as default? -# https://forums.rockylinux.org/t/wireguard-masquerade-wont-work/7752 -# https://wiki.archlinux.org/title/Nftables#NAT_with_port_forwarding -# https://github.com/teddysun/across/blob/acef6b00a6ad062c0e99286ea136d1a246def644/wireguard.sh#L514-L522 -net.ipv4.ip_forward = 1 -net.ipv6.conf.all.forwarding = 1 diff --git a/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service b/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service deleted file mode 120000 index 0a92cb9a..00000000 --- a/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/wg-quick@.service \ No newline at end of file diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 912426c0..f60f41bc 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -49,7 +49,6 @@ tree unrar-free unzip vidir2-git -wireguard-tools xdg-user-dirs xfsprogs zip -- cgit v1.2.3-70-g09d2 From c1dc3154c35bab540c7a5dc4e85b1422c89f230a Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Tue, 9 Apr 2024 12:34:06 +0100 Subject: ca use btrfs --- home/xyz/.config/myconf/pacman_Qqne | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index f60f41bc..f95d7263 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -1,6 +1,7 @@ base base-devel bash-completion +btrfs-progs dash devtools dovecot -- cgit v1.2.3-70-g09d2 From 58fec6d40111c6095177b3797770d5c7bcfa068e Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 17 Apr 2024 11:47:52 +0100 Subject: install wget, because some scripts uses ony wget, e.g. network-speed.xyz --- home/xyz/.config/myconf/pacman_Qqne | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index f95d7263..c299107f 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -50,6 +50,7 @@ tree unrar-free unzip vidir2-git +wget xdg-user-dirs xfsprogs zip -- cgit v1.2.3-70-g09d2 From fb833fa7ee92151c10cc815992e0e7190b3ed57c Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 7 Apr 2024 00:07:02 -0700 Subject: feat: mail filetype set colorcolumn remind me max line char --- home/xyz/.config/nvim/init.vim | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index e1b5dd1e..f5dd2272 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -54,6 +54,23 @@ augroup mycmd " .csx seems not c# but c# script file, this works tho " set syntax=cs also works autocmd BufNewFile,BufRead *.csx setfiletype cs + " for alerting me plain text email characters per line + " neomutt auto set new email filetype as mail so this will work + " https://mailformat.dan.info/body/linelength.html suggested 65 + "" https://superuser.com/q/827647/1282809 + " https://lkml.org shows Linus seems use 70 + " https://lkml.org Hottest messages shows people use around 70-80 + " https://en.wikipedia.org/wiki/Characters_per_line + " related: textwidth + " if want to do this only for some file extensions, see: + " https://useplaintext.email/ suggest 72 + "" https://stackoverflow.com/a/469576/9008720 + "" don't forget to put in augroup: + "" https://stackoverflow.com/a/60470085/9008720 + "" also other ways: + "" https://stackoverflow.com/q/158968/9008720 + "autocmd FileType mail setlocal colorcolumn=72 + autocmd FileType mail setlocal cc=72 augroup END " :h markdown, for vim default tpope/vim-markdown @@ -126,22 +143,6 @@ set smartcase " :h disable-mouse set mouse= -" for alerting me plain text email characters per line -" https://mailformat.dan.info/body/linelength.html suggested 65 -"" https://superuser.com/q/827647/1282809 -" https://lkml.org shows Linus seems use 70 -" https://lkml.org Hottest messages shows people use around 70-80 -" https://en.wikipedia.org/wiki/Characters_per_line -" related: textwidth -" if want to do this only for some file extensions, see: -"" https://stackoverflow.com/a/469576/9008720 -"" don't forget to put in augroup: -"" https://stackoverflow.com/a/60470085/9008720 -"" also other ways: -"" https://stackoverflow.com/q/158968/9008720 -"set colorcolumn=70 -"set cc=70 - " map ctrl+h/j/k/l to move between split windows map h map j -- cgit v1.2.3-70-g09d2 From cf8d26d82ce3d25390b66d701779ae1f1fcc5608 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 7 Apr 2024 00:27:28 -0700 Subject: feat: gitcommit filetype set cc --- home/xyz/.config/nvim/init.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index f5dd2272..cf4d9818 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -56,6 +56,8 @@ augroup mycmd autocmd BufNewFile,BufRead *.csx setfiletype cs " for alerting me plain text email characters per line " neomutt auto set new email filetype as mail so this will work + " https://stackoverflow.com/q/2290016 suggest gitcommit main body shouldbe about 72 + " https://useplaintext.email/ suggest 72 " https://mailformat.dan.info/body/linelength.html suggested 65 "" https://superuser.com/q/827647/1282809 " https://lkml.org shows Linus seems use 70 @@ -63,14 +65,13 @@ augroup mycmd " https://en.wikipedia.org/wiki/Characters_per_line " related: textwidth " if want to do this only for some file extensions, see: - " https://useplaintext.email/ suggest 72 "" https://stackoverflow.com/a/469576/9008720 "" don't forget to put in augroup: "" https://stackoverflow.com/a/60470085/9008720 "" also other ways: "" https://stackoverflow.com/q/158968/9008720 - "autocmd FileType mail setlocal colorcolumn=72 - autocmd FileType mail setlocal cc=72 + " or use setlocal cc= + autocmd FileType mail,gitcommit setlocal colorcolumn=72 augroup END " :h markdown, for vim default tpope/vim-markdown -- cgit v1.2.3-70-g09d2 From 970ca530ea85a5cbb2f8f21da96cff9a274e4037 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 7 Apr 2024 00:29:54 -0700 Subject: update --- home/xyz/.config/nvim/init.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index cf4d9818..2be50697 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -54,6 +54,7 @@ augroup mycmd " .csx seems not c# but c# script file, this works tho " set syntax=cs also works autocmd BufNewFile,BufRead *.csx setfiletype cs + " https://stackoverflow.com/q/28310094 multi filetypes " for alerting me plain text email characters per line " neomutt auto set new email filetype as mail so this will work " https://stackoverflow.com/q/2290016 suggest gitcommit main body shouldbe about 72 -- cgit v1.2.3-70-g09d2 From fe84f1b831505e71d89620e9b242bd02f4fc25af Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 17 Apr 2024 04:24:55 -0700 Subject: less show tab width as 4 space instead of 8 --- home/xyz/.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.profile b/home/xyz/.profile index bc9db15f..c13c19dd 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -31,7 +31,7 @@ export PAGER=less # but other situation seems less use -F as default? # steal from sdcv arch wiki # CALCURSE_PAGER less can't use -F, else ? and > hotkey will only blink the text -export LESS=-FRXi +export LESS=-FRXix4 export MANPAGER='nvim +Man!' # This MANSECT prioritize POSIX manpages. After use it for a long time, I think it is not suitable for me any more. -- cgit v1.2.3-70-g09d2 From 82e40dac1d0d240fed415e881fb465c2cecd40f6 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 13 Apr 2024 23:32:55 -0700 Subject: lf change some keybindings to my like --- home/xyz/.config/lf/lfrc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'home') diff --git a/home/xyz/.config/lf/lfrc b/home/xyz/.config/lf/lfrc index c78889d6..b0ca2284 100644 --- a/home/xyz/.config/lf/lfrc +++ b/home/xyz/.config/lf/lfrc @@ -1 +1,24 @@ +# maybe useful: +# /usr/share/doc/lf/lfrc.example +# `man lf` +# - ENVIRONMENT VARIABLES section +# - PREVIEWING FILES section +# https://github.com/LukeSmithxyz/voidrice/tree/master/.config/lf + set hidden + +# not using it because security concerns, see: https://wiki.archlinux.org/title/Lf#Sandboxing_previews +# I moved previewer script to public_archive_codes +# previewer use highlight which can show tab as 4 spaces +#set previewer ~/.config/lf/previewer +#map e $LESSOPEN='| ~/.config/lf/previewer %s' less -+F $f + +# change come default keybindings to my like +# see `man lf` PREFIXES section, $ at the beginning indicate it is shell command? +# also see "The following commands/keybindings are provided by default:" section +# I use -F in LESS env, need -+F to reset to default so no quit if one screen +map e $$PAGER -+F "$f" +# or wait for key press use ! prefix +#map e !$PAGER "$f" +map v $$EDITOR "$f" +map i invert -- cgit v1.2.3-70-g09d2 From 20c5d43d15cf54a0e3f799ce88ddb13dff0c01d7 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 13 Apr 2024 23:36:05 -0700 Subject: tab show 4 spaces width --- home/xyz/.bashrc | 2 ++ home/xyz/.profile | 1 + 2 files changed, 3 insertions(+) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 4d81b50f..ecbde6ca 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -13,6 +13,8 @@ esac . /usr/share/fzf/key-bindings.bash . /usr/share/bash-complete-alias/complete_alias +tabs 4 + # default PS1 #PS1='[\u@\h \W]\$ ' diff --git a/home/xyz/.profile b/home/xyz/.profile index c13c19dd..14fc542b 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -31,6 +31,7 @@ export PAGER=less # but other situation seems less use -F as default? # steal from sdcv arch wiki # CALCURSE_PAGER less can't use -F, else ? and > hotkey will only blink the text +# -x4 to use 4 spaces instead of default 8. Even if I specify `tabs 4` in .bashrc, this is still needed for less. export LESS=-FRXix4 export MANPAGER='nvim +Man!' -- cgit v1.2.3-70-g09d2 From a6c0efa89fad7dcfb696cc16fb97e216311fb023 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 14 Apr 2024 01:06:40 -0700 Subject: nvim better fold title contrast --- home/xyz/.config/nvim/init.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 2be50697..844ca58a 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -11,8 +11,9 @@ call plug#begin() "Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } " chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained " tinted-theming/base16-vim and RRethy/nvim-base16 seem both work, both support tree-sitter -" I prefer tinted-theming/base16-vim in the past because of darker status bar color? -Plug 'tinted-theming/base16-vim' +" In the past, I prefer tinted-theming/base16-vim because of darker status bar color? +" Now, I prefer RRethy/nvim-base16 because of higher contrast on fold title, so much more readable +Plug 'RRethy/nvim-base16' " nvim-treesitter does not support markdown right now, so wait "Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update " use latest vim-markdown -- cgit v1.2.3-70-g09d2 From 33d604d849c362d54076aaf79f18f662b9657549 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 14 Apr 2024 19:11:14 -0700 Subject: nvim customize old theme make fold title higher contrast I choose to go back to old colorscheme plugin I use and customize it to make fold title higher contrast and more readable. Becase other theme plugins have other issues, so I would rather stick to the old plugin, plus it can be customized easily. --- home/xyz/.config/nvim/init.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 844ca58a..9f6f9a7c 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -9,11 +9,11 @@ call plug#begin() "Plug 'junegunn/fzf.vim' "Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } "Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } +" tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily " chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained +" RRethy/nvim-base16 does not highlight markdown codeblocks " tinted-theming/base16-vim and RRethy/nvim-base16 seem both work, both support tree-sitter -" In the past, I prefer tinted-theming/base16-vim because of darker status bar color? -" Now, I prefer RRethy/nvim-base16 because of higher contrast on fold title, so much more readable -Plug 'RRethy/nvim-base16' +Plug 'tinted-theming/base16-vim' " nvim-treesitter does not support markdown right now, so wait "Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update " use latest vim-markdown @@ -42,6 +42,15 @@ function Autocmd_set_fenc() endif endfunction +" https://github.com/tinted-theming/base16-vim?tab=readme-ov-file#customization +function! s:base16_customize() abort + " make fold title more contrast and readable, by reverting some changes from: + " https://github.com/tinted-theming/base16-vim/pull/43/files + " tested with base16-tomorrow-night theme + call Base16hi("FoldColumn", g:base16_gui0C, g:base16_gui01, g:base16_cterm0C, g:base16_cterm01, "", "") + call Base16hi("Folded", g:base16_gui03, g:base16_gui01, g:base16_cterm03, g:base16_cterm01, "", "") +endfunction + " not fully understood augroup, recommanded in :help " https://www.youtube.com/watch?v=dBBUOO1PRIU augroup mycmd @@ -74,9 +83,12 @@ augroup mycmd "" https://stackoverflow.com/q/158968/9008720 " or use setlocal cc= autocmd FileType mail,gitcommit setlocal colorcolumn=72 + " https://github.com/tinted-theming/base16-vim?tab=readme-ov-file#customization + autocmd ColorScheme * call s:base16_customize() augroup END " :h markdown, for vim default tpope/vim-markdown +" enable markdown fold will make opening large files slower, so I don't enable it "let g:markdown_folding = 1 " g:markdown_minlines before nvim 0.8, 500 works well; version 0.8 makes even 400 noticeable slow when keep pressing gk let g:markdown_minlines = 350 -- cgit v1.2.3-70-g09d2 From a766cffed614645e228e1c9bfddca8ff0d47ece0 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 14 Apr 2024 20:21:09 -0700 Subject: edit init.vim comments RRethy/nvim-base16 change name to base16-nvim. I tested markdown treesitter, better but still not good. --- home/xyz/.config/nvim/init.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 9f6f9a7c..8928d4da 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -11,10 +11,12 @@ call plug#begin() "Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } " tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily " chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained -" RRethy/nvim-base16 does not highlight markdown codeblocks -" tinted-theming/base16-vim and RRethy/nvim-base16 seem both work, both support tree-sitter +" RRethy/base16-nvim does not highlight markdown codeblocks +" tinted-theming/base16-vim and RRethy/base16-nvim seem both work, both support tree-sitter Plug 'tinted-theming/base16-vim' -" nvim-treesitter does not support markdown right now, so wait +" nvim-treesitter seems support markdown highlight now, run `:TSEnable highlight`, more see vc notes +" but very slow when editing large markdown files so I sitll don't enable it, maybe related: +" https://github.com/nvim-treesitter/nvim-treesitter/issues/2206 "Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update " use latest vim-markdown Plug 'tpope/vim-markdown' -- cgit v1.2.3-70-g09d2 From 073862da8dc8f8fea7934f8f746c7419c2d4dd75 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Fri, 3 May 2024 04:45:30 +0000 Subject: neofetch is archived, and no need neofetch on these computers --- home/xyz/.config/myconf/pacman_Qqme | 1 - 1 file changed, 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index 6ff8423a..d219764c 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -6,7 +6,6 @@ dashbinsh grub-hook htop-vim librespeed-cli -neofetch-git neovim-plug paru-bin pipdeptree -- cgit v1.2.3-70-g09d2 From 06c9ffbc2a44b4e4fe9e0694a3e0d5057f281abf Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 5 May 2024 03:13:05 +0000 Subject: aur xxd-standalone deleted, switch to official tinyxxd pkg --- home/xyz/.config/myconf/pacman_Qqme | 1 - home/xyz/.config/myconf/pacman_Qqne | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index d219764c..1ae6f3b5 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -10,4 +10,3 @@ neovim-plug paru-bin pipdeptree task-spooler -xxd-standalone diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index c299107f..79e9d4f8 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -5,6 +5,7 @@ btrfs-progs dash devtools dovecot +fastfetch fio fsh-git fzf @@ -45,6 +46,7 @@ speedtest-cli strace systemd-resolvconf tcpdump +tinyxxd traceroute tree unrar-free -- cgit v1.2.3-70-g09d2 From 4d0b5c7df14c94a2b22ce646fe86c1e79c961c40 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 4 May 2024 20:39:34 -0700 Subject: nvim config more universal, so all my computers can have the same config --- home/xyz/.config/nvim/init.vim | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 8928d4da..4fbfebae 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -8,7 +8,9 @@ call plug#begin() "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' "Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } -"Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } +if has('nvim') && executable('firefox') + Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } +endif " tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily " chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained " RRethy/base16-nvim does not highlight markdown codeblocks @@ -21,9 +23,16 @@ Plug 'tinted-theming/base16-vim' " use latest vim-markdown Plug 'tpope/vim-markdown' " alternatives: h-hg/fcitx.nvim, rlue/vim-barbaric, lilydjwg/fcitx.vim -"Plug 'rlue/vim-barbaric' +if executable('fcitx5') + Plug 'rlue/vim-barbaric' +endif " alternatives: 'thinca/vim-ref' with 'eiiches/vim-ref-info', 'HiPhish/info.vim', 'alx741/vinfo' Plug 'https://gitlab.com/HiPhish/info.vim.git' +" :h hexmode +" other related doc: :h hex-editing, :h 23.3, :h edit-binary +if executable('xxd') + Plug 'fidian/hexmode' +endif call plug#end() " next line must put below `Plug 'glacambre/firenvim'`, else if click github issue textarea, then click elsewhere, then click textarea, textarea will not be selected (no cursor in it), not sure why @@ -96,6 +105,12 @@ augroup END let g:markdown_minlines = 350 "let g:markdown_fenced_languages = ['python', 'sh', 'vim', 'c', 'cpp'] +" :h hexmode, fidian/hexmode plugin +" imagemagick .gray file format +let g:hexmode_patterns = '*.gray' +map h :Hexmode +"let g:hexmode_xxd_options = '-c 32' + " netrw-p preview vertial split let g:netrw_preview = 1 let g:netrw_winsize = 20 -- cgit v1.2.3-70-g09d2 From 36bb58e998f118e37e3d08e61ea679e7d36634ff Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 4 May 2024 20:57:12 -0700 Subject: some programs do not like 4 tab spaces, e.g., fdu, wtr, also pacman warned about it --- home/xyz/.bashrc | 2 -- 1 file changed, 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index ecbde6ca..4d81b50f 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -13,8 +13,6 @@ esac . /usr/share/fzf/key-bindings.bash . /usr/share/bash-complete-alias/complete_alias -tabs 4 - # default PS1 #PS1='[\u@\h \W]\$ ' -- cgit v1.2.3-70-g09d2 From a3ee6fce9072653be42410d218cd954bdfd7e8ec Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 5 May 2024 01:50:56 -0700 Subject: similar .bashrc for all computers, easier to cherry-pick with ccp --- home/xyz/.bashrc | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 4d81b50f..f011eba6 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -61,6 +61,7 @@ alias gcd='git clone --depth=1' alias gr='grep --color=auto -i' alias grr='grep --color=auto -iIR' alias h=htop +alias i=nsxiv alias j=journalctl alias l='ls --color=auto -A --group-directories-first' alias ll='ls --color=auto -lAh --group-directories-first' @@ -75,8 +76,22 @@ alias qre='qrencode -t utf8i -m 1' alias r='rem -cu+2 -@' # https://askubuntu.com/a/22043 alias s='sudo ' +alias sa='ssh-add -l || ssh-add' +alias sca='ssh ca' alias se='sudo -E ' +alias sia='ssh ia' +alias sp='ssh pp' alias spd='speedtest; librespeed-cli' +alias sst='ssh studio' +# \" to consider $HOME contain space, need \ else " will be expanded locally, need \$ else $HOME will expand locally +# can test with: alias mytest='ssh studio for i in \"\$SSH_CONNECTION\"\; do echo \$i\; echo a\; done' +alias sstm='ssh -t -- studio mpra -c \"\$HOME/programs/repos/fly/any/fsh-git\"' +# from `man remind`: "Note that you can omit the reminder type, in which case it defaults to MSG" +# can test this mess with `alias tt='echo "\$haha \"lala\""'` +alias sun='printf "set \$Longitude \"-121.89\"\nset \$Latitude \"37.34\"\n[sunrise()] sunrise\n[sunset()] sunset" | remind -n -' +# another way: +# can test this mess with `alias tt="echo '\$haha \"lala\"'"` +#alias sun="printf 'set \$Longitude \"-121.89\"\nset \$Latitude \"37.34\"\n[sunrise()] sunrise\n[sunset()] sunset' | remind -n -" alias sv=sudoedit alias y=systemctl alias yd='systemctl list-dependencies --all' @@ -87,9 +102,18 @@ alias yu='systemctl --user' alias yue='systemctl --user list-unit-files --state=enabled' alias yus='systemctl --user status' alias v='"$EDITOR"' +alias va='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/computer/arch_install.md"' +alias vc='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/computer/cli_notes.md"' alias vd='vidir' alias vd2='vidir2 --linktargets' +alias vq='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/others/questions_ideas_tips.md"' +alias vn='"$EDITOR" "$(find "$XDG_DOCUMENTS_DIR/notes" -mindepth 1 -path "*/\.git" -prune -o -type f -print | fzf)"' +alias vr='"$EDITOR" "$DOTREMINDERS"' alias vrc='"$EDITOR" +e\ \$MYVIMRC' +alias vrm='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/others/recurring_maintenance.md"' +alias vt='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/others/tmp_mobile_notes.md"' +alias xmr='monero-wallet-cli --config-file="$HOME/.bitmonero/monero-wallet-cli.conf"' +alias xmrds='monerod status; monerod print_net_stats' alias za='zoxide add' #alias zq='zoxide query' #alias zqi='zoxide query -i' @@ -100,16 +124,19 @@ alias alsamixer='alsamixer -V all' # I can't find a quick and easy way to temperory disable cloc config file except to change config file. Using an alias can disable --vcs with just \cloc. alias cloc='cloc --vcs auto' alias diff='diff --color=auto' +alias glmark2='glmark2 --fullscreen --annotate' alias grep='grep --color=auto' #alias info='info --vi-keys' alias ls='ls --color=auto' +alias radeontop='radeontop -c' alias rem='rem -@' alias remind='remind -@' alias rm='rm -I' alias sdcv='sdcv --color' alias shellcheck='shellcheck -x' -alias tree='tree -aC | "$PAGER"' +alias tree='tree -aC -I .git | "$PAGER"' alias uname='uname -a' +alias vkmark='vkmark --fullscreen' # depreciated # all green color, no auto turn off color when pipe to nvim @@ -162,5 +189,7 @@ _completion_loader info eval "$(complete -p info | sed 's/\(.*\)info$/\1vinfo/')" _completion_loader git eval "$(complete -p git | sed 's/\(.*\)git$/\1cfg/')" +_completion_loader pass +eval "$(complete -p pass | sed 's/\(.*\)pass$/\1prp/')" # complete-alias readme complete -F _complete_alias "${!BASH_ALIASES[@]}" -- cgit v1.2.3-70-g09d2 From c64fb8811ed717a0fd468ef38814abdc09630f34 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 5 May 2024 16:44:57 -0700 Subject: vrc consider studio use headles firefox for douyu afk --- home/xyz/.config/nvim/init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 4fbfebae..6a2bc6f4 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -8,7 +8,8 @@ call plug#begin() "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' "Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } -if has('nvim') && executable('firefox') +" xyzstudio maybe used for headless firefox douyu afk +if has('nvim') && executable('firefox') && ( hostname() != 'xyzstudio' ) Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } endif " tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily -- cgit v1.2.3-70-g09d2 From 0928aad3f1ddb51d5b5f63c4d665d45b851efa95 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 8 May 2024 19:44:01 -0700 Subject: vrc statusline show if there is newline at EOF --- home/xyz/.config/nvim/init.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 6a2bc6f4..3f19b492 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -199,6 +199,10 @@ set statusline+=%< set statusline+=%f " %F or 1CTRL+G to show full path set statusline+=\ %m set statusline+=%= +" https://stackoverflow.com/questions/5375240/a-more-useful-statusline-in-vim#comment84812779_10416234 +" :h eol-and-eof +" show if there's newline at end of file +set statusline+=%{&eol?'':'noeol'} set statusline+=\ %y "set statusline+=\ %{&fileencoding?&fileencoding:&encoding} " below line doesn't work as expected, not sure why -- cgit v1.2.3-70-g09d2 From f7154e1fd14f01ff49e7823384edb17f8205e024 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Fri, 24 May 2024 19:25:12 -0700 Subject: nvim new release has my fix, so no need latest version of the plugin https://github.com/tpope/vim-markdown/commit/f2b82b7884a3d8bde0c5de7793b27e07030eb2bc --- home/xyz/.config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 3f19b492..64cdd4d9 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -22,7 +22,7 @@ Plug 'tinted-theming/base16-vim' " https://github.com/nvim-treesitter/nvim-treesitter/issues/2206 "Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update " use latest vim-markdown -Plug 'tpope/vim-markdown' +"Plug 'tpope/vim-markdown' " alternatives: h-hg/fcitx.nvim, rlue/vim-barbaric, lilydjwg/fcitx.vim if executable('fcitx5') Plug 'rlue/vim-barbaric' -- cgit v1.2.3-70-g09d2 From ad770227cface87d122dd1c0291e9798f87dacb0 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 25 May 2024 16:18:30 -0700 Subject: nvim config to open readonly if file already been opened --- home/xyz/.config/nvim/init.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 64cdd4d9..fd368ebe 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -97,6 +97,15 @@ augroup mycmd autocmd FileType mail,gitcommit setlocal colorcolumn=72 " https://github.com/tinted-theming/base16-vim?tab=readme-ov-file#customization autocmd ColorScheme * call s:base16_customize() + " open file readonly if it already been open + " nvim seems change default from '' to 'e', but I prefer 'o' + " :h w325 e325 SwapExists swapchoice default-autocmds + " https://vi.stackexchange.com/questions/21784/vim-edit-anyway-without-prompting + " https://github.com/neovim/neovim/pull/25336 + " https://github.com/neovim/neovim/commit/29fe883aa9166bdbcae3f935523c75a8aa56fe45 + " remove nvim_swapfile autocmd is more correct, without also works but I think it change to 'e' then to 'o' which is not ideal, also it will echo "W325: ..." which is not what I want + autocmd! nvim_swapfile + autocmd SwapExists * let v:swapchoice = 'o' augroup END " :h markdown, for vim default tpope/vim-markdown -- cgit v1.2.3-70-g09d2 From 3ebba966f0b21a2686e5cc3fa803882e575a8827 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 26 May 2024 17:42:36 -0700 Subject: htop merge command name and command line https://unix.stackexchange.com/a/657002 --- home/xyz/.config/htop/htoprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/htop/htoprc b/home/xyz/.config/htop/htoprc index 444e8ad4..3b02ceda 100644 --- a/home/xyz/.config/htop/htoprc +++ b/home/xyz/.config/htop/htoprc @@ -18,7 +18,7 @@ highlight_changes=0 highlight_changes_delay_secs=5 find_comm_in_cmdline=1 strip_exe_from_cmdline=1 -show_merged_command=0 +show_merged_command=1 header_margin=1 screen_tabs=1 detailed_cpu_time=1 -- cgit v1.2.3-70-g09d2 From 6c63c6f13bca381f6f09145478c3b25e53357af7 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 27 May 2024 01:48:03 -0700 Subject: fix: make fzf ctrl-t work in symlink dir --- home/xyz/.profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.profile b/home/xyz/.profile index 14fc542b..02db6e72 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -52,7 +52,10 @@ export MAKEFLAGS="-j$(nproc --all)" export FZF_DEFAULT_COMMAND="find . -mindepth 1 -path '*/\.git' -prune -o -print" # https://askubuntu.com/questions/444551/get-absolute-path-of-files-using-find-command # following two lines if use "" on the outermost, will not perfom expected, not sure why -export FZF_CTRL_T_COMMAND='find "$PWD" -mindepth 1 -path "*/\.git" -prune -o -print' +# use "$(pwd -P)" instead of "$PWD", else it will not work in symlink dir +# -P to make it show realpath, another way is: "$(realpath .)", but I prefer pwd because it is shell builtin which maybe faster +# or I can use find -L or -H (not sure about differences between the two), but I prefer realpath instead of symlink +export FZF_CTRL_T_COMMAND='find "$(pwd -P)" -mindepth 1 -path "*/\.git" -prune -o -print' #export FZF_CTRL_T_COMMAND='sudo find "$(pwd)" -path "*/\.git" -prune -o -print' # ~+ is bashism #export FZF_CTRL_T_COMMAND="sudo find ~+ -path '*/\.git' -prune -o -print" -- cgit v1.2.3-70-g09d2 From a15d7097e161a914810e4d8f0ce48578a8224751 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Thu, 20 Jun 2024 05:11:48 +0000 Subject: add testdisk, just in case partition got broken and need fix --- home/xyz/.config/myconf/pacman_Qqne | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 79e9d4f8..21020ae5 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -46,6 +46,7 @@ speedtest-cli strace systemd-resolvconf tcpdump +testdisk tinyxxd traceroute tree -- cgit v1.2.3-70-g09d2 From 9c956cfe1ee447fc0968d88516e7c859a601b25a Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Fri, 28 Jun 2024 00:57:17 +0000 Subject: feat: wg and swgp config, mainly for aa --- etc/nftables.conf | 25 +++++++++++++++++++++- etc/services | 2 ++ etc/sysctl.d/99-sysctl.conf | 7 ++++++ etc/systemd/network/10-cloud-init-eth0.network | 7 ++++++ .../multi-user.target.wants/wg-quick@wg0.service | 1 + home/xyz/.config/myconf/pacman_Qqme | 3 ++- home/xyz/.config/myconf/pacman_Qqne | 2 +- home/xyz/.config/myconf/sye | 3 ++- 8 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 etc/sysctl.d/99-sysctl.conf create mode 120000 etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service (limited to 'home') diff --git a/etc/nftables.conf b/etc/nftables.conf index 22e38dfe..b824edee 100644 --- a/etc/nftables.conf +++ b/etc/nftables.conf @@ -8,6 +8,8 @@ # needed for reload config using `sudo systemctl restart nftables` or `sudo nft -f /etc/nftables.conf` flush ruleset +define pub_iface = "eth0" +define wg_iface = "wg0" table inet my_table { chain my_input { @@ -17,6 +19,7 @@ table inet my_table { ct state invalid drop comment "early drop of invalid connections" ct state {established, related} accept comment "allow tracked connections" iifname lo accept comment "allow from loopback" + iifname $wg_iface accept comment "allow from wireguard" ip protocol icmp accept meta l4proto ipv6-icmp accept @@ -25,7 +28,8 @@ table inet my_table { #tcp dport qbt accept #udp dport qbt accept #tcp dport iperf3 accept - #udp dport wireguard accept + udp dport wireguard accept + udp dport swgp accept # for acme.sh standalone mode builtin webserver to renew ssl cert tcp dport http accept # email related ports @@ -45,6 +49,12 @@ table inet my_table { type filter hook forward priority filter policy drop # Drop everything forwarded to us. We do not forward. That is routers job. + + # needed for wireguard? + #iifname $wg_iface oifname $pub_iface accept + #iifname $pub_iface oifname $wg_iface accept + iifname $wg_iface accept + oifname $wg_iface accept } chain my_output { @@ -53,3 +63,16 @@ table inet my_table { # Accept every outbound connection } } + +# needed to wireguard NAT masquerade VPN traffic +# Need inet to masquerade both ipv4 and ipv6? If use ip it will only masquerade ipv4? If use ip6 it will only masquerade ipv6? +# https://wiki.nftables.org/wiki-nftables/index.php/Nftables_families +table inet nat { + # newer kernel no need for `chain prerouting { type nat hook prerouting priority -100; policy accept; }`, more see https://www.procustodibus.com/blog/2021/11/wireguard-nftables/ + # for all packets to $pub_iface, after routing, replace source address with primary IP of $pub_iface interface + chain postrouting { + type nat hook postrouting priority 100 + policy accept + oifname $pub_iface masquerade + } +} diff --git a/etc/services b/etc/services index aa270681..91a89df2 100644 --- a/etc/services +++ b/etc/services @@ -11510,5 +11510,7 @@ inspider 49150/tcp # my services # My ISP verizon block incomming to gateway port 22. So I need to use another port to ssh into my home server. # https://www.reddit.com/r/verizon/comments/to1q43/verizon_5g_home_internet_blocking_ssh_service_port/ +wireguard 49432/udp ssh-isp 49812/tcp iperf3 53497/tcp +swgp 54635/udp diff --git a/etc/sysctl.d/99-sysctl.conf b/etc/sysctl.d/99-sysctl.conf new file mode 100644 index 00000000..b9677c02 --- /dev/null +++ b/etc/sysctl.d/99-sysctl.conf @@ -0,0 +1,7 @@ +# at least `net.ipv4.ip_forward = 1` is needed for wireguard masquerade? to work. Without will result into can't ping ips, can't curl websites, browser can't visit websites +# ka seems has this as default, maybe arch linux cloud-init image has this as default? +# https://forums.rockylinux.org/t/wireguard-masquerade-wont-work/7752 +# https://wiki.archlinux.org/title/Nftables#NAT_with_port_forwarding +# https://github.com/teddysun/across/blob/acef6b00a6ad062c0e99286ea136d1a246def644/wireguard.sh#L514-L522 +net.ipv4.ip_forward = 1 +net.ipv6.conf.all.forwarding = 1 diff --git a/etc/systemd/network/10-cloud-init-eth0.network b/etc/systemd/network/10-cloud-init-eth0.network index 1bc579b9..7829f528 100644 --- a/etc/systemd/network/10-cloud-init-eth0.network +++ b/etc/systemd/network/10-cloud-init-eth0.network @@ -14,7 +14,14 @@ Address=38.175.201.185/22 Address=2606:a8c0:3::75f/128 [Address] +# another ipv6 address for aa wireguard+swgp into +# not sure if it is corret, but it works +Address=2606:a8c0:3:773::b/64 + +[Address] +# the last address seems is the default? # ...:1/64 also works, but I use ...:a/64 because crunchbits panel reverse DNS support this address +# 2024-06-27, ...:1/64 seems doe not work any more, not sure why Address=2606:a8c0:3:773::a/64 # use the following will not need GatewayOnLink=yes in [Route] section, but I'm not sure if it is correct, I'm not sure if those ips could be accessed without gateway, more see https://superuser.com/q/1562380 #Address=2606:a8c0:3:773::a/48 diff --git a/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service b/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service new file mode 120000 index 00000000..0a92cb9a --- /dev/null +++ b/etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/wg-quick@.service \ No newline at end of file diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index 1ae6f3b5..1ae88691 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -5,8 +5,9 @@ bash-complete-alias dashbinsh grub-hook htop-vim -librespeed-cli +librespeed-cli-bin neovim-plug paru-bin pipdeptree +swgp-go task-spooler diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 21020ae5..c1e1c8bd 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -54,7 +54,7 @@ unrar-free unzip vidir2-git wget +wireguard-tools xdg-user-dirs -xfsprogs zip zoxide diff --git a/home/xyz/.config/myconf/sye b/home/xyz/.config/myconf/sye index 8d845498..a47a970f 100644 --- a/home/xyz/.config/myconf/sye +++ b/home/xyz/.config/myconf/sye @@ -6,6 +6,7 @@ opendkim.service enabled disabled opendmarc.service enabled disabled postfix.service enabled disabled sshd.service enabled disabled +swgp-go.service enabled disabled systemd-network-generator.service enabled enabled systemd-networkd-wait-online.service enabled enabled systemd-networkd.service enabled enabled @@ -19,4 +20,4 @@ acme.sh.timer enabled disabled paccache.timer enabled disabled pacman-filesdb-refresh.timer enabled disabled -19 unit files listed. +20 unit files listed. -- cgit v1.2.3-70-g09d2 From ca57a66869de7a796b21d232073e542c54e66f02 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 24 Jun 2024 19:37:58 -0700 Subject: typo: use deprecated instead of depreciated https://tenthousandfailures.com/blog/2014/3/22/software-deprecate-versus-depreciate --- home/xyz/.bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index f011eba6..dab44c72 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -16,7 +16,7 @@ esac # default PS1 #PS1='[\u@\h \W]\$ ' -# depreciated +# deprecated # 0: not bold, 91: bright red # \e[m act like \e[0m, means reset so commands after it will not be colored # https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit @@ -138,7 +138,7 @@ alias tree='tree -aC -I .git | "$PAGER"' alias uname='uname -a' alias vkmark='vkmark --fullscreen' -# depreciated +# deprecated # all green color, no auto turn off color when pipe to nvim #alias pactree='pactree -c' -- cgit v1.2.3-70-g09d2 From f8a0d7531f5ecf6dff035d4cf22ac81c780b3279 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Thu, 27 Jun 2024 01:30:48 -0700 Subject: no dyafk now, studio no firefox --- home/xyz/.config/nvim/init.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index fd368ebe..54293df0 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -8,8 +8,7 @@ call plug#begin() "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' "Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } -" xyzstudio maybe used for headless firefox douyu afk -if has('nvim') && executable('firefox') && ( hostname() != 'xyzstudio' ) +if has('nvim') && executable('firefox') Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } endif " tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily -- cgit v1.2.3-70-g09d2 From a04be2e775ec001f889cc75ad46dbd69136f09c2 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 1 Jul 2024 16:39:31 -0700 Subject: comment --- home/xyz/.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index dab44c72..30d6c80c 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -28,7 +28,7 @@ esac # tput is better for different terminals? # but also need \[ and \] around color code for PS1! but seems no need for printf in script? why? -# setaf and sgr0 see `man terminfo` +# setaf and sgr0 see `man terminfo`, also it seems can have 256 different colors PS1="\[$(tput setaf 6)\][\u@\h \W]\$ \[$(tput sgr0)\]" # https://github.com/LukeSmithxyz/voidrice/blob/master/.config/shell/aliasrc -- cgit v1.2.3-70-g09d2 From ed878d4809ec65acc0d2713f79b76ce39341bbac Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Fri, 28 Jun 2024 18:42:35 -0700 Subject: update --- home/xyz/.bashrc | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 30d6c80c..ccd668ed 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -108,6 +108,7 @@ alias vd='vidir' alias vd2='vidir2 --linktargets' alias vq='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/others/questions_ideas_tips.md"' alias vn='"$EDITOR" "$(find "$XDG_DOCUMENTS_DIR/notes" -mindepth 1 -path "*/\.git" -prune -o -type f -print | fzf)"' +alias vni='"$EDITOR" -ni NONE' alias vr='"$EDITOR" "$DOTREMINDERS"' alias vrc='"$EDITOR" +e\ \$MYVIMRC' alias vrm='"$EDITOR" "$XDG_DOCUMENTS_DIR/notes/others/recurring_maintenance.md"' -- cgit v1.2.3-70-g09d2 From f936a34634e18610914390d02ea700980c57deb1 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 29 Jun 2024 15:17:21 -0700 Subject: feat: vrc enable markdown folding hotkey --- home/xyz/.config/nvim/init.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 54293df0..2f2a1ae6 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -201,6 +201,8 @@ nnoremap O O " for searching command in manpages map - /^ *- map * /\*\*.*\*\* +" enable markdown folding and re-edit current file +map m :let g:markdown_folding=1:e " default statusline:set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P set statusline+=%< -- cgit v1.2.3-70-g09d2 From 0ba24ac20dfc7f2108984b198b33b95091eaad21 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 29 Jun 2024 15:23:03 -0700 Subject: maybe more correct --- home/xyz/.config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 2f2a1ae6..de15f822 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -41,7 +41,7 @@ let g:firenvim_config = { 'localSettings': { '.*': { 'takeover': 'never' } } } let g:infoprg = '/usr/bin/info' " I use only one return for better readability -function Autocmd_set_fenc() +function! Autocmd_set_fenc() abort " need to test &modifiable for gO if &modifiable && (&fileencoding != "utf-8") let l:fenc_bef = &fileencoding -- cgit v1.2.3-70-g09d2 From f6d88d1230d6b436c95b9d00006fa2b116819f59 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 29 Jun 2024 16:05:52 -0700 Subject: feat: vrc toggle markdown fold --- home/xyz/.config/nvim/init.vim | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index de15f822..f40714d3 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -62,6 +62,20 @@ function! s:base16_customize() abort call Base16hi("Folded", g:base16_gui03, g:base16_gui01, g:base16_cterm03, g:base16_cterm01, "", "") endfunction +function! Md_toggle_fold() abort + " &markdown_folding won't work because markdown_folding is not an option + " two ways to check if g:markdown_folding variable exists and is true: + " more see https://stackoverflow.com/q/15864164/9008720 + "if exists('g:markdown_folding') && g:markdown_folding + if get(g:, 'markdown_folding') + let g:markdown_folding=0 + e + else + let g:markdown_folding=1 + e + endif +endfunction + " not fully understood augroup, recommanded in :help " https://www.youtube.com/watch?v=dBBUOO1PRIU augroup mycmd @@ -201,8 +215,8 @@ nnoremap O O " for searching command in manpages map - /^ *- map * /\*\*.*\*\* -" enable markdown folding and re-edit current file -map m :let g:markdown_folding=1:e +" toggle markdown folding and re-edit current file +map m :call Md_toggle_fold() " default statusline:set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P set statusline+=%< -- cgit v1.2.3-70-g09d2 From 691b1145250ea555a3dd5982796f3e3d493e8a82 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 3 Jul 2024 21:35:44 +0000 Subject: update --- home/xyz/.config/myconf/pacman_Qqne | 1 + 1 file changed, 1 insertion(+) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index c1e1c8bd..48914a1a 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -14,6 +14,7 @@ grub ioping iotop-c iperf3 +ldns lf linux lostfiles -- cgit v1.2.3-70-g09d2 From 07df571fe12fd015a5a2a3388d3e736e650fb8b9 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 6 Jul 2024 22:10:45 +0000 Subject: rsync as asdeps because if asexplict I need to add too many pkgs --- home/xyz/.config/myconf/pacman_Qqne | 1 - 1 file changed, 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 48914a1a..961590a5 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -40,7 +40,6 @@ postfix python-pip rebuild-detector reflector -rsync shellcheck socat speedtest-cli -- cgit v1.2.3-70-g09d2 From 5cbfb7729af3f2ca03385257275a10c38d11ddac Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 3 Jul 2024 00:26:46 -0700 Subject: vrc comment --- home/xyz/.config/nvim/init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index f40714d3..18f5dadc 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -92,7 +92,8 @@ augroup mycmd " https://stackoverflow.com/q/28310094 multi filetypes " for alerting me plain text email characters per line " neomutt auto set new email filetype as mail so this will work - " https://stackoverflow.com/q/2290016 suggest gitcommit main body shouldbe about 72 + " /usr/share/nvim/runtime/ftplugin/mail.vim default textwidth 72 + " https://stackoverflow.com/q/2290016 suggest gitcommit main body should be about 72 " https://useplaintext.email/ suggest 72 " https://mailformat.dan.info/body/linelength.html suggested 65 "" https://superuser.com/q/827647/1282809 -- cgit v1.2.3-70-g09d2 From 276b268bd01e04a56cb9bd5f1a6b67c493a936d2 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 14 Jul 2024 22:22:33 -0700 Subject: git config use new email --- home/xyz/.config/git/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.config/git/config b/home/xyz/.config/git/config index 16b26035..27649804 100644 --- a/home/xyz/.config/git/config +++ b/home/xyz/.config/git/config @@ -1,5 +1,5 @@ [user] - email = gky44px1999@gmail.com + email = xyz@flylightning.xyz name = Xiao Pan [url "https://github.com/"] insteadOf = git://github.com/ -- cgit v1.2.3-70-g09d2 From 5fe1225deaf17c804230bc4ff2692c83969ab141 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 31 Jul 2024 02:39:04 -0700 Subject: git configure format-patch always signoff This config add Signed-off-by in commit msg. Related urls: https://mikegerwitz.com/2012/05/a-git-horror-story-repository-integrity-with-signed-commits https://stackoverflow.com/questions/46314273/keeping-gpg-signature-in-git-patches-with-format-patch https://handbook.gnome.org/development/commit-messages.html https://docs.kernel.org/process/5.Posting.html https://docs.kernel.org/translations/zh_CN/process/5.Posting.html https://docs.kernel.org/translations/zh_CN/process/submitting-patches.html#cn-submittingpatches https://wiki.openstack.org/wiki/GitCommitMessages --- home/xyz/.config/git/config | 2 ++ 1 file changed, 2 insertions(+) (limited to 'home') diff --git a/home/xyz/.config/git/config b/home/xyz/.config/git/config index 27649804..10e19af9 100644 --- a/home/xyz/.config/git/config +++ b/home/xyz/.config/git/config @@ -3,3 +3,5 @@ name = Xiao Pan [url "https://github.com/"] insteadOf = git://github.com/ +[format] + signOff = true -- cgit v1.2.3-70-g09d2 From 5467841399e02e8713ec11e2f57b9745a314020c Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Thu, 15 Aug 2024 15:55:24 -0700 Subject: ca `nproc --all` report wrong cpu thread count ca actual cpu threads are 3, `nproc --all` wrongly report as 128. I tested on all my computers and it seems nproc output is fine. Weird thing is only ca report nproc and `nproc --all` differently. Anyway, I just use nproc instead. --- home/xyz/.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.profile b/home/xyz/.profile index 02db6e72..4b95c04b 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -44,7 +44,7 @@ export INPUTRC="$XDG_CONFIG_HOME/.inputrc" export CLICOLOR=1 # for pacdiff, without using aur neovim-drop-in or neovim-symlinks export DIFFPROG='nvim -d' -export MAKEFLAGS="-j$(nproc --all)" +export MAKEFLAGS="-j$(nproc)" # use sudo find for some files or dirs that has no permission ex: ~/.cache/paru/clone/ #export FZF_DEFAULT_COMMAND="fd --no-ignore --hidden --exclude .git" #export FZF_CTRL_T_COMMAND="fd --absolute-path --no-ignore --hidden --exclude .git" -- cgit v1.2.3-70-g09d2 From ae6eb0904885794b020cff4e42be6fe0e9cb7e0a Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 18 Aug 2024 14:03:32 -0700 Subject: calculated estimated 1.47 MiB for .bash_history if HISTSIZE=100000, not too much --- home/xyz/.profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.profile b/home/xyz/.profile index 4b95c04b..4687f177 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -17,8 +17,8 @@ export XDG_VIDEOS_DIR PATH="$(find "$HOME/.local/bin" -type d -exec printf '%s:' '{}' \+)$PATH" export PATH -export HISTSIZE=15000 -export HISTFILESIZE=15000 +export HISTSIZE=100000 +export HISTFILESIZE=100000 export HISTCONTROL=ignorespace # sqlite uses VISUAL for the edit() SQL function default text editor -- cgit v1.2.3-70-g09d2 From 7a9070762b8eb14a39213583577a86a2a413592c Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 28 Oct 2024 14:49:39 -0700 Subject: outdated comment --- home/xyz/.bashrc | 1 - 1 file changed, 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index ccd668ed..8b1dff90 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -86,7 +86,6 @@ alias sst='ssh studio' # \" to consider $HOME contain space, need \ else " will be expanded locally, need \$ else $HOME will expand locally # can test with: alias mytest='ssh studio for i in \"\$SSH_CONNECTION\"\; do echo \$i\; echo a\; done' alias sstm='ssh -t -- studio mpra -c \"\$HOME/programs/repos/fly/any/fsh-git\"' -# from `man remind`: "Note that you can omit the reminder type, in which case it defaults to MSG" # can test this mess with `alias tt='echo "\$haha \"lala\""'` alias sun='printf "set \$Longitude \"-121.89\"\nset \$Latitude \"37.34\"\n[sunrise()] sunrise\n[sunset()] sunset" | remind -n -' # another way: -- cgit v1.2.3-70-g09d2 From a0d34d295ef002833ceb9c455779d1f2812f2bed Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Tue, 10 Dec 2024 01:09:04 -0800 Subject: tinted-theming/tinted-vim breaking changes https://github.com/tinted-theming/tinted-vim/pull/89 --- home/xyz/.config/nvim/init.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'home') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 18f5dadc..cb19aff4 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -58,8 +58,8 @@ function! s:base16_customize() abort " make fold title more contrast and readable, by reverting some changes from: " https://github.com/tinted-theming/base16-vim/pull/43/files " tested with base16-tomorrow-night theme - call Base16hi("FoldColumn", g:base16_gui0C, g:base16_gui01, g:base16_cterm0C, g:base16_cterm01, "", "") - call Base16hi("Folded", g:base16_gui03, g:base16_gui01, g:base16_cterm03, g:base16_cterm01, "", "") + call Tinted_Hi("FoldColumn", g:tinted_gui0C, g:tinted_gui01, g:tinted_cterm0C, g:tinted_cterm01, "", "") + call Tinted_Hi("Folded", g:tinted_gui03, g:tinted_gui01, g:tinted_cterm03, g:tinted_cterm01, "", "") endfunction function! Md_toggle_fold() abort -- cgit v1.2.3-70-g09d2