🧬Home-brew 升级3.0

取消终端Rosetta🎁

  • 首相找到终端app –> 显示简介 –> 取消Rosetta

20210308134856914123.png

重新安装Home-brew 🎁

  • 重新启动终端app ->> 打开你的 Clash 复制终端 酸酸乳

    1
    2
    3
    4
    5
    6
    7
    8
    9
    export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
    # 卸载 homebrew
    /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@master/uninstall.sh)"
    # 你也可以选这强制删掉homebrew
    # which brew
    # cd
    # sudo rm-rf homebrew
    /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@master/install.sh)"
    # 重新安装后homebrew 在 /opt路径
  • 安装完成✅,提示加添环境变量

    1
    2
    3
    # /opt/homebrew/bin
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/`whoami`/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
  • 其实也可以到最底下按照添加环境变量的方式添加

测试Home-brew 🎁

  • 先测试一下

    1
    brew search git

    20210308135851035228.png

  • 好像并没有什么影响

安装常用工具 🎁

  • 注意添加环境变量
1
2
3
4
5
6
brew install zsh git wget
brew install nodejs npm
# 代码高亮
brew install zsh-syntax-highlighting zsh-autosuggestions
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

添加环境变量 🎁

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/opt/homebrew/share/zsh-syntax-highlighting/highlighters
# 上面那行建议添加到最顶部
export LANG=zh_CN.UTF-8
export LC_CTYPE="zh_CN.UTF-8"
# clash 可以使用这么命令,其他 酸酸乳 需要配置端口哦!
alias proxy="export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890"
alias unproxy="export https_proxy= http_proxy= all_proxy="
export PATH=$PATH:$xrtools/path
export PATH="/opt/homebrew/opt/ncurses/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/ncurses/lib"
export CPPFLAGS="-I/opt/homebrew/opt/ncurses/include"
export PATH="/opt/homebrew/opt/ncurses/bin:$PATH"
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
# export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"
export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"

自用环境变量

1
2
3
4
5
6
mkdir ~/.path
open ~/.path
chmod 755 -R ~/.path
# 你的用户名可用whoami获得
echo -e 'mypath=/Users/你的用户名/path'
echo -e 'export PATH=$PATH:$mypath' >> ~/.zshrc
  • 比如GitHub git 推送需要三步,而你只需要一步
1
2
3
vi $mypath/gits
git add . && git commit -m "`date +%Y-%m' '%d:%H` By `whoami`" && git push
chmod 755 $mypath/gits
  • 又或者你想测试自己的终端是否启用 酸酸乳

    1
    echo "curl cip.cc" > $mypath/testip

    20210308151041462934.png

    还是挺方便的哈,需要啥就添加啥,就是需要改权限,加入你要自己写的话,前面写打开方式和路径

    比如:python3 start.py $@ $@ 是将你运行这个命令时后面的内容传递进去作为参数执行

🧬 快捷命令

Open -a 介绍

大部分情况下open -a app 可以打开任意文件,没有权限的除外,有特殊空格除外

是在不行就open 那个目录在手动打开

Vscose 🎁

1
echo -e 'open -a Visual\ Studio\ Code $@' > $mypath/code
1
2
3
4
5
6
7
# 打开vscode预览版
# command + shift + p
# 键入 install 选择第一个
which code-insiders
cd xxxx/
mv code-insiders code
以后就可以直接用code 命令打开配置文件隐藏文件

20210308152209871993.png

Typora 🎁

1
2
echo -e 'open -a Typora $@
' > $mypath/typora

Sublime Text 🎁

1
2
echo -e 'open -a Sublime\ Text
' > $mypath/sublime

Caw 🎁

1
2
echo -e 'cat `which $@`
' > $mypath/caw

Viw 🎁

1
2
echo -e 'vim `which $@`
' > $mypath/viw
1
2
echo -e 'code `which $@`
' > $mypath/viw

cnpm 🎁

1
2
echo -e 'npm --registry https://registry.npm.taobao.org $@
' > $mypath/cnpm

🧬 Mac生产力

Alfred + 有道云 🎁

20210308160121281864.png

Jump Desktop 🎁

赶超 Mac Windows remote- desktop

现在Mac 电脑分辨率越来越大,基本很少1920*1080了

部分用户手中的服务器还是xp,远程连接可视度极小

但是这款工具算是目前用的比较顺手的一款!

NeatDownloadManager 下载器 🎁

Windows 和 Mac都兼容,且支持手动配置酸酸乳设置下载线程数量

还有最后一个就是

Reader 🎁

你么自己耍吧,我要忙一会

XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way