安装时选择btrfs
文件系统可瞬间完成快照
1 | sudo pacman-mirrors --geoip && sudo pacman -Syy |
1 | echo -e '[archlinuxcn]\nServer = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --noconfirm archlinuxcn-keyring |
sudo timeshift --restore
并删除该软件包,直到问题解决)1 | pamac build --no-confirm autoupgrade |
1 | pamac build --no-confirm nopasswd |
简体中文
可选依赖, 注销或重启后生效)1 | pamac install --no-upgrade manjaro-asian-input-support-fcitx5 |
1 | echo '<?xml version="1.0"?> |
1 | pamac update --no-confirm && reboot |
laragon
是Windows
上的高性能本地开发环境。scoop
是Windows
的命令行安装程序。]]>Windows
每日必应壁纸1 | (crontab -l 2>/dev/null;echo '0 0 * * * reboot') | crontab - |
1 | crontab -l 2>/dev/null | sed '/reboot/d' | crontab - |
.github/workflows/deploy.yml
1 | name: deploy |
使用 PowerShell 执行
如果脚本里包含非 ASCII 字符,比如汉字,先修改管道字符集
1 | $OutputEncoding=[Text.Encoding]::UTF8 |
再执行
1 | (iwr -useb $url).content | py |
1 | wget -qO- $url | python3 |
1 | curl -sL $url | python3 |
'print("你好")' | py
时,输出两个问号之所以这样,是因为 PowerShell 中的管道默认字符集是 ASCII
使用如下命令来临时更改管道的输出字符集
1 | $OutputEncoding=[Text.Encoding]::UTF8 |
编辑~/.ssh/config
文件,添加如下配置
1 | Host github.com |
安装netcat
1 | sudo apt install -y netcat-openbsd |
1 | sudo yum install -y netcat-openbsd |
1 | sudo pacman -Sy --noconfirm openbsd-netcat |
编辑~/.ssh/config
文件,添加如下配置
1 | Host github.com |
在查看dmesg
信息后发现,开机时卡在了crng
收集熵,使用以下命令解决
1 | apt install -y haveged |
wheel
组提权免密
arch
系可以安装aur
中我写的nopasswd
包
1 | echo '%wheel ALL=(ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers |
Octopi 免弹窗, 依赖sudo
免密
1 | kwriteconfig5 --file kdesurc --group super-user-command --key super-user-command sudo |
系统设置免弹窗
1 | echo 'polkit.addRule(function(action, subject) {if (subject.isInGroup("wheel")) {return polkit.Result.YES;}});' | sudo tee /etc/polkit-1/rules.d/49-nopasswd_global.rules |
按Win+R
执行以下命令
1 | powershell Get-AppPackage|?{ $_.Name -ne 'Microsoft.WindowsStore'}|Remove-AppPackage -ea Ignore |
1 | /** |
此函数在 JavaScript 中实现了 python 中的 range 函数,
想要使用 python 中的 for…in 结构可以这样做:
1 | for (let i of range(10)) { |
想要返回输出数组可以这样做:
1 | [...range(10)]; |