LQY's Blog
Share anything
incomplete projects
Archived by month
Useful tags
You are looking for posts under category: Miscellaneous
2023-05-14 |robot

git clone https://github.com/pytorch/pytorch hangs

After adding verbose switch: git clone https://github.com/pytorch/pytorch -v, we get:

Cloning into 'pytorch'...
POST git-upload-pack (175 bytes)
POST git-upload-pack (chunked)

According to StackOverflow:

This is a bug in Git; when using HTTPS it will use chunked encoding for uploads above a certain size. Those do not work. A trivial fix is to tell git to not chunk until some ridiculously large size value...

Add this to ~/.gitconfig:

        postBuffer = 157286400
2023-04-15 |robot

resounding /rɪˈzaʊndɪŋ/
sampling sam∙pling /ˈsɑːmplɪŋ; NAmE ˈsæm-/


  • 登陆只能用手机扫QR code,企图用手机App OTP替代传统用户名密码
  • 不支持消息同步:e.g. 电脑上新安装client后无法显示行动装置可见之历史消息。换了新设备,旧设备上的群不见了。
  • 垄断了IMS中国市场,导致大量人对互联网Internet存在误解,企图用“公众号”代替传统Website,e.g. 使用了web技术但不支持web标准(仅可专用客户端即微信App访问,不支持搜索服务检索),网页lazy load富媒体内容导致浏览体验极差
  • 人在大量不适宜应用微信之场合强行应用微信及关联腾讯应用,e.g. 国人不懂RSS订阅、Jira之类的进度跟踪软件、邮件列表;凡事建形形色色的“群”,不论什么轻重缓急的消息都往“群”里发
  • 功能臃肿,企图以小程序代替apk,实现系统中之系统,将支付与IMS等众多功能进行绑定导致使用者的数字生活高度依赖于腾讯,存在单点故障风险
  • 数据存储使用私有格式和方式,且有异常巨量存储空间占用报道,且用户无法导出为结构化数据进行查看、备份等管理作业(截图行为导致结构化文本信息降级成像素信息)


  • 莫名奇妙的、不对用户解释的关键词检测
  • 邪恶的广告投送
2023-04-13 |robot



prompt grml-large
source /usr/share/autojump/autojump.zsh
alias md='mkdir'
#setopt noextendedhistory
#setopt nosharehistory
# global zshrc.local modified on top of /etc/skel/.zshrc
alias p='ping'
## Inform users about upgrade path for grml's old zshrc layout, assuming that:
## /etc/skel/.zshrc was installed as ~/.zshrc,
## /etc/zsh/zshrc was installed as ~/.zshrc.global and
## ~/.zshrc.local does not exist yet.
if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then
    printf '-!-\n'
    printf '-!- Looks like you are using the old zshrc layout of grml.\n'
    printf '-!- Please read the notes in the grml-zsh-refcard, being'
    printf '-!- available at: http://grml.org/zsh/\n'
    printf '-!-\n'
    printf '-!- If you just want to get rid of this warning message execute:\n'
    printf '-!-        touch ~/.zshrc.local\n'
    printf '-!-\n'

function fixperm {
  sudo chown -R liu:liu ./
  sudo find ./ -type d -exec chmod 750 {} \;
  sudo find ./ -type f -exec chmod 640 {} \;

function fixpermiso {
  sudo chown -R iso:liu ./
  sudo find ./ -type d -exec chmod 770 {} \;
  sudo find ./ -type f -exec chmod 660 {} \;
## Prompt theme extension ##
# Virtualenv support
function virtual_env_prompt () {
#if ! grml_theme_has_token virtual-env; then
grml_theme_add_token  virtual-env -f virtual_env_prompt '%F{magenta}' '%f'
zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent

## ZLE tweaks ##

## use the vi navigation keys (hjkl) besides cursor keys in menu completion
#bindkey -M menuselect 'h' vi-backward-char        # left
#bindkey -M menuselect 'k' vi-up-line-or-history   # up
#bindkey -M menuselect 'l' vi-forward-char         # right
#bindkey -M menuselect 'j' vi-down-line-or-history # bottom

## set command prediction from history, see 'man 1 zshcontrib'
is4 && zrcautoload predict-on && \
zle -N predict-on         && \
zle -N predict-off        && \
bindkey "^X^Z" predict-on && \
bindkey "^Z" predict-off

## press ctrl-q to quote line:
mquote () {
      zle beginning-of-line
      zle forward-word
      # RBUFFER="'$RBUFFER'"
      zle end-of-line
zle -N mquote && bindkey '^q' mquote

## define word separators (for stuff like backward-word, forward-word, backward-kill-word,..)
#WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default

# just type '...' to get '../..'
rationalise-dot() {
local MATCH
if [[ $LBUFFER =~ '(^|/| |      |'$'\n''|\||;|&)\.\.$' ]]; then
  zle self-insert
  zle self-insert
  zle self-insert
zle -N rationalise-dot
bindkey . rationalise-dot
## without this, typing a . aborts incremental history search
bindkey -M isearch . self-insert

#bindkey '\eq' push-line-or-edit

## some popular options ##

## add `|' to output redirections in the history
#setopt histallowclobber

## try to avoid the 'zsh: no matches found...'
#setopt nonomatch

## warning if file exists ('cat /dev/null > ~/.zshrc')
#setopt NO_clobber

## don't warn me about bg processes when exiting
#setopt nocheckjobs

## alert me if something failed
setopt printexitvalue

## with spelling correction, assume dvorak kb
#setopt dvorak

## Allow comments even in interactive shells
#setopt interactivecomments

## global aliases (for those who like them) ##

#alias -g '...'='../..'
#alias -g '....'='../../..'
#alias -g BG='& exit'
#alias -g C='|wc -l'
#alias -g G='|grep'
#alias -g H='|head'
#alias -g Hl=' --help |& less -r'
#alias -g K='|keep'
#alias -g L='|less'
#alias -g LL='|& less -r'
#alias -g M='|most'
#alias -g N='&>/dev/null'
#alias -g R='| tr A-z N-za-m'
#alias -g SL='| sort | less'
#alias -g S='| sort'
#alias -g T='|tail'
#alias -g V='| vim -'

## instead of global aliase it might be better to use grmls $abk assoc array, whose contents are expanded after pressing ,.
#$abk[SnL]="| sort -n | less"

## get top 10 shell commands:
alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'

## Execute \kbd{./configure}
#alias CO="./configure"

## Execute \kbd{./configure --help}
#alias CH="./configure --help"

## miscellaneous code ##

## Use a default width of 80 for manpages for more convenient reading
#export MANWIDTH=${MANWIDTH:-80}

## Set a search path for the cd builtin
#cdpath=(.. ~)

# List all occurrences of programm in current PATH
plap() {
    emulate -L zsh
    if [[ $# = 0 ]] ; then
        echo "Usage:    $0 program"
        echo "Example:  $0 zsh"
        echo "Lists all occurrences of program in the current PATH."
        ls -l ${^path}/*$1*(*N)

# Find out which libs define a symbol
lcheck() {
    if [[ -n "$1" ]] ; then
        nm -go /usr/lib/lib*.a 2>/dev/null | grep ":[[:xdigit:]]\{8\} . .*$1"
        echo "Usage: lcheck <function>" >&2

# print hex value of a number
hex() {
    emulate -L zsh
    if [[ -n "$1" ]]; then
        printf "%x\n" $1
        print 'Usage: hex <number-to-convert>'
        return 1

## log out? set timeout in seconds...
## ...and do not log out in some specific terminals:
#if [[ "${TERM}" == ([Exa]term*|rxvt|dtterm|screen*) ]] ; then
#    unset TMOUT
#    TMOUT=1800

#bindkey "^[[1;3C" forward-word
#bindkey "^[[1;3D" backward-word
WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default

#alias sudo='sudo -v; sudo '
alias sudo='sudo '

alias una='uname -a'

# general
alias jb0='journalctl -b 0'
alias jb1='journalctl -b -1'
alias ju='journalctl -u'
alias jxe='journalctl -xe'
alias jxeu='journalctl -xeu'
alias jctl='journalctl'
alias chatpi="sudo chattr +i"
alias chatmi="sudo chattr -i"

alias status="systemctl status "
alias stop="sudo systemctl stop "
alias sto="sudo systemctl stop "
alias start="sudo systemctl start"
alias sta="sudo systemctl start"
alias restart="sudo systemctl restart "
alias res="sudo systemctl restart "
alias reload="sudo systemctl reload "
alias rel="sudo systemctl reload "
alias senable="sudo systemctl enable"
alias sen="sudo systemctl enable"
alias disable="sudo systemctl disable "
alias dis="sudo systemctl disable "
alias dmreload="sudo systemctl daemon-reload"
alias dmr="sudo systemctl daemon-reload"

alias shiber="sudo systemctl hibernate"
alias ssus="sudo systemctl suspend"

alias dmesgw='sudo dmesg -w'
function dmesgi {
    sudo dmesg|grep -i $1

alias i7z='sudo i7z'
alias powertop='sudo powertop'
alias dmesg='sudo dmesg'
alias iotop="sudo iotop"
alias iftop="sudo iftop"
alias nethogs="sudo nethogs"
alias suv="sudo vim"
alias lsp="sudo netstat -tunlp"

alias smi='watch -n1 "  nvidia-smi"'
alias gputemp="nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader"
alias cpumon='watch -n1 " cat /proc/cpuinfo | grep MHz"'
alias mmon='watch -n1 "free -h"'
alias nmon='watch -n1 "ip a"'
alias cmon='watch -n1 "sensors|grep C"'

#alias ipa='/usr/bin/ip a -color=auto'
alias ipa='ip a'
alias checkreboot=' last -x|head -30'
alias netsp='vnstat -l -ru'
alias edho="sudo vim /etc/hosts"
alias edrc="sudo vim /etc/zsh/zshrc.local; source /etc/zsh/zshrc"
alias ednf="sudo vim /etc/nftables.conf ; restart nftables.service"
#alias edrc="kate /etc/zsh/zshrc.local ||  vim /etc/zsh/zshrc.local"
alias edrcc="sudo vim /etc/zsh/zsh-user-credential"
alias edsrc="kate ~/.ssh/config ||  vim ~/.ssh/config"
alias edrs="sudo chattr -i /etc/resolv.conf;sudo vim /etc/resolv.conf;sudo chattr +i /etc/resolv.conf"
alias edfi="sudo chattr -i /etc/firejail/firecfg.config;sudo vim /etc/firejail/firecfg.config;sudo chattr +i /etc/firejail/firecfg.config && sudo firecfg"
alias edhs="kate ~/.zsh_history  ||  vim ~/.zsh_history"
alias startvncold="vncserver -geometry 1920x1080 --nevershared -localhost yes"
alias choroot='sudo chown -R root:root '
alias pamunlock='faillock; faillock --reset; faillock'

alias lsf='ls -p | grep -v /'
# lsd already in grml-zsh-config

alias zcompressdeb='tar --use-compress-program zstd -cvf '
alias zdecompressdeb='tar --use-compress-program zstd -xvf '
function zcompress {
    tar cf - $2 | zstd --threads=0 > $1
function zcompress-single {
    tar cf - $2 | zstd > $1
alias zdecompress="tar -I zstd -xvf "
#alias 7zenc='7z a -mhe=on X.7z X -pPASS'
alias 7zenc='7z a -mhe=on '
#alias 7zencnoc='7z a -mhe=on -m0=Copy X.7z X -pPASS'
alias 7zencnoc='7z a -mhe=on -m0=Copy '

alias enforegitignore='git rm -r --cached . && git add . && git commit -am "Remove ignored files"'
alias clone="git clone  --recursive "
alias gpp='eval "$(ssh-agent -s)" &&  ssh-add ~/.ssh/${github_credential}'
# You must be using an SSH URL to check out code, check .git/config and ensure url = git@github.com:yourAccount/yourProject.git
# https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding
alias gp='git push -u origin main'
alias gpmaster='git push -u origin master'
alias gitupdate='git submodule sync --recursive; git submodule foreach -q git config remote.origin.url; git submodule update --init --recursive --remote'
alias grv='git remote -v'
alias gitreset='git fetch origin && git reset --hard origin/master || git reset --hard origin/main'

alias sshkeygenlfmd5='ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_rsa_key.pub '
alias sshkeygenllf='ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub '
alias sshkeygen='cd ~/.ssh && ssh-keygen -t ed25519 '

alias lt='ls -l --color=auto -v -t'
function cdls() {
  cd "$1";
  ls ./
alias pg='ps aux|grep '
alias lg='ls|grep '

# define this before traceroute: tp, tp6, mt
alias ipmark='python /usr/bin/lily/ipmarkup'
function di {
        dig $1|ipmark
function mt {
    mtr $1|ipmark
function tp {
    traceroute $1|ipmark
function tp6 {
    traceroute -6 $1|ipmark

function dnsmon {
    if [ -z "$1"]; then
    sudo /opt/liu/bin/capture-dns $dev | ipmark
function ipm {
    echo $1 | python3 /usr/bin/lily/ipmarkup

function fdn {
    find ./ -name '*'$1'*'
function fddn {
    find ./ -type d -name '*'$1'*'
function fdnclean {
    find ./ -name '*'$1'*'  2> /dev/null 

function duhm {
    du -h --max-depth=1 $1 | sort -h
function duhmclean {
    du -h --max-depth=1 $1 2>/dev/null | sort -h
function duh {
    if [ -z "$1"]; then
    echo ${folder}
    du -hs ${folder}/* | sort -h
function duhh {
    if [ -z "$1"]; then
    echo ${folder}
    du -hs ${folder}/** | sort -h

function finddupname {
    # and the following 2 are from https://www.baeldung.com/linux/finding-duplicate-files
    awk -F'/' '{
    f = $NF
    a[f] = f in a? a[f] RS $0 : $0
    b[f]++ }
    END{for(x in b)
            printf "Duplicate Filename: %s\n%s\n",x,a[x] }' <(find . -type f)
function finddupsha1 {
    awk '{
        a[sha1]=sha1 in a ? a[sha1] RS $2 : $2
        b[sha1]++ }
        END{for(x in b)
            printf "Duplicate Files (MD5:%s):\n%s\n",x,a[x] }' <(find . -type f -exec sha1sum {} +)
function finddupsize {
    awk '{
        size = $1
        a[size]=size in a ? a[size] RS $2 : $2
        b[size]++ }
        END{for(x in b)
                printf "Duplicate Files By Size: %d Bytes\n%s\n",x,a[x] }' <(find . -type f -exec du -b {} +)
function optip {
    echo 'Optimize all png and jpg files'
    find "$1" -maxdepth 1 -type f -name "*.png" -exec sh -c "oxipng -o 4 -i 1 --strip safe '{}' " \;
    find "$1" -maxdepth 1 -type f -name "*.PNG" -exec sh -c "oxipng -o 4 -i 1 --strip safe '{}' " \;
    find "$1" -maxdepth 1 -type f -name "*.jpg" -exec sh -c "jpegoptim '{}' " \;
    find "$1" -maxdepth 1 -type f -name "*JPG" -exec sh -c "jpegoptim '{}' " \;
function optipr {
    echo 'Optimize all png and jpg files recursively'
    find "$1" -type f -name "*.png" -exec sh -c "oxipng -o 4 -i 1 --strip safe '{}' " \;
    find "$1" -type f -name "*.PNG" -exec sh -c "oxipng -o 4 -i 1 --strip safe '{}' " \;
    find "$1" -type f -name "*.jpg" -exec sh -c "jpegoptim '{}' " \;
    find "$1" -type f -name "*JPG" -exec sh -c "jpegoptim '{}' " \;

# Python
alias nbcvt="jupyter nbconvert --to python "
alias nbcvtxsingle='find . -name "*.ipynb" -exec jupyter nbconvert --to python  {}  \;'
alias nbcvtx='find . -type f -name "*.ipynb" -print0 | parallel -0 jupyter nbconvert --to python  {}  \;'

alias piup='pip install --upgrade pip   '
alias pirr='pip install -r requirements.txt '
alias pir='pip install -r req.txt '
alias pirsingle="cat req.txt | cut -f1 -d'#' | sed '/^\s*$/d' | xargs -n 1 pip install"
alias psr='pip freeze > req.txt '
alias piupr='pip install --upgrade pip  && pip install -r requirements.txt '
alias piu='pip install --upgrade'
alias pi='pip install '
alias pie='pip install -e .'
alias psi='python setup.py install'
alias pu='pip uninstall '

alias pythis='source venv/bin/activate; which python'
function py {
    echo 'activate python venv in ~/.py/'$1
    source ~/.py/$1/bin/activate
    which python

function renamePythonVenv {
    # sed pip
    # grep -l 'OLDNAME' ./*/* 2>&1|grep -v direct|grep -v binary | xargs sed -i 's/OLDNAME/NEWNAME/g'
    # grep -l 'OLDNAME' ./*/*/*/*/* 2>&1|grep -v direct|grep -v binary | xargs sed -i 's/OLDNAME/NEWNAME/g'

# conda new env from yaml
# conda env create -f vmail.yaml
# conda env remove --name project-envXXX
# in case it fails, use:
# conda env update --file environment.yml  --prune

alias k9v='killall -9 vlc'
alias kf='killall firefox'
function pctouch {
    touch $1 && pyc $1
alias unrealed='cd ~/f/UnrealEngine/Engine/Binaries/Linux; ./UnrealEditor'

# Download
alias agetx="aria2c -c -j 9 -x 9 -s 9 -k 1M --async-dns=false"
alias aget="aria2c --async-dns=false"

# Android

alias a='adb uninstall --user 0  '
alias ai='adb install'
alias au='adb uninstall  '
function apush {
    adb push $1 /sdcard/
function apull {
    adb pull $1
alias asrch='adb shell pm list packages -f | grep '
function ashot {
    adb exec-out screencap -p > ~/$1.png
function ainput {
    adb shell input tap $1 $2
function ainput16 {
    adb shell input tap $((16#$1)) $((16#$2))
function aloginput {
    adb shell getevent -l | grep ABS_MT_POSITION --line-buffered | awk '{a = substr($0,54,8); sub(/^0+/, "", a); b = sprintf("0x%s",a); printf("%d ",strtonum(b))}'

# Private extension

alias wget='wget --header="Accept: text/html" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" '
# robust wget recurisve download 
alias wg='wget --header="Accept: text/html" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" -nH --cut-dirs=1 -np --recursive -c --timeout=3  --waitretry=0 --tries=5 '

alias aria2c='aria2c --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" '

alias curl='curl --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" '

# https://pytorch.org/get-started/previous-versions/
# https://www.tensorflow.org/install/pip

    export PATH=/usr/local/cuda-9.2/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64:$LD_LIBRARY_PATH
    export PATH=/usr/local/cuda-10.0/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
        export PATH=/usr/local/cuda-10.1/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
    export PATH=/usr/local/cuda-11.0/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64:$LD_LIBRARY_PATH
    export PATH=/usr/local/cuda-11.2/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64:$LD_LIBRARY_PATH
    export PATH=/usr/local/cuda-11.5/bin:$PATH
        export LD_LIBRARY_PATH=/usr/local/cuda-11.5/lib64:$LD_LIBRARY_PATH

function changecudaver {
  rm /usr/local/cuda
  ln -sf /usr/local/cuda-$1 /usr/local/cuda

function checkvideointegritycuda {
    ffmpeg -hwaccel cuda -v error -i "$1" -f null - 2>"$1.log"
function checkvideointegrity {
    ffmpeg -v error -i "$1" -f null - 2>"$1.log"
function av1 {
    ffmpeg -i "$1" -c:a copy -c:v libsvtav1 "$1.av1.mp4"
function converttoav1 {
    for file in ./*; do
        ffmpeg -i "$file"  -c:v libsvtav1 "$file".av1.mp4

alias llh='ls -lh '
function  gettbwdepracated {
    echo "TB Written: $(echo "scale=3; $(sudo /usr/sbin/smartctl -A $1 | grep "Total_LBAs_Written" | awk '{print $10}') * 512 / 1073741824 / 1024" | bc | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"

function  plocate {
    sudo ls -l /proc/$1/exe

function cvtunix2dos {
    for a in ./*; do
        awk 'BEGIN{RS="^$";ORS="";getline;gsub("\n","\r&");print>ARGV[1]}' $a;
        #awk 'BEGIN{RS="^$";ORS="";getline;gsub("\r","");print>ARGV[1]}' $a
function cvtdos2unix {
    for a in ./*; do
        #awk 'BEGIN{RS="^$";ORS="";getline;gsub("\n","\r&");print>ARGV[1]}' $a;
        awk 'BEGIN{RS="^$";ORS="";getline;gsub("\r","");print>ARGV[1]}' $a

alias repaircorruptzshhistory='cd ~ && mv .zsh_history .zsh_history_old && strings .zsh_history_old > .zsh_history && fc -R .zsh_history'

function gpu {
    sudo nvidia-settings -c :1 -a '[gpu:0]/GPUFanControlState=1' -a "[fan:1]/GPUTargetFanSpeed=$1"
    sudo nvidia-settings -c :1 -a '[gpu:0]/GPUFanControlState=1' -a "[fan:0]/GPUTargetFanSpeed=$1"

function renamemastertomainlocal {
    git branch -m master main
    git fetch origin
    git branch -u origin/main main
    git remote set-head origin -a

alias nvcheck='source ~/.py/py3.9/bin/activate && cd ~/f/nvchecker && nvchecker -c  nvchecker.toml'

alias turnoffgpu='echo \_SB_.PC00.PEG1.PEGP._OFF  > /proc/acpi/call'
alias turnongpu='echo \_SB_.PC00.PEG1.PEGP._ON  > /proc/acpi/call'

alias startmon='ffmpeg -f v4l2 -video_size 1920x1080 -framerate 30 -i /dev/video0 -c:v libsvtav1  /mnt/xe/monitor/cam.webm'
alias gpuperf='echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'

alias cb='cargo build'
alias cbr='cargo build --release'
alias stu='sudo sh -c "systemctl  stop netctl@xjtustu NetworkManager wpa_supplicant ; ip link set wlo1 down ; ip link set wlo1 up ; iw dev wlo1 connect XJTU_STU "'
alias cbrmusl='cargo build  --target x86_64-unknown-linux-musl --release'

alias cpup='sudo zsh -c "cpupower frequency-set --governor performance;  echo 0 > /sys/devices/system/cpu/cpu*/power/energy_perf_bias ; echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo performance > /sys/module/pcie_aspm/parameters/policy"'
alias cpus='sudo zsh -c " cpupower frequency-set --governor powersave; echo 15 > /sys/devices/system/cpu/cpu*/power/energy_perf_bias ; echo powersave > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo powersupersave > /sys/module/pcie_aspm/parameters/policy"'
#alias myipg='aria2c https://bgp.he.net -o myip.html; grep -i visit myip.html | /usr/bin/lily/ipmarkup; rm myip.html'
alias myipg='cd /tmp/; rm myip.html; aria2c https://bgp.he.net -o myip.html && grep -i visit myip.html | /usr/bin/lily/ipmarkup; rm myip.html; cd -'
function cvt2mp3 {
        find ./ -name '*' -exec sh -c "ffmpeg -y -i '{}'  '{}.mp3'" \;
alias tailf='tail -f'
function juf {
        sudo journalctl -u $1 -f
alias edss='sudo vim /etc/ss-tproxy/ss-tproxy.conf       '
alias fixvaapi='cd /dev/dri; mv renderD128 renderD130   ; ln -s renderD129 renderD128 '
alias startp='startplasma-wayland'
alias mem-by-proc="ps aux | head -1; ps aux | sort -rnk 9"

#alias sc='systemctl'
alias sc='sudo systemctl '
alias scu='systemctl --user'
alias gt='/f/graftcp/graftcp '

alias bss='b3sum --num-threads 1'
alias bs='b3sum'
# tar cvf all subdirectories
alias tarsubdirs='for i in */; do tar cvf "${i%/}.tar.xz" "$i" && rm "$i" & done;'
alias open='xdg-open '
function concatts {
        for i in `\ls *.MTS | sort -V`; do echo "file '$i'"; done >> mylist.txt
        ffmpeg -f concat -i mylist.txt -c copy  video.mp4
function repairtmuxattach {
        sudo kill -SIGUSR1 $(pidof tmux)
alias psrch='pip freeze|grep '
source /etc/zsh/zsh-distro-arch


# zshrc.local with arch distro specific config, use source to include

# Arch
alias removeorphan="pacman -Qdt|awk '{print $1}'|xargs sudo pacman -R --noconfirm"
alias edmi="sudo vim /etc/pacman.d/mirrorlist"
alias purge="sudo pacman -R "
alias lspkg="expac --timefmt='%F %T' '%l %n' | sort -n"
alias srch='pacman -Ss '
function srchi {
    pacman -Ss $1 | grep install
alias pacu='sudo pacman -U '
function purgestar {
    sudo pacman -Rsn $(pacman -Qsq $1 | grep $1)
alias pacf='pacman -F '
alias ins='sudo pacman -S '
#alias syu.py='sudo python /opt/liu/scripts/syu.py'
alias syu='sudo pacman -Syu'
alias pcsyu='sudo proxychains pacman -Syu'
alias rsc='sudo pacman -Rsc'
alias qmq='pacman -Qmq'
alias ql="pacman -Ql "
alias qi="pacman -Qi "
alias rmpacmanlck='sudo rm /var/lib/pacman/db.lck'

alias autoremove='echo "can only be run as root"; pacman -Qtdq | pacman -Rns -'
alias sedpkgaarch64="sed -i '0,/x86_64/{s/x86_64/x86_64 aarch64/}' PKGBUILD"

function pcaur {
    mkdir ~/.pkgbuild
    cd ~/.pkgbuild
    proxychains wget https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz
    tar xvf $1.tar.gz
    cd $1
    proxychains makepkg -si
function aur {
    export http_proxy=
    export https_proxy=
    mkdir ~/.pkgbuild
    wget https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz
    tar xvf $1.tar.gz
    cd $1
    makepkg -si
    export http_proxy=""
    export https_proxy=""
function aurdi {
    mkdir ~/.pkgbuild
    wget https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz
    tar xvf $1.tar.gz
    cd $1
    makepkg -si

function addPacmanGrubHook {
echo 'this is equivalent to installing `grub-hook`'
echo '
Operation = Install
Operation = Upgrade
Operation = Remove
Type = File
Target = usr/lib/modules/*/vmlinuz

Description = Updating GRUB Config
Depends = grub
When = PostTransaction
Exec = /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
END' > /usr/share/libalpm/hooks/grub.hook

2023-04-13 |robot

Content Management

Among copious open-source content management system(CMS) or Markup-to-HTML software, e.g. MediaWiki, WordPress, Hugo, Hexo, Sphinx, Typecho is more lightweight than WordPress, and by utilizing PHP, it is full-featured compared to Markup-to-HTML software that requires a webserver to host the generated static html and js files.

Web server

Caddy has a simple yet powerful configuration syntax, yet it provide nearly the same functionality of nginx.

Operating system

Linux is more secure than Windows and supports more hardward than BSD family. Among all Linux distributions, Archlinux is the best one as it favors KISS principle, always come with up-to-date software packages using an efficient package management system.