Mac mini 开发环境配置记录
本文保存原工作环境的 Java 14、Go 1.14.2、Redis 4.0.10、MongoDB 4.2.8 及内部 Git、代理、DNS 配置,账号、路径和地址已替换为虚构示例。
mac mini 配置
环境变量
- /etc/profile
shell
$ cat profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
#export GOROOT=/usr/local/go
#export GOPATH=/Users/demo/go
#export PATH=$PATH:${GOPATH//://bin:}/bin
# java
export JAVA_HOME=/usr/local/java/jdk-14.0.2/Contents/Home
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATHredis 安装
- 解压:tar zxvf redis-4.0.10.tar.gz
- 移动到: mv redis-4.0.10 /usr/local/
- 切换到:cd /usr/local/redis-4.0.10/
- 编译测试 sudo make test
- 编译安装 sudo make install
- 脚本
需要在根目录下创建文件
shell
nohup redis-server &.zshrc
shell
source ~/.bash_profile
ZSH_THEME="amuse"
export ZSH="/Users/demo/.oh-my-zsh"
# ZSH_THEME="robbyrussell"
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# CASE_SENSITIVE="true"
# HYPHEN_INSENSITIVE="true"
# DISABLE_AUTO_UPDATE="true"
# DISABLE_UPDATE_PROMPT="true"
# export UPDATE_ZSH_DAYS=13
# DISABLE_MAGIC_FUNCTIONS=true
# DISABLE_LS_COLORS="true"
# DISABLE_AUTO_TITLE="true"
# ENABLE_CORRECTION="true"
# COMPLETION_WAITING_DOTS="true"
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# HIST_STAMPS="mm/dd/yyyy"
# ZSH_CUSTOM=/path/to/new-custom-folder
plugins=(
git
bundler
dotenv
osx
rake
rbenv
ruby
docker
golang
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# export ARCHFLAGS="-arch x86_64"
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH=/Users/demo/.tiup/bin:$PATH
export PATH=/Users/demo/.tiup/bin:$PATH
export PATH=/Users/demo/.tiup/bin:$PATH
export PATH=/Users/demo/.tiup/bin:$PATH.profile
shell
export PATH="$HOME/.cargo/bin:$PATH".bash_profile
shell
# golang
GOROOT=/usr/local/Cellar/go/1.14.2_1/libexec
export GOROOT
export GOPRIVATE=example.invalid
export GOPATH=/Users/demo/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN:$GOROOT/bin
export GO111MODULE=on
export GOPROXY=https://goproxy.io
export CGO_CXXFLAGS="--std=c++11"
export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.3.0_4/include"
export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.3.0_4/include/opencv4"
# export CGO_LDFLAGS="-I/usr/local/Cellar/opencv/4.3.0_4/include/opencv4 -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core"
# mysql
export PATH=$PATH:/usr/local/mysql/bin
export PATH=$PATH:/usr/local/mysql/support-files
# other
#chown -R $USER .
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
export PATH=/usr/local/mongod4.2.8/bin:$PATH
export PATH="$HOME/.cargo/bin:$PATH"
# dart_flutter
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/usr/local/dart/flutter/bin:$PATH
export DART_HOME=/usr/local/dart/dart-sdk/bin
export PATH="${DART_HOME}:${PATH}"
export JAVA_HOME=/usr/local/java/jdk-14.0.2/Contents/Home
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
proxy () {
export http_proxy="http://127.0.0.1:8080"
export https_proxy="http://127.0.0.1:8080"
echo "HTTP Proxy on"
}网络设置
text
IPv4:192.0.2.10(文档示例地址)
DNS:按授权网络配置填写代理
- 网页:127.0.0.1:8080
- socket:127.0.0.1:8080
- 忽略主机名(仅示例)
text
localhost、127.0.0.1、*.example.invalid继续阅读
- 命令与观察
- 命令与观察
- 命令与观察