<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Memorandum</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/" />
    <link rel="self" type="application/atom+xml" href="http://www.pistolfly.jp/weblog/atom.xml" />
    <id>tag:www.pistolfly.jp,2008-02-03:/weblog//1</id>
    <updated>2012-01-31T12:03:08Z</updated>
    <subtitle>個人的な技術メモ。</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 5.12</generator>

<entry>
    <title>[ruby on rails] Change PATH environment with Rails and Capistrano</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/change-path-environment-with-r.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1403</id>

    <published>2012-01-31T07:28:51Z</published>
    <updated>2012-01-31T12:03:08Z</updated>

    <summary>Capfileに load &apos;deploy/assets&apos; を追加すると、デプロ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="ruby on rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[Capfileに
<pre class="prettyprint">
load 'deploy/assets'
</pre>
を追加すると、デプロイ時にassets:precompileを実行できるが、assets:precompile実行時に、
<pre class="command-line">
/usr/bin/env:
ruby
: そのようなファイルやディレクトリはありません
</pre>
というエラーになってしまった。
ssh経由でのshellの実行時にPATHが通っていないのが原因と思われる。

<h3>解決方法</h3>

<p>
CapistranoでPATH等の環境変数を設定するには、:default_environmentを使う。
</p>

<pre class="prettyprint">	
set :default_environment, {
  'PATH' => "/opt/ruby-enterprise-1.8.7-2011.03/bin:$PATH"
}
</pre>

<p>
<br />
<a href="http://www.pastbedti.me/2011/06/change-path-environment-with-rails-and-capistrano/" target="_blank">Change PATH environment with Rails and Capistrano - pastbedti.me</a><br />
<a href="http://stackoverflow.com/questions/1978797/how-do-i-configure-capistrano-to-use-my-rvm-version-of-ruby" target="_blank">How do I configure capistrano to use my rvm version of Ruby - Stack Overflow</a>
</p>


プリコンパイルする場合、config/environments/production.rbで、
<pre class="prettyprint">
config.assets.compile = false
</pre>
にするが、assetsにapplication.js, application.css以外のjs、cssを使う場合は、以下のようにconfig.assets.precompileに追加する必要がある。追加しないと、smart_phone.css isn't precompiled のようなエラーになる。

<p>

</p>

config/environments/production.rb
<pre class="prettyprint">
config.assets.compile = false
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( smart_phone.css web_app_theme.css )
</pre>
]]>
        
    </content>
</entry>

<entry>
    <title>[ruby on rails] Rack Middleware</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/rack-middleware.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1394</id>

    <published>2012-01-24T05:00:52Z</published>
    <updated>2012-01-30T03:41:47Z</updated>

    <summary> #151 Rack Middleware - RailsCasts ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="ruby on rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://railscasts.com/episodes/151-rack-middleware?view=asciicast" target="_blank">#151 Rack Middleware - RailsCasts</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[apache] mod_proxyでバックエンドのサーバがダウンすると復旧しても 503 Service Temporarily Unavailable</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/mod-proxyservice-temporarily-u.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1389</id>

    <published>2012-01-18T06:58:31Z</published>
    <updated>2012-01-18T11:34:54Z</updated>

    <summary> mod_proxyでバックエンドのサーバがいったんダウンすると、復旧しても一定...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="apache" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
mod_proxyでバックエンドのサーバがいったんダウンすると、復旧しても一定時間（デフォルトでは60秒）は 503 Service Temporarily Unavailable になってしまう。
</p>

<p>
リトライするまでの時間は、ProxyPassディレクティブ の retry パラメータで指定することができる。<br />
（ProxyPass ディレクティブのスキームが balancer:// で始まる場合は、対応する &lt;Proxy&gt; セクション中の BalancerMember ディレクティブに retry パラメータを指定できる。）
</p>

<pre class="prettyprint">
ProxyPass / http://localhost:3000/ retry=5
ProxyPassReverse / http://localhost:3000/
</pre>

<pre class="prettyprint">ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
&lt;Proxy balancer://mycluster/&gt;
  BalancerMember http://localhost:9001 loadfactor=10 retry=5
  BalancerMember http://localhost:9002 loadfactor=10 retry=5
  BalancerMember http://localhost:9003 loadfactor=10 retry=5
&lt;/Proxy&gt;</pre>

<p>
<a href="http://httpd.apache.org/docs/2.1/ja/mod/mod_proxy.html" target="_blank">mod_proxy - Apache HTTP サーバ</a><br />
<a href="http://d.hatena.ne.jp/dayflower/20080215/1202974375" target="_blank">ProxyPass には retry=?? を指定しておく - daily dayflower</a><br />
<a href="http://d.hatena.ne.jp/yotena/20080216/1203130259" target="_blank">BalancerMemberにはretry=??を指定しておく - cys b</a><br />

</p>]]>
        
    </content>
</entry>

<entry>
    <title>[ruby on rails] Phusion Passenger &amp; running multiple Ruby versions</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/phusion-passenger-running-mult.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1384</id>

    <published>2012-01-14T06:08:51Z</published>
    <updated>2012-01-14T09:42:35Z</updated>

    <summary> Phusion Passenger &amp; running multiple Ru...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="ruby on rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/" target="_blank">Phusion Passenger & running multiple Ruby versions - Phusion Corporate Blog</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[ruby] CentOSにRVMをマルチユーザ用にインストール</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/centosrvm.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1383</id>

    <published>2012-01-14T03:27:00Z</published>
    <updated>2012-01-29T07:01:36Z</updated>

    <summary>マルチユーザ用にRVMをインストール マルチユーザ用にRVMをインストールするに...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="ruby" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<h3>マルチユーザ用にRVMをインストール</h3>

<p>
マルチユーザ用にRVMをインストールするには、sudo でインストールする。
</p>

<p>
<a href="https://rvm.beginrescueend.com/rvm/install/" target="_blank">RVM: Ruby Version Manager - Installing RVM</a>
</p>

<pre class="command-line">
$ sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
Downloading RVM from wayneeseguin branch stable

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). The default
 bundle is named curl-ca-bundle.crt; you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Could not download 'https://github.com/wayneeseguin/rvm/tarball/stable'.
  Make sure your certificates are up to date as described above.
  To continue in insecure mode run 'echo insecure >> ~/.curlrc'.
</pre>

<p>
curlのSSL証明書の検証でエラーになった。<br />
CA証明書が古いらしい。<br />
新しいCA証明書を取得する。
</p>

<h3>CA証明書のアップデート</h3>

<pre class="command-line">
$ sudo mv /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak # バックアップ
$ sudo curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
</pre>

<p>
<a href="http://d.hatena.ne.jp/kanonji/20111208/1323323155" target="_blank">curlでまたSSLのエラーが出たので対処 - kanonjiの日記</a><br />
<a href="http://curl.haxx.se/docs/sslcerts.html" target="_blank">cURL - Details on Server SSL Certificates</a><br />
<a href="http://curl.haxx.se/docs/caextract.html" target="_blank">cURL - Extract CA Certs from Mozilla</a>
</p>

<p>
再度sudoでRVMをインストール。
</p>

<pre class="command-line">
$ sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  796k  100  796k    0     0   170k      0  0:00:04  0:00:04 --:--:--  340k

Installing RVM to /usr/local/rvm/
installing - /usr/local/rvm/man/man1/rvm.1 -
installing - /usr/local/rvm/man/man1/rvm.1.gz -
    Creating RVM system user group 'rvm'

# RVM:  Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.beginrescueend.com/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Screencast: http://screencasts.org/episodes/how-to-use-rvm

# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'

Installation of RVM in /usr/local/rvm/ is complete.

# XXXXXXXXX,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne
</pre>

<p>
sudoでマルチユーザ用にインストールすると、RVMは /usr/local/rvm にインストールされる。
</p>

<h3>sudoを使うのは、RVM自体のインストール時のみ。</h3>

<p>
以降の操作は、sudoを使わない。rvm installやgem install など、/usr/local/rvm 下に書き込む操作は、rvmグループに所属しているユーザで行う。（/usr/local/rvmのグループがrvmになっている。）
</p>

<p>
<a href="https://rvm.beginrescueend.com/support/troubleshooting/#sudo" target="_blank">RVM: Ruby Version Manager - Troubleshooting RVM</a><br />
<a href="http://dragonstar.asablo.jp/blog/2011/10/05/6133307" target="_blank">RVM をマルチユーザー用にセットアップする: ひ日記</a>
</p>

<p>
ユーザのグループにrvmを追加。
</p>

<pre class="command-line"># usermod -a -G rvm &lt;ユーザ名&gt;</pre>

<p>
ユーザをrvmグループに追加したら、いったんログアウトしてから、rubyやgemをインストール。<br />
sudo しない。
</p>

<pre class="command-line">
$ rvm install 1.9.3
$ rvm use 1.9.3
$ gem install rails
</pre>

<p>
RVMのアップデートも、sudoを使わず、rvmsudoを使う。
</p>

<pre class="command-line">
$ rvmsudo rvm get latest
</pre>
]]>
        
    </content>
</entry>

<entry>
    <title>[subversion] Subversion1.5以降でのブランチとマージ</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/subversion15.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1378</id>

    <published>2012-01-02T06:05:32Z</published>
    <updated>2012-01-12T10:19:18Z</updated>

    <summary> Subversion 1.5 以降では、Merge Tracking 機能によ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="subversion" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
Subversion 1.5 以降では、Merge Tracking 機能により、マージが楽になった。<br />
フィーチャーブランチの典型的なマージ手順をメモしておく。
</p>

<p>
※以下の例で使用している、作業コピーのリポジトリーのルートディレクトリーのURLを表すキャレット (^) 記法は、Subversion 1.6 以降で可能です。
</p>

<h3>ブランチ作成</h3>

<pre class="command-line">$ cd &lt;いずれかの作業コピーのパス&gt; # キャレット記法を使うために作業コピーに移動。フルでURL指定するなら不要。
$ svn cp ^/trunk ^/branches/br1</pre>

<h3>ブランチとtrunkの差分表示</h3>

<pre class="command-line">$ cd &lt;いずれかの作業コピーのパス&gt; # キャレット記法を使うために作業コピーに移動。フルでURL指定するなら不要。
$ svn diff ^/trunk ^/branches/br1</pre>

<h3>trunkの最新をブランチにマージ</h3>

<p>
branchでの作業期間中、これを定期的に行う。
</p>

<pre class="command-line">$ cd &lt;ブランチの作業コピーのパス&gt;
$ svn up # 作業コピーを最新にしておく
$ svn st # 作業コピーがクリーンであることを確認しておく
$ svn merge ^/trunk # ブランチの作業コピーにtrunkの最新をマージ
$ svn commit</pre>

<h3>ブランチをtrunkにマージ</h3>

<p>
branchでの修正が完了したら、最後にbranchをtrunkにマージする。<br />
<strong>--reintegrate オプションが必要。</strong>
</p>

<pre class="command-line">$ cd &lt;trunkの作業コピーのパス&gt;
$ svn up # 作業コピーを最新にしておく
$ svn merge --reintegrate ^/branches/br1
$ svn commit</pre>

<p>
<strong>いったん --reintegrate でマージされたブランチはもう使えない。</strong>
</p>

いったん削除する必要がある。
<pre class="command-line">$ svn delete ^/branches/br1</pre>

ブランチでの作業を再開したい場合は、一度削除してから、ブランチを再作成する。
<pre class="command-line">$ svn cp ^/trunk ^/branches/br1</pre>


<h3>削除したブランチのログを見たい</h3>

<p>
ブランチを削除しても、全てのリビジョンは残っているので、レポジトリのルートURLやブランチのルートURLなどに対して svn log すればよい。
</p>

<pre class="command-line">$ cd &lt;いずれかの作業コピーのパス&gt; # キャレット記法を使うために作業コピーに移動。フルでURL指定するなら不要。
$ svn log ^/
$ svn log ^/branches</pre>

<p>
<br />
<a href="http://svnbook.red-bean.com/en/1.6/svn.branchmerge.basicmerging.html" target="_blank">Basic Merging</a><br />

</p>]]>
        
    </content>
</entry>

<entry>
    <title>[mysql] スロークエリログを取得する</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2012/01/post-139.html" />
    <id>tag:www.pistolfly.jp,2012:/weblog//1.1377</id>

    <published>2012-01-01T15:03:27Z</published>
    <updated>2012-01-02T14:12:59Z</updated>

    <summary>my.cnf [mysqld] # ログの出力先 log_slow_querie...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="mysql" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[my.cnf
<pre class="prettyprint">
[mysqld]
# ログの出力先
log_slow_queries = /var/log/mysql-slow.log
# これより実行に時間がかかる SQL ステートメントをロギング(秒)
long_query_time = 2
</pre>

<p>
空のログファイルを作成し、パーミッションを設定後、mysqldを再起動する。
</p>

<pre class="command-line">
# touch /var/log/mysql-slow.log
# chown mysql:mysql /var/log/mysql-slow.log
# /etc/init.d/mysqld restart
</pre>

<p>
ログをクリアする場合は、
</p>

<pre class="command-line">
# :> /var/log/mysql-slow.log
</pre>
]]>
        
    </content>
</entry>

<entry>
    <title>[mysql] クエリキャッシュ</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/mysql-query-cache.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1375</id>

    <published>2011-12-30T21:35:15Z</published>
    <updated>2012-01-10T03:56:00Z</updated>

    <summary>クエリキャッシュの設定 my.cnf [mysqld] query_cache_...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="mysql" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<h3>クエリキャッシュの設定</h3>

my.cnf
<pre class="prettyprint">
[mysqld]
query_cache_size=64M
query_cache_type=2
</pre>

<p>
query_cache_type には、以下のいずれかを指定できる。<br />
0: (OFF) キャッシュを行わない、または キャッシュした結果の読み出しを行わない。<br />
1: (ON) SELECT SQL_NO_CACHE で始まるステートメント以外のキャッシュ。<br />
2: (DEMAND) SELECT SQL_CACHE で始まるステートメントだけのキャッシュ。
</p>

<h3>クエリキャッシュのステータスを確認</h3>
<pre class="command-line">
mysql> show status like 'Qcache%';
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| Qcache_free_blocks      | 1        | 
| Qcache_free_memory      | 66674696 | 
| Qcache_hits             | 8        | 
| Qcache_inserts          | 41       | 
| Qcache_lowmem_prunes    | 0        | 
| Qcache_not_cached       | 1145     | 
| Qcache_queries_in_cache | 41       | 
| Qcache_total_blocks     | 88       | 
+-------------------------+----------+
8 rows in set (0.00 sec)
</pre>

<h3>クエリキャッシュのデフラグメント</h3>
<pre class="command-line">
mysql> FLUSH QUERY CACHE;
</pre>

<h3>クエリキャッシュからクエリ結果を削除</h3>
<pre class="command-line">
mysql> RESET QUERY CACHE;
</pre>

<p>
<br />
<a href="http://dev.mysql.com/doc/refman/5.1/ja/query-cache.html" target="_blank">MySQL :: MySQL 5.1 リファレンスマニュアル :: 4.13 MySQL クエリ キャッシュ</a><br />

</p>]]>
        
    </content>
</entry>

<entry>
    <title>[ruby on rails] Rails3のActionMailerでOpenSSL::SSL::SSLError (hostname was not match with the server certificate)</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/rails3actionmailer.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1371</id>

    <published>2011-12-29T09:09:38Z</published>
    <updated>2012-01-09T14:40:24Z</updated>

    <summary> Rails3でメールを送信したところ、送信できなかった。 ActionMail...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="mail" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="ruby on rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
Rails3でメールを送信したところ、送信できなかった。
</p>

<p>
ActionMailerの設定は、
</p>

config/initializers/02_action_mailer.rb
<pre class="prettyprint">
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
  :address        => "mail.example.com",
  :port           => "587",
  :domain         => "example.com",
  :user_name      => "username",
  :password       => "password",
  :authentication => :cram_md5
}
</pre>

<p>
のようにしている。<br />
同じ設定で、Rails2では送信できている。
</p>

<h3>原因</h3>

<pre class="prettyprint">
ActionMailer::Base.raise_delivery_errors = true
</pre>

<p>
を追加して実行したところ、
</p>

<pre class="command-line">
OpenSSL::SSL::SSLError (hostname was not match with the server certificate)
</pre>

<p>
となり、SSL証明書の検証で例外が発生しているらしいことが分かった。
</p>

また、メールサーバのログでも、
<pre class="command-line">
connect from xxxxx
setting up TLS connection from xxxxx
TLS connection established from xxxxx
lost connection after STARTTLS from xxxxx
disconnect from xxxxx
</pre>
という状態だった。

<p>
このメールサーバはテスト用のpostfixで、<br />
smtpd_tls_security_level = may<br />
にしており、<br />
smtpd_tls_cert_file、smtpd_tls_key_file には、自己証明書を設定していた。
</p>

<p>
Rails3では、STARTTLSがデフォルトで有効になっているためTLSで接続しようとするが、このメールサーバの証明書がテスト用の自己証明書だったので検証に失敗していたのが原因らしい。
</p>

<h3>解決方法</h3>

<p>
証明書を正当なものにすればよいと思われるが、テスト環境なのでとりあえず今は自己証明書を使いたい。<br />
そのためには、ActionMailer::Base.smtp_settingsの設定で、STARTTLSを無効にするか証明書の検証を無効にする。
</p>

<pre class="prettyprint">
ActionMailer::Base.smtp_settings = {
  :address        => "mail.example.com",
  :port           => "587",
  :domain         => "example.com",
  :user_name      => "username",
  :password       => "password",
  :authentication => :cram_md5,
  :enable_starttls_auto => true,  # STARTTLSを無効にする場合はfalseにする
  :openssl_verify_mode => 'none'  # STARTTLSを有効にしつつ、不正な証明書もOKにしたい場合は、証明書の検証を無効にする
}
</pre>

<p>
証明書の検証を無効にするのは本当はよくないけど、テスト環境等で自己証明書でもOKにしたい場合は、とりあえず上記のようにすれば、TLSでメールが送信できます。
</p>

<p>
<br />
<a href="http://davidroetzel.wordpress.com/2011/01/14/rails-3-actionmailer-tls-certificate-verification/" target="_blank">OpenWebOps</a>
</p>

<p>
<a href="http://stackoverflow.com/questions/5062615/postfix-rails-3-0-actionmailer-lost-connection-after-starttls" target="_blank">email - Postfix & Rails 3.0 ActionMailer: lost connection after STARTTLS - Stack Overflow</a><br />

</p>]]>
        
    </content>
</entry>

<entry>
    <title>[mac] MacのターミナルでのEmacsのメタキー</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/macterminalemacs.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1369</id>

    <published>2011-12-25T01:16:15Z</published>
    <updated>2011-12-25T02:29:12Z</updated>

    <summary> MacのターミナルでEmacsを使う場合に、デフォルトだとメタキーとしてエスケ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="emacs" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="mac" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
MacのターミナルでEmacsを使う場合に、デフォルトだとメタキーとしてエスケープキーしか使えないので不便だったが、ターミナルの環境設定→キーボードで、「メタキーとして option キーを使用」にチェックを入れると、optionキーをメタキーとして使用できた。
</p>

<p>
<a href="http://d.hatena.ne.jp/goinger/20090104/1231048095" target="_blank">[mac][emacs] Terminal上でemacsのメタキーを使う方法 - goinger的日記</a><br />

</p>]]>
        
    </content>
</entry>

<entry>
    <title>[その他] EXIFの仕様</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/exif.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1368</id>

    <published>2011-12-24T06:09:54Z</published>
    <updated>2011-12-24T06:11:19Z</updated>

    <summary> EXIF.org - EXIF and related resources -...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="その他" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://www.exif.org/specifications.html" target="_blank">EXIF.org - EXIF and related resources - Specificications</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[mail] SPFレコードチェックツール</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/spf.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1366</id>

    <published>2011-12-22T09:10:07Z</published>
    <updated>2011-12-23T07:25:08Z</updated>

    <summary> 間違いから学ぶSPFレコードの正しい書き方 : 迷惑メール対策委員会 ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="mail" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://salt.iajapan.org/wpmu/anti_spam/admin/operation/information/spf_i01/#30" target="_blank">間違いから学ぶSPFレコードの正しい書き方 : 迷惑メール対策委員会</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[network] サブドメインのmxレコード</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/mx.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1365</id>

    <published>2011-12-21T09:19:08Z</published>
    <updated>2011-12-24T11:40:11Z</updated>

    <summary> DNSのmxレコードでハマる。ValueDomain編 | clicktx::...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="network" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://perl.no-tubo.net/2011/01/31/dns%E3%81%AEmx%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%A7%E3%83%8F%E3%83%9E%E3%82%8B%E3%80%82valuedomain%E7%B7%A8/" target="_blank">DNSのmxレコードでハマる。ValueDomain編 | clicktx::Tech::Memo</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[mac] SmartGit での日本語の文字化け対処</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/smartgit.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1362</id>

    <published>2011-12-16T08:07:06Z</published>
    <updated>2011-12-24T11:42:03Z</updated>

    <summary> SmartGit での日本語の文字化け対処 - monaurallab (モノ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="git" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="mac" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
<a href="http://d.hatena.ne.jp/matsuoshi/20110914/1315975336" target="_blank">SmartGit での日本語の文字化け対処 - monaurallab (モノラルラボ)</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[linux] /etc/fstabの記述ミスで起動できなくなった場合</title>
    <link rel="alternate" type="text/html" href="http://www.pistolfly.jp/weblog/2011/12/etcfstabos.html" />
    <id>tag:www.pistolfly.jp,2011:/weblog//1.1358</id>

    <published>2011-12-08T12:05:29Z</published>
    <updated>2011-12-23T12:25:26Z</updated>

    <summary> fdiskでパーティションを削除した後、/etc/fstab に削除したパーテ...</summary>
    <author>
        <name>pistolfly</name>
        <uri>http://www.pistolfly.jp/</uri>
    </author>
    
        <category term="linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://www.pistolfly.jp/weblog/">
        <![CDATA[<p>
fdiskでパーティションを削除した後、/etc/fstab に削除したパーティションのエントリを残したままサーバを再起動したところ、起動時のファイルシステムチェックでエラーになり、起動しなくなってしまった。
</p>

<p>
その対処方法。
</p>

<ol class="list">
<li>エラー画面でrootパスワードを入力してメンテナンスモードに入る。</li>
<li>
/ が読み取り専用モードでマウントされているため、書き込み可能なようにマウントし直す。これをしないと、fstabを編集できない。
<pre class="command-line">
# mount -o remount,rw /
</pre>
</li>
<li>
fstabの不要エントリ(実際には削除されているが、エントリに残っているディスクパーティション)を削除。
<pre class="command-line">
# nano /etc/fstab
</pre>
</li>
<li>システムを再起動。
<pre class="command-line">
# shutdown -r now
</pre>
</li>
</ol>

<p>
<br />
<a href="http://d.hatena.ne.jp/shibainu55/20090105/1231903678" target="_blank">/etc/fstabの記述ミスでOSブート不能 - shibainu55日記</a>
</p>]]>
        
    </content>
</entry>

</feed>

