-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.json
1 lines (1 loc) · 51.7 KB
/
index.json
1
[{"categories":["杂技浅尝"],"content":"We’ve created a script that will change any commits that previously had the old email address in its author or committer fields to use the correct name and email address. Note: Running this script rewrites history for all repository collaborators. After completing these steps, any person with forks or clones must fetch the rewritten history and rebase any local changes into the rewritten history. Before running this script, you’ll need: The old email address that appears in the author/committer fields that you want to change The correct name and email address that you would like such commits to be attributed to Open Terminal. Create a fresh, bare clone of your repository: git clone --bare https://github.com/user/repo.git cd repo.git Copy and paste the script, replacing the following variables based on the information you gathered: OLD_EMAIL CORRECT_NAME CORRECT_EMAIL #!/bin/sh git filter-branch --env-filter ' OLD_EMAIL=\"your-old-email@example.com\" CORRECT_NAME=\"Your Correct Name\" CORRECT_EMAIL=\"your-correct-email@example.com\" if [ \"$GIT_COMMITTER_EMAIL\" = \"$OLD_EMAIL\" ] then export GIT_COMMITTER_NAME=\"$CORRECT_NAME\" export GIT_COMMITTER_EMAIL=\"$CORRECT_EMAIL\" fi if [ \"$GIT_AUTHOR_EMAIL\" = \"$OLD_EMAIL\" ] then export GIT_AUTHOR_NAME=\"$CORRECT_NAME\" export GIT_AUTHOR_EMAIL=\"$CORRECT_EMAIL\" fi ' --tag-name-filter cat -- --branches --tags Press Enter to run the script. Review the new Git history for errors. Push the corrected history to GitHub: git push --force --tags origin 'refs/heads/*' Clean up the temporary clone: cd .. rm -rf repo.git ","date":"2022-05-08 18:00","objectID":"/posts/changing-the-git-history-of-your-repository-using-a-script/:0:0","series":null,"tags":null,"title":"Changing the Git history of your repository using a script","uri":"/posts/changing-the-git-history-of-your-repository-using-a-script/#"},{"categories":["杂技浅尝"],"content":" 现象近期遇到了一个非常诡异的事情,在MacOS上打的tar包,在linux上解压多出了一些 ._ 开头的隐藏文件。 ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:1:0","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#现象"},{"categories":["杂技浅尝"],"content":" 问题排查我们来看下这个目录的内容, 然后我们来打包这个目录并MacOS查看压缩包的内容: 接下来我们把这个文件上传到linux服务器上,再查看这个压缩包的内容: 此时发现多了一个隐藏文件,那么问题来了,为什么会多?有程序读取这个文件就会出现异常! ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:2:0","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#问题排查"},{"categories":["杂技浅尝"],"content":" 问题原因经过排查,发现 MacOS 上的tar,和linux的tar竟然不止同一个系列! MacOS是将tar命令link到bsdtar Linux是原生的GNU tar命令 发现了问题,就方便寻找解决方案。翻了翻bsdtar的文档(man手册也行) 手册中有非常明确的提示,这个是MacOS特有的,用于存储一些MacOS中文件特殊的属性。 ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:3:0","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#问题原因"},{"categories":["杂技浅尝"],"content":" 问题验证 查看文件的特殊属性? mac上使用gnu tar查看是否也会有隐藏文件? 如图所示,确实与描述一致,使用xattr看到了扩展属性,使用gun tar也看到了隐藏文件 ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:3:1","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#问题验证"},{"categories":["杂技浅尝"],"content":" 解决方案","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:4:0","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#解决方案"},{"categories":["杂技浅尝"],"content":" 方案一 使用COPYFILE_DISABLE=1参数 COPYFILE_DISABLE=1 tar -zcvf junit.tar.gz junit-4.13.jar ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:4:1","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#方案一-使用copyfile_disable1参数"},{"categories":["杂技浅尝"],"content":" 方案二 使用 –no-mac-metadata tar --no-mac-metadata -zcvf junit.tar.gz junit-4.13.jar ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:4:2","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#方案二-使用---no-mac-metadata"},{"categories":["杂技浅尝"],"content":" 方案三 使用gtar打包 通过homebrew安装guntar ( https://formulae.brew.sh/formula/gnu-tar ) 使用gtar进行打包 ","date":"2021-06-25 22:56","objectID":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/:4:3","series":null,"tags":null,"title":"Mac使用tar命令打包多出隐藏文件","uri":"/posts/mac%E4%BD%BF%E7%94%A8tar%E5%91%BD%E4%BB%A4%E6%89%93%E5%8C%85%E5%A4%9A%E5%87%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6/#方案三-使用gtar打包"},{"categories":["杂技浅尝"],"content":" 异常信息 Error: An exception occurred within a child process: NoMethodError: undefined method `path' for nil:NilClass Did you mean? paths ","date":"2020-11-17 12:48","objectID":"/posts/mac-os%E5%8D%87%E7%BA%A7bigsur%E5%90%8Ehomebrew%E5%BC%82%E5%B8%B8/:1:0","series":null,"tags":null,"title":"Mac OS升级BigSur后Homebrew异常","uri":"/posts/mac-os%E5%8D%87%E7%BA%A7bigsur%E5%90%8Ehomebrew%E5%BC%82%E5%B8%B8/#异常信息"},{"categories":["杂技浅尝"],"content":" 解决方案 sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install brew update-reset 参考文章:https://discourse.brew.sh/t/homebrew-installation-fail/7439 ","date":"2020-11-17 12:48","objectID":"/posts/mac-os%E5%8D%87%E7%BA%A7bigsur%E5%90%8Ehomebrew%E5%BC%82%E5%B8%B8/:2:0","series":null,"tags":null,"title":"Mac OS升级BigSur后Homebrew异常","uri":"/posts/mac-os%E5%8D%87%E7%BA%A7bigsur%E5%90%8Ehomebrew%E5%BC%82%E5%B8%B8/#解决方案"},{"categories":["杂技浅尝"],"content":" 写在前面archlinux安装搜狗输入法本不是新闻,AUR上早有大神打好了包,网上安装的文章也已经烂大街了。 这里主要为了解决从今年1月左右Archlinux安装出现 Couldn't determine full name for SGPYEUDC_1.TTF以及 org.gnome.settings-daemon.plugins.xsettings等问题。 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:1:0","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#写在前面"},{"categories":["杂技浅尝"],"content":" 前期准备安装小企鹅输入法 fcitx sudo pacman -S fcitx fcitx-configtool fcitx-im 配置好 ~/.xprofile 文件 export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=\"@im=fcitx\" 然后注销后重新登录,或者重启后重新登录。 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:2:0","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#前期准备"},{"categories":["杂技浅尝"],"content":" 安装搜狗输入法","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:0","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#安装搜狗输入法"},{"categories":["杂技浅尝"],"content":" 编写代码创建一个目录命名 fcitx-sogoupinyin mkdir ~/fcitx-sogoupinyin 首先搞一个名字叫 PKGBUILD 的文件放到刚才创建的目录里,内容如下 # Maintainer: Bian Jiaping \u003cssbianjp [AT] gmail.com\u003e # Contributor: Jove Yu \u003cyushijun110 [AT] gmail.com\u003e # Contributor: csslayer \u003cwengxt [AT] gmail.com\u003e # Contributor: Felix Yan \u003cfelixonmars [AT] gmail.com\u003e pkgname=fcitx-sogoupinyin pkgver=2.3.1.0112 _time=1571302197 pkgrel=1 pkgdesc=\"Sogou Pinyin for Linux\" arch=(\"x86_64\") url=\"https://pinyin.sogou.com/linux/\" license=(\"custom\") depends=(\"fcitx\" \"opencc\" \"libidn11\" \"lsb-release\" \"xorg-xprop\" \"qtwebkit\") source=(\"http://cdn2.ime.sogou.com/dl/index/${_time}/sogoupinyin_${pkgver}_amd64.deb\") sha256sums=(\"4e15aad4785b30f35a8d891de878abe8892ffaea1882f570fec74fd821d0c448\") package(){ cd ${srcdir} tar -xJvf data.tar.xz -C \"${pkgdir}\" mv \"$pkgdir\"/usr/lib/*-linux-gnu/fcitx \"$pkgdir\"/usr/lib/ rmdir \"$pkgdir\"/usr/lib/*-linux-gnu # 也可以直接把字体删掉,自己酌情处理 # rm -r \"$pkgdir\"/usr/share/fonts # Avoid warning \"No such key \"Gtk/IMModule\" in schema \"org.gnome.settings-daemon.plugins.xsettings\"\" sed -i \"s#Gtk/IMModule=fcitx#overrides={'Gtk/IMModule':\u003c'fcitx'\u003e}#\" \"$pkgdir\"/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override rm -r \"$pkgdir\"/usr/share/keyrings rm -r \"$pkgdir\"/etc/X11 } ### 编译打包 makepkg -f ### 消除异常 方案一:去除pacman后置检查安装前把hook移出去: mv /usr/share/libalpm/hooks/xorg-mkfontscale.hook /tmp 安装后把hook弄回来: mv /tmp/xorg-mkfontscale.hook /usr/share/libalpm/hooks/ 方案二:删除字体上面的 PKGBUILD 里面有两段注释,把#号去掉即可 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:1","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#编写代码"},{"categories":["杂技浅尝"],"content":" 编写代码创建一个目录命名 fcitx-sogoupinyin mkdir ~/fcitx-sogoupinyin 首先搞一个名字叫 PKGBUILD 的文件放到刚才创建的目录里,内容如下 # Maintainer: Bian Jiaping # Contributor: Jove Yu # Contributor: csslayer # Contributor: Felix Yan pkgname=fcitx-sogoupinyin pkgver=2.3.1.0112 _time=1571302197 pkgrel=1 pkgdesc=\"Sogou Pinyin for Linux\" arch=(\"x86_64\") url=\"https://pinyin.sogou.com/linux/\" license=(\"custom\") depends=(\"fcitx\" \"opencc\" \"libidn11\" \"lsb-release\" \"xorg-xprop\" \"qtwebkit\") source=(\"http://cdn2.ime.sogou.com/dl/index/${_time}/sogoupinyin_${pkgver}_amd64.deb\") sha256sums=(\"4e15aad4785b30f35a8d891de878abe8892ffaea1882f570fec74fd821d0c448\") package(){ cd ${srcdir} tar -xJvf data.tar.xz -C \"${pkgdir}\" mv \"$pkgdir\"/usr/lib/*-linux-gnu/fcitx \"$pkgdir\"/usr/lib/ rmdir \"$pkgdir\"/usr/lib/*-linux-gnu # 也可以直接把字体删掉,自己酌情处理 # rm -r \"$pkgdir\"/usr/share/fonts # Avoid warning \"No such key \"Gtk/IMModule\" in schema \"org.gnome.settings-daemon.plugins.xsettings\"\" sed -i \"s#Gtk/IMModule=fcitx#overrides={'Gtk/IMModule':\u003c'fcitx'\u003e}#\" \"$pkgdir\"/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override rm -r \"$pkgdir\"/usr/share/keyrings rm -r \"$pkgdir\"/etc/X11 } ### 编译打包 makepkg -f ### 消除异常 方案一:去除pacman后置检查安装前把hook移出去: mv /usr/share/libalpm/hooks/xorg-mkfontscale.hook /tmp 安装后把hook弄回来: mv /tmp/xorg-mkfontscale.hook /usr/share/libalpm/hooks/ 方案二:删除字体上面的 PKGBUILD 里面有两段注释,把#号去掉即可 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:1","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#方案一去除pacman后置检查"},{"categories":["杂技浅尝"],"content":" 编写代码创建一个目录命名 fcitx-sogoupinyin mkdir ~/fcitx-sogoupinyin 首先搞一个名字叫 PKGBUILD 的文件放到刚才创建的目录里,内容如下 # Maintainer: Bian Jiaping # Contributor: Jove Yu # Contributor: csslayer # Contributor: Felix Yan pkgname=fcitx-sogoupinyin pkgver=2.3.1.0112 _time=1571302197 pkgrel=1 pkgdesc=\"Sogou Pinyin for Linux\" arch=(\"x86_64\") url=\"https://pinyin.sogou.com/linux/\" license=(\"custom\") depends=(\"fcitx\" \"opencc\" \"libidn11\" \"lsb-release\" \"xorg-xprop\" \"qtwebkit\") source=(\"http://cdn2.ime.sogou.com/dl/index/${_time}/sogoupinyin_${pkgver}_amd64.deb\") sha256sums=(\"4e15aad4785b30f35a8d891de878abe8892ffaea1882f570fec74fd821d0c448\") package(){ cd ${srcdir} tar -xJvf data.tar.xz -C \"${pkgdir}\" mv \"$pkgdir\"/usr/lib/*-linux-gnu/fcitx \"$pkgdir\"/usr/lib/ rmdir \"$pkgdir\"/usr/lib/*-linux-gnu # 也可以直接把字体删掉,自己酌情处理 # rm -r \"$pkgdir\"/usr/share/fonts # Avoid warning \"No such key \"Gtk/IMModule\" in schema \"org.gnome.settings-daemon.plugins.xsettings\"\" sed -i \"s#Gtk/IMModule=fcitx#overrides={'Gtk/IMModule':\u003c'fcitx'\u003e}#\" \"$pkgdir\"/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override rm -r \"$pkgdir\"/usr/share/keyrings rm -r \"$pkgdir\"/etc/X11 } ### 编译打包 makepkg -f ### 消除异常 方案一:去除pacman后置检查安装前把hook移出去: mv /usr/share/libalpm/hooks/xorg-mkfontscale.hook /tmp 安装后把hook弄回来: mv /tmp/xorg-mkfontscale.hook /usr/share/libalpm/hooks/ 方案二:删除字体上面的 PKGBUILD 里面有两段注释,把#号去掉即可 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:1","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#方案二删除字体"},{"categories":["杂技浅尝"],"content":" 安装自编译包下面包名自己核对一下,这里直接贴我自己的了。 sudo pacman -U fcitx-sogoupinyin-2.3.1.0112-1-x86_64.pkg.tar.xz ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:2","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#安装自编译包"},{"categories":["杂技浅尝"],"content":" 安装完配置安装完了记得注销或者重启重新登录,打开 fcitx-configtool添加sogou pinyin。 切记!!! 搜狗输入法不要放在第一个,一定要在English下面,不然可能出现候选字乱码。玄学问题,我也不知道为啥。 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:3:3","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#安装完配置"},{"categories":["杂技浅尝"],"content":" 原理分析","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:4:0","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#原理分析"},{"categories":["杂技浅尝"],"content":" gnome问题这个应该是gnome升级导致不兼容,或者说原来AUR的作者写的就有问题,总之改改就好了。 ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:4:1","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#gnome问题"},{"categories":["杂技浅尝"],"content":" SGPYEUDC_1问题这个是搜狗输入法自己弄了一些生僻字库,以前版本的archlinux是不会出现啥问题的。 新版本的archlinux(大概是2020.1或者2020.3开始),官方弄了一个叫alpm-hook的东西,安装了fonts的相关包之后,里面带了一个xorg-mkfontscale.hook,里面是在做mkfontscale和mkfontdir操作,搜狗这字体又不是啥标准规范的字体,就报错啦,不过没啥影响。安装前可以把hook配置移出去,安装完了再弄回来,或者直接把搜狗的生僻字库删掉就好了。 我们打开看看到底是啥? 下面是配置文件: [shine@archlinux hooks]$ cat xorg-mkfontscale.hook [Trigger] Type = Path Operation = Install Operation = Upgrade Operation = Remove Target = usr/share/fonts/*/ Target = !usr/share/fonts/encodings/* [Action] Description = Updating X fontdir indices... When = PostTransaction Exec = /usr/share/libalpm/scripts/xorg-mkfontscale NeedsTargets 看看实际执行脚本: [shine@archlinux scripts]$ cat xorg-mkfontscale #!/bin/bash sort -r | while read -r d; do [[ -d $d ]] || continue mkfontscale \"$d\" mkfontdir \"$d\" find \"$d\"fonts.{scale,dir} -maxdepth 0 -size -3c -delete rmdir --ignore-fail-on-non-empty \"$d\" done ","date":"2020-06-22 00:03","objectID":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/:4:2","series":null,"tags":null,"title":"Archlinux安装搜狗输入法","uri":"/posts/archlinux%E5%AE%89%E8%A3%85%E6%90%9C%E7%8B%97%E8%BE%93%E5%85%A5%E6%B3%95/#sgpyeudc_1问题"},{"categories":null,"content":" TNT官方博客 TNT官方博客 Hedysx(90_) Hedysx(90_) 小马博客 小马博客 墨点白 不吃罐头的猫咪 ","date":"2020-06-22 00:03","objectID":"/friends/:0:0","series":null,"tags":null,"title":"友情链接","uri":"/friends/#"},{"categories":["杂技浅尝"],"content":"用过阿里云服务器(ECS、轻量应用服务器)的人应该都知道,阿里云提供的系统镜像里预装了它的各种监控服务。 这些监控服务的存在使得人们可以直接在控制台看到当前系统的状态,某种程度上来说确实方便了服务器的管理。但是对于我们这种“爱折腾党”,基本没有用到这些服务的时候,而且天天被这些监控盯着还总有种被偷窥的感觉。 所以在这里介绍一下怎么卸载阿里云服务器上的各种监控服务。 ","date":"2020-02-21 18:04","objectID":"/posts/uninstall-monitoring-services-on-alibaba-cloud/:0:0","series":null,"tags":null,"title":"彻底卸载阿里云服务器上的各种监控服务","uri":"/posts/uninstall-monitoring-services-on-alibaba-cloud/#"},{"categories":["杂技浅尝"],"content":" 卸载云盾(安骑士)在官方文档页面只介绍了怎么在控制台去卸载,手动卸载的操作步骤需要提交工单获取,不是很方便。 在这里介绍一种用脚本手动卸载的方法(其实用的也是官方提供的两个脚本),执行以下命令即可。 wget http://update.aegis.aliyun.com/download/uninstall.sh \u0026\u0026 chmod +x uninstall.sh \u0026\u0026./uninstall.sh wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh \u0026\u0026 chmod +x quartz_uninstall.sh \u0026\u0026 ./quartz_uninstall.sh 上面的脚本运行完之后可能还会有一些文件/文件夹残留,所以我们手动删除一下(如果提示文件不存在就不用管了) sudo rm -r /usr/local/aegis sudo rm /usr/sbin/aliyun-service sudo rm /lib/systemd/system/aliyun.service ","date":"2020-02-21 18:04","objectID":"/posts/uninstall-monitoring-services-on-alibaba-cloud/:1:0","series":null,"tags":null,"title":"彻底卸载阿里云服务器上的各种监控服务","uri":"/posts/uninstall-monitoring-services-on-alibaba-cloud/#卸载云盾安骑士"},{"categories":["杂技浅尝"],"content":" 卸载云监控(Cloudmonitor)云监控有 Java 版本和 Go 语言版本两种,可以根据其安装目录 /usr/local/cloudmonitor/ 下的文件名判断你的服务器上装的具体是哪一种。下面分别介绍两个版本的卸载方法。 ","date":"2020-02-21 18:04","objectID":"/posts/uninstall-monitoring-services-on-alibaba-cloud/:2:0","series":null,"tags":null,"title":"彻底卸载阿里云服务器上的各种监控服务","uri":"/posts/uninstall-monitoring-services-on-alibaba-cloud/#卸载云监控cloudmonitor"},{"categories":["杂技浅尝"],"content":" 卸载云监控 Java 版 # 停止 /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop # 卸载 /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove \u0026\u0026 \\ rm -rf /usr/local/cloudmonitor 附上官方文档页面链接:https://help.aliyun.com/knowledge_detail/38859.html ","date":"2020-02-21 18:04","objectID":"/posts/uninstall-monitoring-services-on-alibaba-cloud/:2:1","series":null,"tags":null,"title":"彻底卸载阿里云服务器上的各种监控服务","uri":"/posts/uninstall-monitoring-services-on-alibaba-cloud/#卸载云监控-java-版"},{"categories":["杂技浅尝"],"content":" 卸载云监控 Go 语言版云监控 Go 语言版的可执行文件名为 CmsGoAgent.linux-${ARCH} ,其中的 ARCH 根据 Linux 架构的不同,分为 amd64 和 386 ,可以在其安装目录 /usr/local/cloudmonitor/ 下找到具体的文件名。 为了方便表述,下面的命令中也使用 ${ARCH} 替代文件名中的系统架构部分。要能够直接复制下面的命令行去执行的话,可以先设置一下临时环境变量(相当于后面输入命令中的 ${ARCH} 会被自动替换成我们在这里设置的值) # 64 位系统 export ARCH=amd64 # 32 位系统 export ARCH=386 或者的话你也可以在找到具体的文件名后自行替换。下面是卸载相关的一些命令: # 从系统服务中移除 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall # 停止 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop # 卸载 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop \u0026\u0026 \\ /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall \u0026\u0026 \\ rm -rf /usr/local/cloudmonitor 附上官方文档页面链接:https://help.aliyun.com/document_detail/97929.html ","date":"2020-02-21 18:04","objectID":"/posts/uninstall-monitoring-services-on-alibaba-cloud/:2:2","series":null,"tags":null,"title":"彻底卸载阿里云服务器上的各种监控服务","uri":"/posts/uninstall-monitoring-services-on-alibaba-cloud/#卸载云监控-go-语言版"},{"categories":["杂技浅尝"],"content":" LinuxLinux系统直接用现成的工具,没有什么花头。推荐几个好用的工具: ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:0","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#linux"},{"categories":["杂技浅尝"],"content":" Etcher直接下载安装使用,UI操作就不详细介绍了 下载地址:https://www.balena.io/etcher/ ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:1","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#etcher"},{"categories":["杂技浅尝"],"content":" UNetbootin直接下载安装使用,UI操作就不详细介绍了 下载地址:https://unetbootin.github.io/ ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:2","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#unetbootin"},{"categories":["杂技浅尝"],"content":" dd命令 查U盘的标识 simon@antergone:~$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 250.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 216.1 GB disk1s1 2: APFS Volume Preboot 22.1 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_FAT_32 15.9 GB disk2s4 卸载U盘挂载 simon@antergone:~$diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful 写入镜像 simon@antergone:~$sudo dd if=/Users/simon/CentOS-7-x86_64-DVD-1908.iso of=/dev/disk2 bs=1m Password: 输入密码 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:3","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#dd命令"},{"categories":["杂技浅尝"],"content":" dd命令 查U盘的标识 simon@antergone:~$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 250.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 216.1 GB disk1s1 2: APFS Volume Preboot 22.1 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_FAT_32 15.9 GB disk2s4 卸载U盘挂载 simon@antergone:~$diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful 写入镜像 simon@antergone:~$sudo dd if=/Users/simon/CentOS-7-x86_64-DVD-1908.iso of=/dev/disk2 bs=1m Password: 输入密码 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:3","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#查u盘的标识"},{"categories":["杂技浅尝"],"content":" dd命令 查U盘的标识 simon@antergone:~$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 250.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 216.1 GB disk1s1 2: APFS Volume Preboot 22.1 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_FAT_32 15.9 GB disk2s4 卸载U盘挂载 simon@antergone:~$diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful 写入镜像 simon@antergone:~$sudo dd if=/Users/simon/CentOS-7-x86_64-DVD-1908.iso of=/dev/disk2 bs=1m Password: 输入密码 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:3","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#卸载u盘挂载"},{"categories":["杂技浅尝"],"content":" dd命令 查U盘的标识 simon@antergone:~$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 250.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 216.1 GB disk1s1 2: APFS Volume Preboot 22.1 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_FAT_32 15.9 GB disk2s4 卸载U盘挂载 simon@antergone:~$diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful 写入镜像 simon@antergone:~$sudo dd if=/Users/simon/CentOS-7-x86_64-DVD-1908.iso of=/dev/disk2 bs=1m Password: 输入密码 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:1:3","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#写入镜像"},{"categories":["杂技浅尝"],"content":" Windows","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:0","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#windows"},{"categories":["杂技浅尝"],"content":" 查U盘的标识 simon@antergone:~$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 250.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 216.1 GB disk1s1 2: APFS Volume Preboot 22.1 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_FAT_32 15.9 GB disk2s4 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:1","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#查u盘的标识-1"},{"categories":["杂技浅尝"],"content":" 重命名、格式化U盘 simon@antergone:~$diskutil eraseDisk MS-DOS \"BOOTDISK\" MBR disk2 Tips: 注意这里的disk2,是上一步查询出来的,可能因个人而异 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:2","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#重命名格式化u盘"},{"categories":["杂技浅尝"],"content":" 挂载iso文件 hdiutil attach /Users/simon/Windows.iso ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:3","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#挂载iso文件"},{"categories":["杂技浅尝"],"content":" 写入U盘 cp -rp /Volumes/Windows-xxxxx/* /Volumes/BOOTDISK/ Tips: 注意这里 Windows-xxxx 是具体挂载的名字,别忘了后面有个通配* ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:4","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#写入u盘"},{"categories":["杂技浅尝"],"content":" 写在最后这里我不建议大家直接写入Windows镜像,可以尝试写入PE系统的镜像,维护起来更方便。在这里也推荐一个我用了8年左右的Windows PE工具: 杏雨梨云启动维护系统。平时可以用Windows系统导出iso版本的PE系统镜像,将上面的Windows.iso换成他导出的镜像写入U盘即可。 ","date":"2020-02-09 06:39","objectID":"/posts/make-a-usb-boot-disk-in-mac-os/:2:5","series":null,"tags":null,"title":"MacOS下制作启动盘","uri":"/posts/make-a-usb-boot-disk-in-mac-os/#写在最后"},{"categories":["杂技浅尝"],"content":" 背景现象这里就不再多说了,国行的iPhone只能使用FaceTime Video,无法使用FaceTime Audio。通俗的来说,就是国内买的iPhone,FaceTime只能发视频接视频,不允许发语音接语音。 具体原因我也不知道是什么,我也没有精力去深究,毕竟目标是解决问题。不要尝试跟Apple客服和运营商沟通,两边疯狂踢皮球甩锅。 ","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:1:0","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#背景现象"},{"categories":["杂技浅尝"],"content":" 解决目标 可以接听他人发起的FaceTime Audio 可以主动向他人发起FaceTime Audio 对方是FaceTime Audio可用的iPhone设备(美版,港版等),可接听 对方是国行iPhone设备,用下面的方法破解启用FaceTime Audio,可接听 对方是iPad用户(我只有wifi版本,其他版本不知道),可接听 如果对方是国行,未越狱或未破解,无法接听。 ","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:2:0","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#解决目标"},{"categories":["杂技浅尝"],"content":" 解决方案","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:3:0","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#解决方案"},{"categories":["杂技浅尝"],"content":" 必要条件Jailbreak, 也就是越狱。因为我手贱刷到了iOS13,所以用的是checkra1n( https://checkra.in/ ),具体操作步骤官网写的很清楚。 这里要提醒一下大家:这个方案越狱后重启是要重新越狱的。 ","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:3:1","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#必要条件"},{"categories":["杂技浅尝"],"content":" 不完美的轻量级解决方案(只能接听)之前国内的一个大佬 songchenwen 出过一个插件叫做FaceTime Audio Enabler。Bigboss源里面已经收录了他的这个插件,直接安装即可,iOS 13亲测可接听。具体的安装步骤移步他的博客链接。 本来我想基于他的这个解决方案来适配iOS 12以后的版本,但是尝试了很多方法都没有完美解决接听和拨打,只实现了接听,最终以失败而告终。在这期间感谢 songchenwen 给的帮助和支持。 如果有人对这个方案有兴趣,可以继续研究,Github仓库地址 ,如果可以成功解决拨打问题,可以往他的仓库提PR。由于Theos升级,他的源码现在已经无法在最新版本的Theos上编译,我已经将代码适配到了Theos最新版本,也适配了接听功能,但是拨打功能还是没有实现。 在这里,我想提一句百度上能搜到的资料,基本上都是出自于他的和这个方案。所谓的补两个文件,只是把他打的包里面的两个核心文件提取出来,复制到手机里面罢了。 ","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:3:2","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#不完美的轻量级解决方案只能接听"},{"categories":["杂技浅尝"],"content":" 完美解决方案安装插件Globalize, 一定要注意版本 \u003e=0.2.5 安装步骤: 在Cydia内添加软件源:https://parrotgeek.com/repo 搜索并安装Globalize,安装0.2.5版本。 安装完成后,用ssh连接手机,执行 ldrestart 命令 你也可以直接下载 deb包 ,手动安装。安装完成后,用ssh连接手机,执行 ldrestart 命令 对该解决方案想详细了解原理的,可以直接去 Github仓库 探究。 方案出处:https://www.reddit.com/r/jailbreak/comments/du5b9q/request_facetime_audio_for_chinese_iphone_models/ ","date":"2020-01-22 15:35","objectID":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/:3:3","series":null,"tags":null,"title":"国行iPhone用户如何使用FaceTime Audio","uri":"/posts/%E5%9B%BD%E8%A1%8Ciphone%E7%94%A8%E6%88%B7%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8facetime-audio/#完美解决方案"},{"categories":["杂技浅尝"],"content":" Formula 索引 (brew update)","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:1:0","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#formula-索引-brew-update"},{"categories":["杂技浅尝"],"content":" 替换为国内镜像仓库 git -C \"$(brew --repo)\" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git git -C \"$(brew --repo homebrew/core)\" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git git -C \"$(brew --repo homebrew/cask)\" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git brew update ","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:1:1","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#替换为国内镜像仓库"},{"categories":["杂技浅尝"],"content":" 还原官方仓库 git -C \"$(brew --repo)\" remote set-url origin https://github.com/Homebrew/brew.git git -C \"$(brew --repo homebrew/core)\" remote set-url origin https://github.com/Homebrew/homebrew-core.git git -C \"$(brew --repo homebrew/cask)\" remote set-url origin https://github.com/Homebrew/homebrew-cask.git brew update ","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:1:2","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#还原官方仓库"},{"categories":["杂技浅尝"],"content":" Bottles (二进制预编译包)","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:2:0","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#bottles-二进制预编译包"},{"categories":["杂技浅尝"],"content":" 临时替换 export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles ","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:2:1","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#临时替换"},{"categories":["杂技浅尝"],"content":" 长期替换 echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' \u003e\u003e ~/.bash_profile source ~/.bash_profile ","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:2:2","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#长期替换"},{"categories":["杂技浅尝"],"content":" 复原如果是 临时替换 重新打开终端即可。 如果是 长期替换 删掉环境变量里面的定义,重新打开终端即可。 ","date":"2020-01-16 14:58","objectID":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/:2:3","series":null,"tags":null,"title":"替换及重置Homebrew默认源","uri":"/posts/%E6%9B%BF%E6%8D%A2%E5%8F%8A%E9%87%8D%E7%BD%AEhomebrew%E9%BB%98%E8%AE%A4%E6%BA%90/#复原"},{"categories":["杂技浅尝"],"content":"Docker默认使用的网桥 docker0 的网段是 172.17.0.1,正好和公司网络冲突。 网上的资料也一如既往的狗血,在这里记录下自己的配置。 以下步骤自测过得版本: 1.12.x, 1.13.1 其他版本,如果有需要可以自行测试,应该差不太多。 ","date":"2017-08-24 01:16","objectID":"/posts/how-to-change-the-docker-default-subnet-ip-address/:0:0","series":null,"tags":null,"title":"修改Docker0的IP地址","uri":"/posts/how-to-change-the-docker-default-subnet-ip-address/#"},{"categories":["杂技浅尝"],"content":" 第一步 删除原有配置 sudo service docker stop sudo ip link set dev docker0 down sudo brctl delbr docker0 sudo iptables -t nat -F POSTROUTING ","date":"2017-08-24 01:16","objectID":"/posts/how-to-change-the-docker-default-subnet-ip-address/:1:0","series":null,"tags":null,"title":"修改Docker0的IP地址","uri":"/posts/how-to-change-the-docker-default-subnet-ip-address/#第一步-删除原有配置"},{"categories":["杂技浅尝"],"content":" 第二步 创建新的网桥 sudo brctl addbr docker0 sudo ip addr add 192.168.200.1/24 dev docker0 sudo ip link set dev docker0 up ","date":"2017-08-24 01:16","objectID":"/posts/how-to-change-the-docker-default-subnet-ip-address/:2:0","series":null,"tags":null,"title":"修改Docker0的IP地址","uri":"/posts/how-to-change-the-docker-default-subnet-ip-address/#第二步-创建新的网桥"},{"categories":["杂技浅尝"],"content":" 第三步 配置Docker的文件注意: 这里是 增加下面的配置 vi /etc/docker/daemon.json { ... \"bip\": \"192.168.200.1/24\", ... } docker的配置现在都是用daemon.json了,不需要去设置DOCKER_OPTS, 所以网络上很多的资料早已 过时。 ","date":"2017-08-24 01:16","objectID":"/posts/how-to-change-the-docker-default-subnet-ip-address/:3:0","series":null,"tags":null,"title":"修改Docker0的IP地址","uri":"/posts/how-to-change-the-docker-default-subnet-ip-address/#第三步-配置docker的文件"},{"categories":["杂技浅尝"],"content":" 第四步 重启主机 sudo reboot ","date":"2017-08-24 01:16","objectID":"/posts/how-to-change-the-docker-default-subnet-ip-address/:4:0","series":null,"tags":null,"title":"修改Docker0的IP地址","uri":"/posts/how-to-change-the-docker-default-subnet-ip-address/#第四步-重启主机"},{"categories":["杂技浅尝"],"content":" 前因前些天因为工作需要在阿里云弄了一批VPC机器,刚开始是每个人都给了账号密码让其登录控制,又因为各种问题,收回了权限。 为了控制登录权限,所以启动了跳板机 ( http://www.jumpserver.org/ ) 后来又一个开发开始质疑,VPC其他的机器你可以防火墙禁止外界登录,那你跳板机最该要开一个ssh吧?如果这个机器的账号密码被知道了,那不是GG了 好吧,我就想到了这个坑办法。OTP,一次性密码~ 目的让登录的时不仅需要linux的账号密码,还需要一个动态的口令。 ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:1:0","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#前因"},{"categories":["杂技浅尝"],"content":" 操作","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:2:0","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#操作"},{"categories":["杂技浅尝"],"content":" 手机软件下载 Google Authenticator iOS 下载地址 Android 下载地址 ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:2:1","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#手机软件下载"},{"categories":["杂技浅尝"],"content":" 服务器安装chrony安装这个的原因是因为Google的OTP算法其中有一个因素是时间,因此我们一定要保证时间的正确性 [root@localhost ~]# yum install -y chrony [root@localhost ~]# vim /etc/chrony.conf server 0.cn.pool.ntp.org server 1.cn.pool.ntp.org server 2.cn.pool.ntp.org server 3.cn.pool.ntp.org [root@localhost ~]# systemctl restart chronyd [root@localhost ~]# chronyc sources ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:2:2","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#服务器安装chrony"},{"categories":["杂技浅尝"],"content":" 服务器安装Google Authenticator [root@localhost ~]# yum install -y git automake libtool pam-devel [root@localhost ~]# git clone https://github.com/google/google-authenticator-libpam.git [root@localhost ~]# cd google-authenticator-libpam/ [root@localhost google-authenticator-libpam]# ./bootstrap.sh [root@localhost google-authenticator-libpam]# ./configure [root@localhost google-authenticator-libpam]# make \u0026\u0026 make install [root@localhost google-authenticator-libpam]# google-authenticator [root@localhost google-authenticator-libpam]# cd ~ # 修改配置文件 [root@localhost ~]# vim /etc/pam.d/sshd auth required pam_google_authenticator.so no_increment_hotp [root@localhost ~]# vim /etc/ssh/sshd_config asswordAuthentication yes ChallengeResponseAuthentication yes UsePAM yes # 重启ssh服务 [root@localhost ~]# systemctl restart sshd # 生成令牌 [root@localhost ~]# google-authenticator Do you want authentication tokens to be time-based (y/n) y #你想做的认证令牌是基于时间的吗? Warning: pasting the following URL into your browser exposes the OTP secret to Google: https://www.google.com/chart?chs=200x200\u0026chld=M|0\u0026cht=qr\u0026chl=otpauth://totp/root@localhost.localdomain%3Fsecret%3DN4HLEJOQHT27VCR6RX66WXB2SY%26issuer%3Dlocalhost.localdomain [这里会有一个很大的二维码] Your new secret key is: N4HLEJOQHT27VCR6RX66WXB2SY #这个key就是加密串,如果你有多个设备,需要把这个保存下,方便以后添加认证设备 Your verification code is 299695 #输入手机上Google Authenticator的code Your emergency scratch codes are: #下面这些key是紧急安全码,假如你的手机丢了,紧急登录用的。 44477086 92790948 29251218 26350870 30696065 Do you want me to update your \"/root/.google_authenticator\" file? (y/n) y #你希望我更新你的“/root/.google_authenticator”文件吗(y/n)? Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y #你希望禁止多次使用同一个验证令牌吗?这限制你每次登录的时间大约是30秒, 但是这加大了发现或甚至防止中间人攻击的可能性(y/n)? By default, a new token is generated every 30 seconds by the mobile app. In order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. This allows for a time skew of up to 30 seconds between authentication server and client. If you experience problems with poor time synchronization, you can increase the window from its default size of 3 permitted codes (one previous code, the current code, the next code) to 17 permitted codes (the 8 previous codes, the current code, and the 8 next codes). This will permit for a time skew of up to 4 minutes between client and server. Do you want to do so? (y/n) y #默认情况下,令牌保持30秒有效;为了补偿客户机与服务器之间可能存在的时滞, 我们允许在当前时间前后有一个额外令牌。如果你在时间同步方面遇到了问题, 可以增加窗口从默认的3个可通过验证码增加到17个可通过验证码, 这将允许客户机与服务器之间的时差增加到4分钟。你希望这么做吗(y/n)? If the computer that you are logging into is not hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting? (y/n) y #如果你登录的那台计算机没有经过固化,以防范运用蛮力的登录企图,可以对验证模块 启用尝试次数限制。默认情况下,这限制攻击者每30秒试图登录的次数只有3次。 你希望启用尝试次数限制吗(y/n)? ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:3:0","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#服务器安装google-authenticator"},{"categories":["杂技浅尝"],"content":" 登录验证注意,第一次登录可能会出现登录失败的情况,查看日志信息显示错误如下: [root@localhost ~]# tail -n10 /var/log/secure ... Dec 31 09:42:46 localhost sshd[2393]: PAM unable to dlopen(/usr/lib64/security/pam_google_authenticator.so): /usr/lib64/security/pam_google_authenticator.so: cannot open shared object file: No such file or directory Dec 31 09:42:46 localhost sshd[2393]: PAM adding faulty module: /usr/lib64/security/pam_google_authenticator.so ... [root@localhost ~]# ln -sv /usr/local/lib/security/pam_google_authenticator.so /usr/lib64/security/pam_google_authenticator.so \"/usr/lib64/security/pam_google_authenticator.so\" -\u003e \"/usr/local/lib/security/pam_google_authenticator.so\" ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:4:0","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#登录验证"},{"categories":["杂技浅尝"],"content":" 登录方法(SecureCRT)一定要将这个放在第一个! ","date":"2017-03-20 02:15","objectID":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/:4:1","series":null,"tags":null,"title":"Linux 利用Google Authenticator实现ssh登录双因素认证","uri":"/posts/linux-%E5%88%A9%E7%94%A8google-authenticator%E5%AE%9E%E7%8E%B0ssh%E7%99%BB%E5%BD%95%E5%8F%8C%E5%9B%A0%E7%B4%A0%E8%AE%A4%E8%AF%81/#登录方法securecrt"}]