24
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MBP 構築

Last updated at Posted at 2012-12-26

システム設定

dock

  • サイズ 左から 50pxぐらい
  • 拡大 on
  • 拡大 右から100pxぐらい
  • 画面上の位置 左
  • dockを自動的に隠す/表示
  • Dockの待機時間ゼロにする
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock

mission control

ホットコーナー

左下のみ

  • スクリーンセイバーを開始する

ディスプレイ

  • メニューバーにディスプレイを表示

キーボード

キーボードショートカット

  • キーボードと文字入力
    • 次のウィンドウを操作対象にする alt + tab
  • フルキーボードアクセス すべてのコントロール

トラックパッド

  • タップでクリック on
  • 3本指のドラッグ on
  • 軌跡の速さ 右から2つめ
  • アプリケーションExpose on

Bluetooth

  • off

applications

download from web

other


development

font

xcode command line tools

xcode-select --install

iterm 2 setting

homebrew

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update

zsh

brew install zsh
sudo view /etc/shells
chsh

git

brew install git
brew install tig
git config --global alias.st "status -s -b"
git config --global alias.ll "log --graph --pretty --decorate"

dotfiles

mkdir -p repository/github.com/ppworks
cd repository/github.com/ppworks
git clone git@github.com:ppworks/dotfiles.git
cd ~
ln -nsf ~/repository/github.com/ppworks/dotfiles/bin bin
ln -nsf ~/repository/github.com/ppworks/dotfiles/.gitconfig .gitconfig
ln -nsf ~/repository/github.com/ppworks/dotfiles/.zshrc .zshrc
ln -nsf ~/repository/github.com/ppworks/dotfiles/.gemrc .gemrc
ln -nsf ~/repository/github.com/ppworks/dotfiles/.vim .vim
ln -nsf ~/repository/github.com/ppworks/dotfiles/.vimrc .vimrc
ln -nsf ~/repository/github.com/ppworks/dotfiles/.tmux.conf .tmux.conf
ln -nsf ~/repository/github.com/ppworks/dotfiles/.bundle ./.bundle

vim

sudo mv /usr/bin/vim /usr/bin/old_vim
sudo -s ln /usr/local/bin/vim /usr/bin/vim

vim plugins

curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
mkdir -p ~/.vim/bundle
git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

heroku

curl -L https://toolbelt.heroku.com/install.sh | sh

pow

if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then
  source "$rvm_path/scripts/rvm"
  source ".rvmrc"
fi

qt

brew install qt
```

## mysql

```
brew install mysql

```

```
Set up databases to run AS YOUR USER ACCOUNT with:
    unset TMPDIR
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
    mysql_install_db --help

and view the MySQL documentation:
  * http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
  * http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html

To run as, for instance, user "mysql", you may need to `sudo`:
    sudo mysql_install_db ...options...

Start mysqld manually with:
    mysql.server start

    Note: if this fails, you probably forgot to run the first two steps up above

A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
    mysql -uroot

To launch on startup:
* if this is your first install:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/Cellar/mysql/5.5.25/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

* if this is an upgrade and you already have the homebrew.mxcl.mysql.plist loaded:
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    cp /usr/local/Cellar/mysql/5.5.25/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

You may also need to edit the plist to use the correct "UserName".

==> Summary
/usr/local/Cellar/mysql/5.5.25: 6382 files, 222M, built in 4.3 minutes
```

## postgreSQL

```
brew install postgresql
```

```

```


```
initdb /usr/local/var/postgres

```

```
vim /usr/local/var/postgres/postgresql.conf
```

```
timezone = 'UTC'
```


## pwgen

パスワード生成

```
brew install pwgen
```

### usage

```
pwgen -s
```

## ios アプリ開発

### ライブラリ管理

```
gem install cocoapods
```


## tmux

```
brew install tmux
brew install reattach-to-user-namespace
```

## perl

```
curl -kL http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.20.0
perlbrew switch perl-5.20.0
perlbrew install-cpanm
cpanm App::Ack
cpanm Archer
```

## mongdb

```
brew install mongodb
```

```
sudo mkdir -p /data/db/
sudo chown `id -u` /data/db
```

```
mongod
```

## redis

```
brew install redis
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
```

## postfix

```
sudo /etc/postfix/sasl_passwd
```

```
[smtp.gmail.com]:587 <gmail account> <gmail pw>
```

```
sudo postmap /etc/postfix/sasl_passwd
```

```
sudo vim /etc/postfix/main.cf
```

```
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_use_tls = yes
```

```
sudo postconf -e tls_random_source=/dev/urandom
```

```
sudo touch /etc/postfix/submit.cred
```

```
sudo vim /etc/postfix/submit.cred
```

```
# この2行を追加
submitcred version 1
hostname|username|password
```

```
sudo chmod 600 /etc/postfix/submit.cred
```

```
sudo vim /etc/postfix/generic

```

```
# Translate my primary email address to the Gmail address
# This is ONLY for the outbound email, and does not apply to
# local email.
<yourusername>@<machinename>  <your gmail ID, e.g. user@gmail.com>
@<machinename>                <your gmail ID, e.g. user@gmail.com>
```

```
sudo postmap /etc/postfix/generic
```


```
sudo postfix start
```

```
sudo postfix stop
```


```
sudo mkdir -p /Library/Server/Mail/Data/spool
sudo chmod g-w /Library/Server/Mail/Data/mta
```

```
sudo mkdir /etc/postfix/certs/
cd /etc/postfix/certs/
```

## rename

```
brew install rename
```

### usage

* [ファイル名を一括でリネームする方法](http://d.hatena.ne.jp/kawa_xxx/20120527/1338136718)

## phantomjs

```
brew update
brew install phantomjs
```

## imagick

```
brew install imagemagick --with-libpng
```

## tmux

```
brew install reattach-to-user-namespace 
echo 'set-option -g default-command "reattach-to-user-namespace -l $SHELL"' >> ~/.tmux.conf"
```

## ag

```
brew install the_silver_searcher
```

## php

```
brew install php54
brew tap josegonzalez/homebrew-php
brew install josegonzalez/php/composer
```

## rbenv

```
brew install rbenv
brew install ruby-build

RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.1.2
rbenv global 2.1.2

rbenv exec gem install bundler
rbenv rehash
```

## polipo

```
brew install polipo
cp /usr/local/Cellar/polipo/1.1.1/homebrew.mxcl.polipo.plist  ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
```

```
sudo mkdir /etc/polipo
sudo vim /etc/polipo/config
```


```
proxyAddress = 127.0.0.1
proxyPort = 8123
dnsNameServer = 8.8.8.8, 8.8.4.4
dnsUseGethostbyname = false
dnsQueryIPv6 = false
allowedClients = 127.0.0.1
allowedPorts = 1-65535
cacheIsShared = false
chunkHighMark = 104857600
chunkCriticalMark = 83886080
chunkLowMark = 52428800
objectHighMark = 131072
publicObjectLowMark = 16384
maxDiskCacheEntrySize = 5000000000
disableIndexing = false
disableServersList = false
dontCacheRedirects = true
dnsMaxTimeout = 1s
dontCacheCookies = true
serverSlots = 256
serverSlots1 = 128
pipelineAdditionalRequests = true
```

```
launchctl list|grep polip|awk '{print $1}'|xargs kill
```

`ネットワーク -> プロキシ -> httpとhttpsに localhost 8123`と入れる


## vagrant

### virtual box
https://www.virtualbox.org/wiki/Downloads

### vagrant
http://downloads.vagrantup.com/

```
vagrant box add ubuntu-14.04 https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box
```

```
mkdir -p vagrant/rails
```

```
cd /usr/local/Library/Formula
git checkout 3c5ca25 /usr/local/Library/Formula/gecode.rb
brew install gecode
```

## idobata hook

```
git clone git@github.com:ppworks/idobata-hooks.git
brew install icu4c
brew install cmake
```
24
26
5

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
24
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?