LoginSignup
9
13

More than 5 years have passed since last update.

MacBookPro Setupやっぱりクリーンインストールしたい

Last updated at Posted at 2017-01-21

新しいMacを買ったら、環境はコピーせずクリーンインストールしたい(なんとなく)
毎回同じことをするのでメモ
* ruby,node,pythonはanyenvでインストール
* tensorFlowはanacondaでインストール

0.設定前の設定(キー変更など)

メニュー > system preferences > Trackpad

カーソルは軽く早く!
* Click: Light
* Tracking Speed: fast
英かな切り替えをCommandボタンに割り当て
⌘英かな: https://ei-kana.appspot.com/
メニュー > system preferences > Keyboard
キーも軽く早く!
* KeyRepeat: Fast
* Delay Until Repeat: short
メニュー > system preferences > Keyboard > Modifier Keys
CtrlとCaps Lockを入れ替え

~/.bash_profileに追加(隠しファイルとTerminalの表示を変更)

defaults write com.apple.finder AppleShowAllFiles -boolean true # 隠しファイル表示
defaults write -g ApplePressAndHoldEnabled -bool false
alias ll='ls -Gla'
alias ls='ls -G'
export LSCOLORS=gxfxcxdxbxegedabagacad

Finder再起動
killall Finder

1.homebrew

http://brew.sh/index_ja.html
xcodeのCommand Line Toolsが自動インストールされる

2.anyenv

**env関連はanyenvでまとめる

git clone https://github.com/riywo/anyenv ~/.anyenv
echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
exec $SHELL -l

rbenv, pyenv, ndenv

anyenv install rbenv
anyenv install pyenv
anyenv install ndenv
exec $SHELL -l

ruby

Install可能なバージョン rbenv install -l
rbenv install 2.3.3
rbenv install 2.3.1 # 必要なら
rbenv global 2.3.3
rbenv local 2.3.1 # 必要なら
rbenv rehash
rbenv exec gem install bundler -v 1.13.6

node

Install可能なバージョン ndenv install -l
ndenv install v6.9.4
ndenv global v6.9.4
ndenv rehash

python

pythonはanacondaを使う
pyenv install anaconda3-4.2.0

やっぱりpython3も使う
pyenv install 3.5.3

pyenv global anaconda3-4.2.0
pyenv rehash

tensorFlowセットアップ

# condaで設定
# Python 3.5
$ conda create -n tensorflow python=3.5
## conda環境一覧
conda info -e
# conda environments:
#
tensorflow               /Users/k/.anyenv/envs/pyenv/versions/anaconda3-4.2.0/envs/tensorflow
root                  *  /Users/k/.anyenv/envs/pyenv/versions/anaconda3-4.2.0
# conda環境切り替え
# pyenvを使用しているためフルパスで指定
source  /Users/k/.anyenv/envs/pyenv/versions/anaconda3-4.2.0/envs/tensorflow/bin/activate tensorflow

# 環境を抜ける
source deactivate

4.mySQL

brew install mysql
mysql.server start
create user 'foo'@'localhost' identified by 'bar-password'

5.emacs

terminalの設定でoptionにmetaキーを割り当てる
terminal > Preferences > keyboard
'Use Option as Meta Key'をon
brew install emacs --with-cocoa --srgb
brew linkapps emacs
brew install the_silver_searcher
brew install cask
# 注:evilが使われています
git clone https://github.com/kanadai/emacs.d.git ~/.emacs.d
cd .emacs.d
cask

6.vim

git clone https://github.com/kanadai/dotfiles.git
ln -s dotfiles/.vimrc .vimrc

mkdir -p ~/.vim/bundle
# NeoBundleをリポジトリから取得
$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

その他アプリ

Sourcetree: https://ja.atlassian.com/software/sourcetree
SequelPro: https://sequelpro.com/
vscode: https://code.visualstudio.com/
googleDrive: https://www.google.com/intl/ja_ALL/drive/download/
dropbox: https://www.dropbox.com/ja/
liceCap: http://www.cockos.com/licecap/

mecab
brew install mecab
brew install mecab-ipadic

python web開発環境

pyenv-virtualenv
brew install pyenv-virtualenv
python -m venv 環境名

source myvirtualenv/foodtasker/bin/activate
pip install django==1.10
pip freeze

django-admin startproject name
python manage.py runserver

...etc.

9
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
13