Mac OS 安装环境配置
- homebrew (中间会要求安装git)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
- brew安装基础软件
brew install cmake go gopls ccls htop ranger fish ncdu python3 iterm2 wget nodejs fzf ctags docker the_silver_searcher yapf neofetch onefetch bat
brew install --cask --appdir=/Applications docker
- iterm2 完爆自带终端。必装
- 安装pip (2.7)
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py; python get-pip.py
- 修改代理/换源
#go
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
#git
git config --global http.proxy 'socks5://127.0.0.1:1086'; git config --global https.proxy 'socks5://127.0.0.1:1086'
#npm
npm config set registry https://registry.npm.taobao.org
#根据自己情况更新最新版本npm
npm install -g npm@7.8.0
#pip
mkdir ~/.pip
vi ~/.pip/pip.conf
#写入以下内容(中科大源)
[global]
index-url = https://pypi.mirrors.ustc.edu.cn/simple/
[install]
trusted-host = https://pypi.mirrors.ustc.edu.cn/
- 挂载远程文件系统
首先,我们需要创建一个本地目录来安装服务器的文件系统。
sudo mkdir /mnt/droplet <--replace "droplet" whatever you prefer
现在我们可以使用sshfs命令在本地挂载文件系统。如果您的VPS是使用密码登录创建的,则以下命令将执行此操作。在此步骤中,系统将要求您提供虚拟服务器的root密码。
sudo sshfs -o allow_other,defer_permissions root@xxx.xxx.xxx.xxx:/ /mnt/droplet
如果您的服务器配置为通过ssh密钥授权进行登录,则需要告诉sshfs命令使用您的公钥。系统会要求您输入在使用ssh-keygen创建密钥期间使用的密码。
sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa root@xxx.xxx.xxx.xxx:/ /mnt/droplet
现在,您可以使用服务器上的文件,就好像它是连接到本地计算机的物理设备一样。例如,如果移动到本地计算机上的/mnt /droplet目录,在本地创建文件,该文件将同步显示在虚拟服务器上。同样,您可以将文件复制到/mnt/droplet文件夹中,它们将在后台上传到您的服务器。
请务必注意,此过程仅为您的服务器提供临时挂载点。如果虚拟服务器或本地计算机已关闭或重新启动,则需要使用相同的过程再次挂载它。
卸载远程文件系统
当您不再需要安装点时,您只需使用该命令卸载它即可
sudo umount /mnt/droplet