手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表分类:苹果相关

[置顶] 解决蓝牙鼠标飘的问题

 之前写过一篇Mac蓝牙鼠标卡顿、飘的临时解决方案,但当时这种方法其实现在感觉一般其实还有一个简单粗暴的办法,打开活动监视器,搜索bluetoothd(其实只要搜索blu三个字母就出来了)。然后直接杀掉这个进程。

因为这个是系统服务,你杀完后他会自动重启,这时候晃晃鼠标什么的,就又会自动连上了。

卡顿的问题基本上确实就是:2.4G的wifi冲突,当然还有可能是某些中断导致。但一般重启一下bluetoothd服务就能解决90%以上的问题。

再不济,重启吧

[置顶] mac没有声音的处理

mac突然间就没有声音了。。。按照以往的办法,拿出耳机,插拔一下。。。结果 还是没有

最后没办法,从网上找了点资料,说是:
XML/HTML代码
  1. sudo killall coreaudiod  
然后就好了,不过有人说,这样也不一定有效,果然在知乎上有很多大神就说了不少方法,手法不同,各有千秋,我挑个最简单的出来:
XML/HTML代码
  1. 著作权归作者所有。  
  2. 商业转载请联系作者获得授权,非商业转载请注明出处。  
  3. 作者:周全  
  4. 链接:http://www.zhihu.com/question/21975970/answer/20769174  
  5. 来源:知乎  
  6.   
  7. 应该是系统问题 重启成本还是很高的 可以试着重载声音驱动

  8. sudo kextunload /System/Library/Extensions/AppleHDA.kext
  9. sudo kextload /System/Library/Extensions/AppleHDA.kext  
 
其他更多请查看上述的链接,或者打开这个网页:http://www.zhihu.com/question/21975970
 
 
 

苹果M1笔记本如何安装 Python2

为什么需要 python2,还不是因为 node_sass 需要用到它。没有它,npm installF 得了无法执行而直接报错。但苹果从 M1开始就不再默认带上 Python2,而是默认3.x(好象是3.9)。

那怎么办呢?
先安装个 pyenv,再用 pyenv 安装2.7
 
1、brew install pyenv
2、arch -x86_64 pyenv install 2.7.18
3、把路径加入到配置文件:export PATH="$(pyenv root)/shims:${PATH}"
 
Over。如果是非 M1的话,直接 pyenv install 2.7.18即可
 

Tunnel error on MacOS when installed as service

其实我一直在想,这个功能什么时候会被关掉。

 
开始:
用cloudflare tunnel的时候,从没想过会在macos上出问题,如果你直接cloudflared service install,不会运行,即使你sudo了也不会,因为这个运行的只是cloudflared,并不带任何参数。
需要在相应的plist下面加上<string>tunnel</string><string>run</string>才OK。
加之前需要先unload,然后再load。否则无效。
其他都与官方一致。
 
---
如果用sudo了。需要将~/.cloudflared/下的内容copy到/etc/cloudflared下面。如果不放心或者担心没权限,可以修改uuid.json,将路径改为/etc/cloudflared/。其他照旧
 
记得配合一下valet,因为valet tld之后,子域名的映射会比较方便。
而且valet也支持multi php version。
 
---EOF
 

git fetch --unshadow出现RPC failed

 远程操作家里的mac mini进行更新的时候,突然报错:

XML/HTML代码
  1. mini:Homebrew mini$ brew update  
  2. Warning: No available formula with the name "ca-certificates".  
  3. ==> Searching for similarly named formulae...  
  4. Error: No similarly named formulae found.  
  5. ==> Searching for a previously deleted formula (in the last month)...  
  6. Warning: homebrew/core is shallow clone. To get its complete history, run:  
  7.   git -C "$(brew --repo homebrew/core)" fetch --unshallow  
  8.   
  9. Error: No previously deleted formula found.  
  10. ==> Searching taps on GitHub...  
  11. Error: No formulae found in taps.  
  12. Error:  
  13.   homebrew-core is a shallow clone.  
  14. To `brew update`, first run:  
  15.   git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  
  16. This command may take a few minutes to run due to the large size of the repository.  
  17. This restriction has been made on GitHub's request because updating shallow  
  18. clones is an extremely expensive operation due to the tree layout and traffic of  
  19. Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you  
  20. automatically to avoid repeatedly performing an expensive unshallow operation in  
  21. CI systems (which should instead be fixed to not use shallow clones). Sorry for  
  22. the inconvenience!  
于是执行 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  ,然而执行下来还是:
XML/HTML代码
  1. error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out  
  2. fatal: the remote end hung up unexpectedly  
 
然后我就用打开git trace进行查看:
XML/HTML代码
  1. GIT_TRACE=2 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  
  2. 10:29:28.798061 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/bin/git  
  3. 10:29:28.798668 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/bin  
  4. 10:29:28.799328 git.c:418               trace: built-in: git fetch --unshallow  
  5. 10:29:28.801482 run-command.c:643       trace: run_command: GIT_DIR=.git git-remote-https origin https://mirrors.ustc.edu.cn/homebrew-core.git  
  6. 10:29:28.812513 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-https  
  7. 10:29:28.813122 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core  
  8. 10:29:28.929816 run-command.c:643       trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/  
  9. 10:29:28.935164 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git  
  10. 10:29:28.935863 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core  
  11. 10:29:28.936585 git.c:418               trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/  
  12. error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out  
  13. fatal: the remote end hung up unexpectedly  
这个。。--depth=2147483647,居然这么深?
查到了网上的方案,参考在这里:记录: homebrew-core is a shallow clone - 腾讯云开发者社区-腾讯云 (tencent.com),我按上面的操作,删除了homebrew-core,homebrew-cask,再进行upgrade,果然 正常了。
 
---
在非正常之前,做了不少操作,比如用官方的uninstall脚本清除了系统,然而也没有什么用。所幸,现在正常了。
 
 
Records:22312345678910»