# 工具推荐

# 日常使用

# Moom

一款专为Mac用户设计的一款实用的Mac窗口管理神器,让你可以使用鼠标或键盘来移动和缩放窗口,便捷又好用

# Alfred

Alfred是一个让你可以丢掉鼠标的神器。

# 升级macOS Monterey后,Alfred使用报Reason: launch path not accessible

# 问题原因

这个插件运行需要/usr/bin/php,但macOS Monterey删除了内置的php。

# 解决

Alfred最近发布了4.6更新,支持了Monterey的使用brew的php。

so... 使用brew安装php即可

brew install php

Windows的版本的话,也有类似的软件,叫WOX,具体教程可移步知乎 (opens new window)

# CleanMyMac X

最友好的 Mac 问题修复工具。删除系统垃圾、不想要的应用和恶意软件,让你的 Mac 恢复最快运行速度。

# 升级macOS Monterey后,CleanMyMac开始系统清理闪退

# 解决
  1. 进入软件后,不要先点,智能扫描!!!
  2. 然后打开【 左上角CleanMyMac X 偏好设置】,把 “为主要的CleanMyMac X 操作播放声音即可”前面的 √去掉即可。

# Bartender 4

一款强大的菜单栏管理工具,Bartender 4 mac激活版使你可以简单组织菜单栏图标,包括隐藏它们,重新排列它们,使用单击或键盘快捷键显示隐藏的项目以及在更新时显示图标。

# Typora

优雅的md文档编辑器

# Xnip

截屏工具,支持滚动截屏,自动边框修复等

# Airmail

是Mac平台上最好用的Mac邮件客户端,提供一致的体验,并提供快速,现代且易于使用的界面。空邮很干净,可以让你不间断地收到电子邮件。同时,可以轻松地将你的电子邮件转换为其他应用程序中的任务或备注,并在几秒钟内快速回复收到的消息。支持google邮箱。

# Geekbench 5

一款电脑跑分软件,是一个跨平台的基准测试软件。这款软件可以用来测试计算机的单核以及多核处理器的性能水平,计算出计算机的稳定性,帮助用户及时发现问题并处理

# 1 Password

1Password是管理网站登录和敏感信息的最好应用,它拥有友好的用户界面,可以在任何时刻在任何设备上使用,包括笔记本电脑、手机甚至智能手表Apple Watch上。当你使用苹果浏览器Safari和谷歌浏览器Chrome时,1Password将会生成安全密码,你可以将其填写到网站上登录。

# 开发相关

# Homebrew

Homebrew是什么?

当时拿到mac电脑的时候,找同事推荐软件,同事第一时间就推荐了这个。说的是,homebrew谁用谁知道。确实是,谁用谁知道。

下面我们来看官方的定义

Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。

# Homebrew的安装

  1. 打开终端(terminal)

  2. 安装命令:/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)", 按提示确认即可

     liuxiaoluxx ~ : /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
    
                  开始执行Brew自动安装程序
                 [cunkai.wang@foxmail.com]
               [2020-12-24 23:28:36][11.0]
           https://zhuanlan.zhihu.com/p/111014448
    
    
    请选择一个下载镜像,例如中科大,输入1回车。
    源有时候不稳定,如果git克隆报错重新运行脚本选择源。cask非必须,有部分人需要。
    1、中科大下载源 2、清华大学下载源 3、北京外国语大学下载源 4、腾讯下载源(不显示下载进度) 5、阿里巴巴下载源(缺少cask源)
    请输入序号: 1
    
      你选择了中国科学技术大学下载源
    
    !!!此脚本将要删除之前的brew(包括它下载的软件),请自行备份。
    ->是否现在开始执行脚本(N/Y)y
    
    --> 脚本开始执行
    ==> 通过命令删除之前的brew、创建一个新的Homebrew文件夹
    (设置开机密码:在左上角苹果图标->系统偏好设置->"用户与群组"->更改密码)
    (如果提示This incident will be reported. 在"用户与群组"中查看是否管理员)
    请输入开机密码,输入过程不显示,输入完后回车
    Password:
    
  3. 卸载命令:/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"

# Homebrew的使用

  • 查看Homebrew命令:brew help
  • 安装任意包:brew install <packageName>,eg:brew install node
  • 卸载任意包:brew uninstall <packageName>,eg:brew uninstall git
  • 查询可用包:brew search <packageName>
  • 查询已安装包列表:brew list
  • 查看任意包信息:brew info <packageName>
  • 更新Homebrew:brew update
  • Homebrew帮助信息:brew -h
  • 查看brew版本:brew -v
  • 更新brew版本:brew update
  • 整理重复语句:open ~/.zshrc -e、open ~/.bash_profile -e

# brew和brew cask的区别是什么

  • brew

    是从下载源码解压然后 ./configure && make install ,同时会包含相关依存库。并自动配置好各种环境变量,而且易于卸载。

  • brew cask

    是已经编译好了的应用包(.dmg/.pkg),仅仅是下载解压,放在统一的目录中(/opt/homebrew-cask/Caskroom),省掉了自己去下载、解压、拖拽(安装)等麻烦步骤,同样,卸载相当容易与干净。这个对一般用户来说会比较方便,包含很多在AppStore里没有的常用软件。

# Homebrew包推荐

  1. zsh: 称之为 shell 中的极品,具体请移步百度

    1. 安装
    brew install zsh
    
    2. 使用过程中如果出现以下报错信息
    [oh-my-zsh] For safety, we will not load completions from these directories until
    [oh-my-zsh] you fix their permissions and ownership and restart zsh.
    [oh-my-zsh] See the above list for directories with group or other writability.
    
    [oh-my-zsh] To fix your permissions you can do so by disabling
    [oh-my-zsh] the write permission of "group" and "others" and making sure that the
    [oh-my-zsh] owner of these directories is either root or your current user.
    [oh-my-zsh] The following command may help:
    [oh-my-zsh]     compaudit | xargs chmod g-w,o-w
    
    [oh-my-zsh] If the above didn't help or you want to skip the verification of
    [oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
    [oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
    
    3. 输入命令解决
    chmod 755 /usr/local/share/zsh && chmod 755 /usr/local/share/zsh/site-functions
    

    zsh自带插件列表 (opens new window)

  2. node@12(brew install node@12): nodejs版本12

  3. unzip(brew install unzip): 解压工具

  4. openssl@1.1(brew install openssl@1.1) : 一个开放源代码 (opens new window)软件 (opens new window) (opens new window)包,应用程序可以使用这个包来进行安全通信,避免窃听,同时确认另一端连接者的身份。这个包广泛被应用在互联网的网页服务器上。

  5. maven(brew install maven): 开发java的都知道

  6. telnet(brew install telnet): 端口测试工具

  7. python(brew install python): python开发环境

  8. zsh-syntax-highlighting: 主要作用时让你在使用 zsh 的时候,shell 命令可以高亮显示,便捷的知道你输入的命令是否正确

    1. 安装
    brew install zsh-syntax-highlighting
    2. 配置.zshrc文件,插入一行
    source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    3. 输入命令。
    source ~/.zshrc
    

# Homebrew下载慢解决方案

# 切换到 Homebrew 目录
cd "$(brew --repo)"
查看远程仓库 git remote -v.  默认的使用的github。
 删除远程: git remote rm origin 
添加阿里源 :git remote add origin https://mirrors.aliyun.com/homebrew/brew.git
切换成阿里源: git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
查看远程仓库 git remote -v.  默认的使用的github。
 删除远程: git remote rm origin 
添加阿里源 :git remote add origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
切换成阿里源: git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 替换 homebrew-bottles: 二进制文件
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
# 替换 homebrew-cask.git: cask 表示 GUI 应用的源, 阿里云没有提供 cask 源, 故使用 USTC 源
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote rm origin 
git remote add origin https://mirrors.ustc.edu.cn/homebrew-cask.git
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
Last Updated: 11/26/2021, 12:04:01 PM