Mac安装brew时遇到的问题

问题1:

curl Failed to connect to raw.githubusercontent.com port 443

本人在安装brew时遇到上述问题,找了一个晚上的原因,终于找到了解决放方法:

输入指令sudo gem install redis,再输入安装brew指令即可。

问题2:

下载速度慢 超时
一、获取 install 文件,把官网给的脚本拿下来

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

二、更改脚本中的资源链接
这里替换成清华大学的镜像,修改如下两句:

vi brew_install

BREW_REPO = “https://github.com/Homebrew/brew“.freeze
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze
更改为这两句
BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freeze
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze
也可以换成别家的。
三、运行脚本

/usr/bin/ruby brew_install

问题3:

brew cask安装失败
fatal: unable to access 'https://github.com/Homebrew/homebrew-cask/': Failed to connect to github.com port 443: Operation timed out

clone其它镜像地址

git clone http://mirrors.ustc.edu.cn/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --depth=1

修改远程仓库

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/
git remote set-url origin http://mirrors.ustc.edu.cn/homebrew-cask.git

mac ssh密钥登录服务器

文中只讲述了本地ssh的登录配置,密钥生成及服务端配置未描述

1、配置config文件:

编辑文件:

vi ~/.ssh/config
Host  myserver(ssh登陆名)
HostName 127.1.1.1(服务器ip)
Port 22
User root(用户名)
IdentitiesOnly yes
IdentityFile 此处填私钥文件绝对路径

保存退出

2、登录:

终端直接输入,即可快速登录服务器

ssh myserver