分类 #开发资料 下的文章

记对 xonsh shell 的使用, 脚本编写, 迁移及调优

xonsh 是 python 驱动的 shell, 在操作效率, 交互和外部功能的先进性上比 bash 等优秀, 并且十分容易上手. 但相应地, 它是一个新兴的 shell, 并且不是所谓 “POSIX Shell”(尽管某些行为比较相似), 加上现有中文相关文章属实不深, 故自己做了一些较深的了解, 在此处记录心得, 若有错误请您指出, 不胜感谢.
xonsh 的提示符为 @, 因为它读作 “consh”, 脚本文件扩展名为 .xsh, 官方定义的 markdown 代码块标签也是 xsh
截至本文最后更新, xonsh 的最高版本是 0.22.8

[阅读全文]

把 https 风格的 git remote 替换为 ssh 风格

常用于懒得配置令牌但是有现成公钥配置的时候

1
bash -c 'git remote | while read r; do url=$(git remote get-url "$r"); new_url=$(echo "$url" | sed "s#https://#git@#; s#/#:#"); git remote set-url "$r" "$new_url"; done'

或者运行 (有网络连接且懒得写命令的情况下)

1
bash -c 'source <(curl -L sh.pluv27.top/sshize-git.sh)'

搞定 :)