Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

初始化 Ubuntu 开发环境 #19

Open
eyasliu opened this issue Mar 31, 2017 · 0 comments
Open

初始化 Ubuntu 开发环境 #19

eyasliu opened this issue Mar 31, 2017 · 0 comments

Comments

@eyasliu
Copy link
Owner

eyasliu commented Mar 31, 2017

启动一台新的虚拟机时,需要做一些配置

安装必须软件

基础包

sudo apt install -yq wget curl zsh git git-gui make gcc g++

Oh My Zsh

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

nvm and node

执行前先设置下方的环境变量

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | zsh
nvm i 7
nvm alias default 7

sublime text

pkg=sublime.deb && wget -O $pkg https://download.sublimetext.com/sublime-text_build-3126_amd64.deb && sudo dpkg -i $pkg && rm -f $pkg

docker

curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
# docker 源换成aliyun, xxxxxxx 请换成自己的加速器
sudo echo "{\"registry-mirrors\": [\"https://xxxxxxxx.mirror.aliyuncs.com\"]" | sudo tee -a /etc/default/docker && sudo service docker restart

一些CDN

设置源

npm and yarn

npm config set registry "https://registry.npm.taobao.org" # 给npm设置淘宝源
yarn config set registry "https://registry.npm.taobao.org" # 给 yarn 设置淘宝源

ubuntu, 其实 cn.archive.ubuntu.com 也是 阿里云的镜像,所以如果本身就是 cn 源就不需要修改

  deb http://mirrors.aliyun.com/ubuntu/ natty main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ natty-security main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ natty-updates main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ natty-proposed main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ natty-backports main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ natty main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ natty-security main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ natty-updates main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ natty-proposed main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ natty-backports main restricted universe multiverse

环境变量

# nvm
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs

#phantomjs
export PHANTOMJS_CDNURL=https://npm.taobao.org/dist/phantomjs

# electron
export ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/

# node-sass
export SASS_BINARY_SITE=http://npm.taobao.org/mirrors/node-sass

# sqlite3
export SQLITE3_BINARY_SITE=http://npm.taobao.org/mirrors/sqlite3

# python
export PYTHON_MIRROR=http://npm.taobao.org/mirrors/python
@eyasliu eyasliu changed the title 初始化开发环境 初始化 Ubuntu 开发环境 Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant