Mac OS 安装环境配置

Mac OS 安装环境配置

  1. homebrew (中间会要求安装git)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  1. 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 完爆自带终端。必装
  1. 安装pip (2.7)
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py; python get-pip.py
  1. 修改代理/换源
#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/
  1. 挂载远程文件系统

首先,我们需要创建一个本地目录来安装服务器的文件系统。

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值