macOS打开互联网下载的软件
$ sudo xattr -r -d com.apple.quarantine "PATH"
Golang代理配置
$ sudo xattr -r -d com.apple.quarantine "PATH"
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
npm淘宝镜像
$ npm config set registry https://registry.npmmirror.com
授权sh文件运行权限
$ chmod 777 xxx.sh
Linux中新建systemctl文件
$ sudo vim /etc/systemd/system/xxx.service
Linux中生效|启动|停止|状态systemctl文件
$ sudo systemctl enable|start|stop|status xxx.service
Linux解压缩
$ tar xvf FileName.tar
$ tar cvf FileName.tar DirName
$ gzip -d FileName.gz
$ gzip FileName
$ tar zxvf FileName.tar.gz
$ tar zcvf FileName.tar.gz DirName
Linux中安装Golang
因为使用apt-get
安装的Golang并不是最新版,所以可以使用以下方法手动安装~
1、下载
$ wget https://go.dev/dl/go1.xx.x.linux-amd64.tar.gz
2、解压到/usr/local
目录
$ tar -zxvf go1.xx.x.inux-amd64.tar.gz -C /usr/local
3、设置环境变量
使用vim打开.profile文件
$ sudo vim ~/.profile
在文件的最后添加一行
export PATH=$PATH:/usr/local/go/bin
4、生效环境变量
$ source ~/.profile
5、检查Golang版本
$ go version
Vim简单操作
u
撤销最近一次操作 U
撤销所有操作
v
选择文字 y
复制所选内容 p
粘贴剪切板内容
SSH配置文件目录与重启
/etc/ssh/sshd_config
$ /etc/init.d/ssh restart