Windows で楽に Linux 開発環境を手に入れる手順 後編
前編 ( http://d.hatena.ne.jp/janus_wel/20090130/1233304154 ) で Linux 環境が整ったはずなのでここからは普通に Ubuntu で開発環境を整える。作業はほとんど一般 user で行うんだけど apt-get は root じゃないといけないのでそこだけ root に。 sudo とか設定増えるし permission の概念意味なくなるしでキライなので install してないよ !!
まず何はなくとも screen 。 .screenrc の bind 設定は vim 風適当。
- apt-get install screen
- vim ~/.screenrc<\kbd>
autodetach on bell_msg "^G" defkanji utf-8 defencoding utf-8 encoding utf-8 utf-8 defscrollback 10000 escape ^Jj startup_message off vbell off caption always "%{= wb} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wk} [%l] %{=b wb}%y/%m/%d(%D) %{=b wm}%c" bind n screen bind h prev bind l next bind b windowlist
これで screen が使えるようになったので一般 user と root それぞれで入っておく。
- screen
- screen -t root
- su -
これで apt-get するときにいちいち root にならなくて済む。 screen 切り替えは上の設定だと <C-j>h / <C-j>l もしくは <C-j>b から選ぶ感じで。ここから本格的に開発に使う software を install 。っても最小限だけど。
- make
- apt-get install make
- subversion
- apt-get install subversion
- git 基本設定
- apt-get install git-core gitk
- git config --global user.name "username"
- git config --global user.email "username@example.com"
- git で Gmail 使って patch 投げる設定
- apt-get install git-email msmtp ca-certificates
- vim ~/.msmtprc
- 以下を copy して from, user, password を書き換える。
# Example for a user configuration file # Set default values for all following accounts. defaults tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile ~/.msmtp.log # My email service account gmail host smtp.gmail.com port 587 from some.user.name@gmail.com auth on user some.user.name@gmail.com password my-secret # Set a default account account default : gmail
これで ( 特定言語に特化してない ) 開発環境が整った。あとは自前で好きな package 放り込むのもよし、提供されてないなら deb package 作って install するもよし。てかここまで楽に環境構築できるので使い捨てと割り切って source から install してしまったほうが早いかもしれない。
以下参考 URL 。
- http://d.hatena.ne.jp/wadap/20080114/1200288402
- http://github.com/guides/tell-git-your-user-name-and-email-address
- http://git.or.cz/gitwiki/GitTips#head-a015948617d9becbdc9836776f96ad244ba87cb8
- http://github.com/guides/providing-your-ssh-key#linux
- http://github.com/guides/how-to-not-have-to-type-your-password-for-every-push