<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="http://tomohiro.github.io/atom.xml" rel="self" type="application/atom+xml" /><link href="http://tomohiro.github.io/" rel="alternate" type="text/html" /><updated>2023-02-07T06:14:31+00:00</updated><id>http://tomohiro.github.io/atom.xml</id><title type="html">DEVELOPER IN THE SHELL</title><subtitle>Jekyll source for my personal web site</subtitle><author><name>Tomohiro TAIRA</name></author><entry><title type="html">『Serverspec』 読んだ</title><link href="http://tomohiro.github.io/posts/serverspec-book" rel="alternate" type="text/html" title="『Serverspec』 読んだ" /><published>2015-01-25T00:00:00+00:00</published><updated>2015-01-25T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/serverspec-book</id><content type="html" xml:base="http://tomohiro.github.io/posts/serverspec-book">&lt;p&gt;本書の著者である宮下剛輔(&lt;a href=&quot;https://github.com/mizzy&quot;&gt;@mizzy&lt;/a&gt;) さんから贈って頂きました。
ありがとうございます。&lt;/p&gt;

&lt;div class=&quot;amazlet-box&quot; style=&quot;margin-bottom:0px;&quot;&gt;&lt;div class=&quot;amazlet-image&quot; style=&quot;float:left;margin:0px 12px 1px 0px;&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873117097/tomohiro.t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/51P6qVOPALL._SL160_.jpg&quot; alt=&quot;Serverspec&quot; style=&quot;border: none;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-info&quot; style=&quot;line-height:120%; margin-bottom: 10px&quot;&gt;&lt;div class=&quot;amazlet-name&quot; style=&quot;margin-bottom:10px;line-height:120%&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873117097/tomohiro.t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;Serverspec&lt;/a&gt;&lt;div class=&quot;amazlet-powered-date&quot; style=&quot;font-size:80%;margin-top:5px;line-height:120%&quot;&gt;posted with &lt;a href=&quot;http://www.amazlet.com/&quot; title=&quot;amazlet&quot; target=&quot;_blank&quot;&gt;amazlet&lt;/a&gt; at 15.01.25&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-detail&quot;&gt;宮下 剛輔 &lt;br /&gt;オライリージャパン &lt;br /&gt;売り上げランキング: 5,011&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-sub-info&quot; style=&quot;float: left;&quot;&gt;&lt;div class=&quot;amazlet-link&quot; style=&quot;margin-top: 5px&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873117097/tomohiro.t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;Amazon.co.jpで詳細を見る&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-footer&quot; style=&quot;clear: left&quot;&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Serverspec は構文の簡易さと導入の敷居の低さにより，Ruby にそこまであかるくないエンジニアも利用しているケースも多々あると思うが，そういった人々は例えば &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spec_helper.rb&lt;/code&gt; を必要に応じてカスタマイズすることがスムーズにできないというところで歯がゆい思いをしていることだろう。&lt;/p&gt;

&lt;p&gt;本書では全体を通して内部の実装の細かいところの解説が充実しており，また第6章に関しては Pry を利用したトラブルシューティングなどの具体例があり，先述したような人たちが現場での Serverspec の使い方を一段上にできる非常に実用的な本になっている。&lt;/p&gt;

&lt;h3 id=&quot;力強いメッセージ&quot;&gt;力強いメッセージ&lt;/h3&gt;

&lt;p&gt;本書の中では第4章の「コントリビュートする際の心構え」が特に印象深い。GitHub などで公開されているプロジェクトの中にはコントリビューティング・ガイドラインが設けられているケースも少なくないが，そこに貢献したい人はどのような心構えでのぞめばいいのかまで教えてくれるのはほとんどないように思う。(それこそ初心者にとっては&lt;a href=&quot;http://dic.nicovideo.jp/a/%E5%8D%8A%E5%B9%B4rom&quot;&gt;半年ROMれ&lt;/a&gt;みたいな怖さを感じることもある)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;筆者は自分で使うためにServerspecを開発しているのであり、他人のために開発しているのではありません。同様に他の方も、Serverspecを拡張する場合は、自分のために拡張を行ってください。他人のためとか考える必要はありません。(p.116 - 4章 Serverspec 内部の詳細)&lt;/p&gt;

  &lt;p&gt;とはいえ、筆者はそれほど作法にはうるさくありませんので、お気軽にプルリクエストを送ってください。(p.116 - 4章 Serverspec 内部の詳細)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;私は Serverspec に対する過去の数少ないコントリビュート経験を思い出しながらこの部分を読んでいた。&lt;/p&gt;

&lt;p&gt;Serverspec は2013年3月24日に&lt;a href=&quot;http://mizzy.org/blog/2013/03/24/3/&quot;&gt;発表&lt;/a&gt;されたのだが，職場ですぐに評価を始めて，社内SNSの日記でふり返ったところ3月29日には本番環境に向けて Serverspec によるテストを実施していたらしい。
基本的にはサーバ仕様に関する手順書ベースのチェックシートから Serverspec のテストケースに変換していくのだが，まだ出た当初だということもあり完全に変換することができない状態であった。&lt;/p&gt;

&lt;p&gt;そのような状態であったので “テストを書く→機能が足りないことに気づく→Pull Request を送る→取り込んでリリースしてもらう→テストを書く…” といった流れで，sudo のパスワードを環境変数SUDO_PASSWORD で指定できる機能であるとか，標準出力の結果を正規表現でチェックするマッチャなどの Pull Request を取り込んでもらい，業務がスムーズに進んだ思い出がある。&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;筆者自身、他の OSS プロダクトにプルリクエストを送ることがあります。それに対して長い間何もレスポンスがなかったり、マージされてもなかなかリリースされなかったり、という状況は、プルリクエストを送る側としてはあまり好ましくはありません。プルリクエストを送ってくださる方の気持ちを考え、不便を強いないよう、できる限り早くマージしてリリースするよう努めています。 (p.13-14 - 1章 Servspec の紹介)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;こうした力強く，かつ温かみのあるメッセージが散りばめられており，貢献したいと考えている人を後押ししてくれるような解説が書かれているのは，作者本人による著書ならではだと感じるし，なにより Serverspec の発展を願うひとりのツール利用者としてもとても嬉しい。&lt;/p&gt;

&lt;h3 id=&quot;serverspec-snippets-in-atom&quot;&gt;Serverspec Snippets in Atom&lt;/h3&gt;

&lt;p&gt;ちなみに今回は，私が作成した Atom 向けのスニペットツール &lt;a href=&quot;https://atom.io/packages/serverspec-snippets&quot;&gt;serverspec-snippets&lt;/a&gt; が第5章「他ツールとの連携」(p.125-126) にて紹介されたということで本書を頂けることになりました。ありがとうございました。
そして Atom ユーザで Serverspec をご利用するエンジニアの方々にお使い頂けると嬉しいです。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://atom.io/packages/serverspec-snippets&quot;&gt;serverspec-snippets&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/Tomohiro/atom-serverspec-snippets&quot;&gt;Tomohiro/atom-serverspec-snippets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><summary type="html">本書の著者である宮下剛輔(@mizzy) さんから贈って頂きました。 ありがとうございます。</summary></entry><entry><title type="html">Ubuntu 12.04 に VirtualBox 4.2 をインストール</title><link href="http://tomohiro.github.io/posts/virutalbox-on-ubuntu12.04" rel="alternate" type="text/html" title="Ubuntu 12.04 に VirtualBox 4.2 をインストール" /><published>2013-02-05T00:00:00+00:00</published><updated>2013-02-05T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/virutalbox-on-ubuntu12.04</id><content type="html" xml:base="http://tomohiro.github.io/posts/virutalbox-on-ubuntu12.04">&lt;p&gt;以下の目的で VirtualBox 4.2 をインストールする必要があったので，手順を調査した。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Vagrant を使用するためには VirtualBox 4.2 が必要&lt;/li&gt;
  &lt;li&gt;Ubuntu 12.04 のソフトウェアセンターで提供されている VirtualBox ではバージョンが古い&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;結論: virtualbox.org のリポジトリを追加して，そこからインストールすれば良い。&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc &lt;span class=&quot;nt&quot;&gt;-O-&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-key add -
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'echo &quot;deb http://download.virtualbox.org/virtualbox/debian precise contrib&quot; &amp;gt;&amp;gt; /etc/apt/sources.list'&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;virtualbox-4.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Tomohiro TAIRA</name></author><summary type="html">以下の目的で VirtualBox 4.2 をインストールする必要があったので，手順を調査した。</summary></entry><entry><title type="html">Ubuntu 版 Pow として Hoof を導入した</title><link href="http://tomohiro.github.io/posts/hoof-on-ubuntu" rel="alternate" type="text/html" title="Ubuntu 版 Pow として Hoof を導入した" /><published>2013-01-30T00:00:00+00:00</published><updated>2013-01-30T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/hoof-on-ubuntu</id><content type="html" xml:base="http://tomohiro.github.io/posts/hoof-on-ubuntu">&lt;p&gt;Ubuntu でも Pow on OSX のように簡単に Rack アプリケーションにアクセスしたいので探したところ，Hoof という gem を発見したので早速導入してみた。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/pyromaniac/hoof&quot;&gt;pyromaniac/hoof · GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ubuntu のバージョンは 12.04 LTS を使用した。&lt;/p&gt;

&lt;h3 id=&quot;install&quot;&gt;Install&lt;/h3&gt;

&lt;p&gt;RubyGems として公開されているので &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem install hoof&lt;/code&gt; すれば良いらしいが，global な gem 環境を汚したくないので &lt;a href=&quot;https://github.com/Tomohiro/bundlizer&quot;&gt;bundlizer&lt;/a&gt; でインストールする。&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bundlizer &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;hoof
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hoof をネットワークの設定に追加して起動する&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hoof &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hoof start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsswtich.conf&lt;/code&gt; に &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hoof&lt;/code&gt; を追加&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vi /etc/nsswitch.conf
hosts:          files mdns4_minimal &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NOTFOUND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; dns mdns4 hoof
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rack アプリケーションを Hoof で動くようにする(Gemfile に unicorn が追加されるので bundle も実行)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /path/to/myapp/
$ hoof init
$ bundle
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hoof init&lt;/code&gt; すると Pow のように &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME/.hoof&lt;/code&gt; 以下にシンボリックリンクが作成される。&lt;/p&gt;

&lt;p&gt;ブラウザを再起動してアクセスして動作を確認&lt;/p&gt;

&lt;p&gt;http://myapp.dev&lt;/p&gt;

&lt;h3 id=&quot;その他&quot;&gt;その他&lt;/h3&gt;

&lt;p&gt;ヘルプを見る&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hoof &lt;span class=&quot;nb&quot;&gt;help
&lt;/span&gt;Tasks:
  hoof &lt;span class=&quot;nb&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;TASK]         &lt;span class=&quot;c&quot;&gt;# Describe available tasks or one specific task&lt;/span&gt;
  hoof init &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;NAME]         &lt;span class=&quot;c&quot;&gt;# Initializes hoof for app in current directory&lt;/span&gt;
  hoof &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;TARGET]    &lt;span class=&quot;c&quot;&gt;# Redirects http ports to hoof default ports with iptables&lt;/span&gt;
  hoof restart             &lt;span class=&quot;c&quot;&gt;# Restarts hoof daemon&lt;/span&gt;
  hoof start               &lt;span class=&quot;c&quot;&gt;# Starts hoof daemon&lt;/span&gt;
  hoof status              &lt;span class=&quot;c&quot;&gt;# Lists hoof applications&lt;/span&gt;
  hoof stop                &lt;span class=&quot;c&quot;&gt;# Stops hoof daemon&lt;/span&gt;
  hoof uninstall &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;TARGET]  &lt;span class=&quot;c&quot;&gt;# Destroys hoof iptables redirecting rules&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rack アプリの稼動状況を確認する&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hoof status
  3814  myapp                &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;running]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;あと，プロキシ環境下で動いている場合は &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.dev&lt;/code&gt; をプロキシを経由しないように設定に追加するのを忘れずに&lt;/p&gt;</content><author><name>Tomohiro TAIRA</name></author><summary type="html">Ubuntu でも Pow on OSX のように簡単に Rack アプリケーションにアクセスしたいので探したところ，Hoof という gem を発見したので早速導入してみた。</summary></entry><entry><title type="html">Installing Pow via Homebrew</title><link href="http://tomohiro.github.io/posts/installing-pow-via-homebrew" rel="alternate" type="text/html" title="Installing Pow via Homebrew" /><published>2011-09-20T00:00:00+00:00</published><updated>2011-09-20T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/installing-pow-via-homebrew</id><content type="html" xml:base="http://tomohiro.github.io/posts/installing-pow-via-homebrew">&lt;h3 id=&quot;uninstalling-pow-if-you-have-already-insatlled-pow&quot;&gt;Uninstalling Pow (If you have already insatlled Pow)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;curl get.pow.cx/uninstall.sh | sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;installing-pow-via-homebrew&quot;&gt;Installing Pow via Homebrew&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;pow
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pow &lt;span class=&quot;nt&quot;&gt;--install-system&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Sets up firewall rules to forward port 80 to Pow&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pow &lt;span class=&quot;nt&quot;&gt;--install-local&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Installs launchd agent to start on login&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;reference&quot;&gt;Reference&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://pow.cx/&quot;&gt;Pow: Zero-configuration Rack server for Mac OS X&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/mxcl/homebrew/blob/master/Library/Formula/pow.rb&quot;&gt;Library/Formula/pow.rb at master from mxcl/homebrew - GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Ruby" /><summary type="html">Uninstalling Pow (If you have already insatlled Pow)</summary></entry><entry><title type="html">OSX Lion に Emacs をインストール</title><link href="http://tomohiro.github.io/posts/installing-emacs-to-osx-lion" rel="alternate" type="text/html" title="OSX Lion に Emacs をインストール" /><published>2011-08-15T00:00:00+00:00</published><updated>2011-08-15T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/installing-emacs-to-osx-lion</id><content type="html" xml:base="http://tomohiro.github.io/posts/installing-emacs-to-osx-lion">&lt;p&gt;OSX Lion に Emacs をインストールした時のメモ&lt;/p&gt;

&lt;p&gt;Homebrew を使ってインストールするがデフォルトのレシピだとこけるので，野良レシピを使う必要がある．&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--lion&lt;/code&gt; オプションをつけると Lion のフルスクリーン機能が使えるようになる．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;https://raw.github.com/gist/1124161/6a265cd3b6b35b9dd550d26896063c3dfba6f4fa/emacs.rb &lt;span class=&quot;nt&quot;&gt;--cocoa&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--lion&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;reference&quot;&gt;Reference&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/1124161&quot;&gt;Homebrew Emacs 23.3a for OSX Lion with native full-screen, inline patch — Gist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Emacs" /><summary type="html">OSX Lion に Emacs をインストールした時のメモ</summary></entry><entry><title type="html">Debian の Apache2 でリバースプロキシを設定する</title><link href="http://tomohiro.github.io/posts/apache2-reverse-proxy-on-debian" rel="alternate" type="text/html" title="Debian の Apache2 でリバースプロキシを設定する" /><published>2011-05-16T00:00:00+00:00</published><updated>2011-05-16T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/apache2-reverse-proxy-on-debian</id><content type="html" xml:base="http://tomohiro.github.io/posts/apache2-reverse-proxy-on-debian">&lt;p&gt;CentOS 5.6 をネットワークインストールしようとしたところ，Debian のインストーラと違って，プロキシ超えが出来ないことがわかった．&lt;/p&gt;

&lt;p&gt;ローカルネットワークから見えるところにリバースプロキシを設定して，そこと通信するようにすれば良いらしい．&lt;/p&gt;

&lt;p&gt;今回は Debian Squeeze の Apache2 を利用した．&lt;/p&gt;

&lt;h3 id=&quot;リバースプロキシの設定&quot;&gt;リバースプロキシの設定&lt;/h3&gt;

&lt;h4 id=&quot;モジュールを有効にする&quot;&gt;モジュールを有効にする&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# a2enmod proxy&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# a2enmod proxy_http&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;centos-のミラーサイトを設定&quot;&gt;CentOS のミラーサイトを設定&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# vi /etc/apache2/httpd.conf&lt;/span&gt;
ProxyPass /Linux/centos http://ftp.riken.jp/Linux/centos
ProxyPassReverse /Linux/centos http://ftp.riken.jp/Linux/centos

ProxyRemote &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; http://proxy.example.com:8080&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;apache-を起動&quot;&gt;Apache を起動&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# /etc/init.d/apache2 start&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;centos-セットアップ時の設定&quot;&gt;CentOS セットアップ時の設定&lt;/h3&gt;

&lt;p&gt;以下，英語版でインストールしてる状況での説明．&lt;/p&gt;

&lt;p&gt;ネットワークインストールを設定すると，&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HTTP Setup&lt;/code&gt; という画面が出てくるので，下記のように入力して &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OK&lt;/code&gt; すれば，インストールが続けられる．&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;項目名&lt;/th&gt;
      &lt;th&gt;入力内容&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Web Site name&lt;/td&gt;
      &lt;td&gt;reverse-proxy.example.com&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CentOS directory&lt;/td&gt;
      &lt;td&gt;Linux/centos/5.6/os/i386&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://akitosblog.seesaa.net/article/159752158.html&quot;&gt;CentOS 5.5 x86-64 をネットワークインストール: Akito’s IT技術 メモ&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yakinikunotare.boo.jp/orebase/index.php?Apache%2F%A5%EA%A5%D0%A1%BC%A5%B9%A5%D7%A5%ED%A5%AD%A5%B7%A4%F2%BA%EE%A4%EB%A1%CADebian%20Etch%CA%D4%A1%CB&quot;&gt;Apache/リバースプロキシを作る（Debian Etch編） - 俺の基地&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Debian" /><category term="Apache" /><summary type="html">CentOS 5.6 をネットワークインストールしようとしたところ，Debian のインストーラと違って，プロキシ超えが出来ないことがわかった．</summary></entry><entry><title type="html">Windows でシンボリックリンクを作成する</title><link href="http://tomohiro.github.io/posts/windows-symlink" rel="alternate" type="text/html" title="Windows でシンボリックリンクを作成する" /><published>2011-05-02T00:00:00+00:00</published><updated>2011-05-02T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/windows-symlink</id><content type="html" xml:base="http://tomohiro.github.io/posts/windows-symlink">&lt;p&gt;Windows でシンボリックリンクを作成する方法をいつも忘れてしまうので，メモしておく．&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mklink&lt;/code&gt; コマンドを叩くとヘルプが見れるので，それ見ながらやる，っていうように覚えておけば良いかな．&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/tomohiro/5679095592/in/photostream&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5062/5679095592_8108387564.jpg&amp;quot;&quot; alt=&quot;mklink&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Windows" /><summary type="html">Windows でシンボリックリンクを作成する方法をいつも忘れてしまうので，メモしておく．</summary></entry><entry><title type="html">Snow Leopard で Node.js と express を動かす</title><link href="http://tomohiro.github.io/posts/nodejs-and-express" rel="alternate" type="text/html" title="Snow Leopard で Node.js と express を動かす" /><published>2011-04-30T00:00:00+00:00</published><updated>2011-04-30T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/nodejs-and-express</id><content type="html" xml:base="http://tomohiro.github.io/posts/nodejs-and-express">&lt;p&gt;Node.js で Web アプリ作ってみようかと思い立ったので，下記の環境を用意する．&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Node.js&lt;/li&gt;
  &lt;li&gt;npm - パッケージマネージャ&lt;/li&gt;
  &lt;li&gt;express - Web アプリケーションフレームワーク&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;nodejs-のインストール&quot;&gt;Node.js のインストール&lt;/h3&gt;

&lt;p&gt;brew を使って入れる．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;node
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Downloading http://nodejs.org/dist/node-v0.4.7.tar.gz
&lt;span class=&quot;c&quot;&gt;######################################################################## 100.0%&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; ./configure &lt;span class=&quot;nt&quot;&gt;--prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/Cellar/node/0.4.7
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Caveats
Please add /usr/local/lib/node to your NODE_PATH environment variable to have node libraries picked up.
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Summary
/usr/local/Cellar/node/0.4.7: 72 files, 7.5M, built &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;6.2 minutes&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;node のパスを環境変数に指定する．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vi .zshrc
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NODE_PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/lib/node&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;npm-のインストール&quot;&gt;npm のインストール&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;brew install npm&lt;/code&gt; とすると，別のコマンドを叩くように指示されるので，その通りに実行する．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;npm
Error: No available formula &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;npm
npm can be installed thusly by following the instructions at
  http://npmjs.org/

  To &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;it &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;one line, use this &lt;span class=&quot;nb&quot;&gt;command&lt;/span&gt;:
    curl http://npmjs.org/install.sh | sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;curl http://npmjs.org/install.sh | sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;express-のインストール&quot;&gt;express のインストール&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;npm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;express&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;プロジェクトを作る&quot;&gt;プロジェクトを作る&lt;/h3&gt;

&lt;p&gt;express コマンドでプロジェクトを自動生成することができる．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;express mynodeapp
   create : mynodeapp
   create : mynodeapp/app.js
   create : mynodeapp/public/stylesheets
   create : mynodeapp/public/stylesheets/style.css
   create : mynodeapp/public/javascripts
   create : mynodeapp/logs
   create : mynodeapp/pids
   create : mynodeapp/public/images
   create : mynodeapp/views
   create : mynodeapp/views/layout.jade
   create : mynodeapp/views/index.jade
   create : mynodeapp/test
   create : mynodeapp/test/app.test.js
   - make sure you have installed jade: &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;npm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;jade&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;npm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;jade&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;起動してみる&quot;&gt;起動してみる&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /mynodeapp
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;node app.js
Express server listening on port 3000&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/tomohiro/5670130178/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5108/5670130178_30d9c518fb.jpg&quot; alt=&quot;express - Tomohiro, TAIRA, on Flickr&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://nodejs.org/&quot;&gt;node.js&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://npmjs.org/&quot;&gt;npm - Node Package Manager&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://expressjs.com/guide.html#migration-guide&quot;&gt;Express - node web framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="JavaScript" /><category term="Node.js" /><summary type="html">Node.js で Web アプリ作ってみようかと思い立ったので，下記の環境を用意する．</summary></entry><entry><title type="html">Vundle で Vim プラグインを管理する</title><link href="http://tomohiro.github.io/posts/vundle" rel="alternate" type="text/html" title="Vundle で Vim プラグインを管理する" /><published>2011-04-29T00:00:00+00:00</published><updated>2011-04-29T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/vundle</id><content type="html" xml:base="http://tomohiro.github.io/posts/vundle">&lt;p&gt;今まで Vim のプラグイン管理には「pathogen」を使っていたが，
「Vundle」というよりスマートなプラグインを管理するものが登場したので乗り変えてみた．&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/gmarik/vundle&quot;&gt;gmarik/vundle - GitHub&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Vundle is a short cut for Vimbundle and is a Vim plugin manager.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;vundle-をインストール&quot;&gt;Vundle をインストール&lt;/h3&gt;

&lt;p&gt;Vundle をダウンロードして .vim 以下に配置する．
今回は Vundle を &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git submodule&lt;/code&gt; として扱う．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git submodule add https://github.com/gmarik/vundle.git .vim/vundle&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;次に Vundle を読み込むための設定を &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vimrc&lt;/code&gt; に書いておく．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;&lt;span class=&quot;k&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rtp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;+=~&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/.vim/&lt;/span&gt;vundle/
&lt;span class=&quot;k&quot;&gt;call&lt;/span&gt; vundle#rc&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;プラグインをインストールする&quot;&gt;プラグインをインストールする&lt;/h3&gt;

&lt;p&gt;Vundle でプラグインを有効にするためには，&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vimrc&lt;/code&gt; にプラグイン名を書いておかなければならない．&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;GitHub 上のプラグイン作者のリポジトリ: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;User/PluginName&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;GitHub の vim-scripts のリポジトリ: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PluginName&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;GitHub 以外のリポジトリ: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;'git://example.com/PluginName.git'&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;Bundle &lt;span class=&quot;s1&quot;&gt;'Shougo/neocomplcache'&lt;/span&gt;
Bundle &lt;span class=&quot;s1&quot;&gt;'Shougo/unite.vim'&lt;/span&gt;
Bundle &lt;span class=&quot;s1&quot;&gt;'gtags.vim'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;設定を書いた後，Vim を起動してコマンドモードで &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BundleInstall&lt;/code&gt; するとプラグインがインストールされる．&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;BundleInstall&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;プラグインをアップデートする&quot;&gt;プラグインをアップデートする&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BundleInstall&lt;/code&gt; に !(bang) をつけるとアップデートになる&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;BundleInstall&lt;span class=&quot;p&quot;&gt;!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://shu-cream.blogspot.com/2011/04/2011vimvundle.html&quot;&gt;blog.shu-cream.net: 2011年のVimプラグインの管理はVundleで&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/gmarik/vundle&quot;&gt;gmarik/vundle - GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;amazlet-box&quot; style=&quot;margin-bottom:0px;&quot;&gt;&lt;div class=&quot;amazlet-image&quot; style=&quot;float:left;margin:0px 12px 1px 0px;&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873110831/tomohiro-t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/419SM7TDHZL._SL160_.jpg&quot; alt=&quot;入門vi 第6版&quot; style=&quot;border: none;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-info&quot; style=&quot;line-height:120%; margin-bottom: 10px&quot;&gt;&lt;div class=&quot;amazlet-name&quot; style=&quot;margin-bottom:10px;line-height:120%&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873110831/tomohiro-t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;入門vi 第6版&lt;/a&gt;&lt;div class=&quot;amazlet-powered-date&quot; style=&quot;font-size:80%;margin-top:5px;line-height:120%&quot;&gt;posted with &lt;a href=&quot;http://www.amazlet.com/browse/ASIN/4873110831/tomohiro-t-22/ref=nosim/&quot; title=&quot;入門vi 第6版&quot; target=&quot;_blank&quot;&gt;amazlet&lt;/a&gt; at 11.04.29&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-detail&quot;&gt;リンダ ラム アーノルド ロビンス &lt;br /&gt;オライリー・ジャパン &lt;br /&gt;売り上げランキング: 14937&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-sub-info&quot; style=&quot;float: left;&quot;&gt;&lt;div class=&quot;amazlet-link&quot; style=&quot;margin-top: 5px&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/exec/obidos/ASIN/4873110831/tomohiro-t-22/ref=nosim/&quot; name=&quot;amazletlink&quot; target=&quot;_blank&quot;&gt;Amazon.co.jp で詳細を見る&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;amazlet-footer&quot; style=&quot;clear: left&quot;&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Vim" /><summary type="html">今まで Vim のプラグイン管理には「pathogen」を使っていたが， 「Vundle」というよりスマートなプラグインを管理するものが登場したので乗り変えてみた．</summary></entry><entry><title type="html">MacPorts から Homebrew へ移行</title><link href="http://tomohiro.github.io/posts/macports_to_homebrew" rel="alternate" type="text/html" title="MacPorts から Homebrew へ移行" /><published>2011-04-24T00:00:00+00:00</published><updated>2011-04-24T00:00:00+00:00</updated><id>http://tomohiro.github.io/posts/macports_to_homebrew</id><content type="html" xml:base="http://tomohiro.github.io/posts/macports_to_homebrew">&lt;p&gt;Mac 上で Unix ツールを管理するマネージャを MacPorts から Homebrew へ移行した．&lt;/p&gt;

&lt;p&gt;少ししか触っていないが，下記の点が非常に魅力的だと感じた．&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;MacPorts に比べて動作が軽快&lt;/li&gt;
  &lt;li&gt;レシピの自作が簡単 (Fomula という名前の Ruby スクリプト)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;macports-のアンインストール&quot;&gt;MacPorts のアンインストール&lt;/h3&gt;

&lt;h4 id=&quot;1-アンインストール&quot;&gt;1. アンインストール&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;port &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; uninstall installed
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /opt/local &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Applications/DarwinPorts &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Applications/MacPorts &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/LaunchDaemons/org.macports.&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/Receipts/DarwinPorts&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.pkg &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/Receipts/MacPorts&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.pkg &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/StartupItems/DarwinPortsStartup &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/Tcl/darwinports1.0 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    /Library/Tcl/macports1.0 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    ~/.macports&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;2-optlocal-へのパスを削除&quot;&gt;2. /opt/local/ へのパスを削除&lt;/h4&gt;

&lt;p&gt;環境変数 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$PATH&lt;/code&gt; に MacPorts のディレクトリを指定する設定があるので削除する&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vi ~/.profile&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;homebrew-をインストール&quot;&gt;Homebrew をインストール&lt;/h3&gt;

&lt;h4 id=&quot;1-homebrew-のインストール手順の指示に従い下記のディレクトリを削除&quot;&gt;1. Homebrew のインストール手順の指示に従い，下記のディレクトリを削除&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;We recommend you delete &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/include&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/lib&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; /usr/local/lib&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;2-インストールする&quot;&gt;2. インストールする&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ruby &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-fsSLk&lt;/span&gt; https://gist.github.com/raw/323731/install_homebrew.rb&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; This script will &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; The following directories will be made group writable:
/usr/local/.
/usr/local/bin
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; The following directories will have their group &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to staff:
/usr/local/.
/usr/local/bin

Press enter to &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; /usr/bin/sudo /bin/chmod g+w /usr/local/. /usr/local/bin
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; /usr/bin/sudo /usr/bin/chgrp staff /usr/local/. /usr/local/bin
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Downloading and Installing Homebrew...
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Installation successful!&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;3-バージョンを確認&quot;&gt;3. バージョンを確認&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rehash
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
0.8&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;4-zsh-で-brew-コマンドの補完をできるようにする&quot;&gt;4. Zsh で brew コマンドの補完をできるようにする&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vi .zshrc
&lt;span class=&quot;nv&quot;&gt;fpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.zsh/functions &lt;span class=&quot;nv&quot;&gt;$fpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo cp&lt;/span&gt; /usr/local/Library/Contributions/brew_zsh_completion.zsh /usr/local/share/zsh/functions/_brew&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://guide.macports.org/chunked/installing.macports.uninstalling.html&quot;&gt;2.5. Uninstall&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://mxcl.github.com/homebrew/&quot;&gt;Homebrew — MacPorts driving you to drink? Try Homebrew!&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/mxcl/homebrew/wiki/installation&quot;&gt;Installation - GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/mxcl/homebrew/wiki/the-brew-command&quot;&gt;The brew command - GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Tomohiro TAIRA</name></author><category term="Mac" /><category term="Homebrew" /><summary type="html">Mac 上で Unix ツールを管理するマネージャを MacPorts から Homebrew へ移行した．</summary></entry></feed>