Rails1.2.6のアプリケーションをRails2.0にしたら500 Internal Server Error

ログを見ると、

Status: 500 Internal Server Error
  A secret is required to generate an integrity hash for cookie session data. Use config.action_controller.session = { :session_key => "_myapp_session", :secret => "some secret phrase of at least 30 characters" } in config/environment.rb

ログメッセージにある通り、config/environment.rbのRails::Initializer.runのブロックに以下を追加したら、解決。

Rails::Initializer.run do |config|
  # ...
  # Your secret key for verifying cookie session data integrity.
  # If you change this key, all old sessions will become invalid!
  # Make sure the secret is at least 30 characters and all random, 
  # no regular words or you'll be exposed to dictionary attacks.
  config.action_controller.session = {
    :session_key => '_myproject_session',
    :secret      => '5db14bae2952695dca65b3c176a134d100a5066aa0a31d3af680f39f40fe03fa986c024836158c2ae6e8b4a8036de938fdbc072909d1bf88505c96a8270c7cc7'
  }
  # ... 以下略
end

ActiveRecordにセッションを格納するようにしたらエラー

セッションストアにActiveRecordを使用するには、environment.rbで以下の箇所のコメントを外す。

  config.action_controller.session_store = :active_record_store

セッション格納用のテーブルは、

rake db:sessions:create
rake db:migrate

で作成。
セッションストアにActiveRecordを使用するようにしたら、以下のエラーが発生。
No :secret given to the #protect_from_forgery call. Set that or use a session store capable of generating its own keys (Cookie Session Store).
application.rbで以下の箇所の:secretのコメントを外したら解決。

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => '7136b0968f24e7318da7eb62e50d05b7'

active_record_store sessions does not pass a :secret to #protect_from_forgery in Rails 2.0.0 Preview - Ruby Forum

C(Control)-スペースで Spotlight が起動されてしまう

osxでemacsを使用するとき、C(Control)-スペースで Spotlight が起動されてしまう。これを回避するには、「システム環境設定--キーボードとマウス--キーボードショートカット」で、「Spotlight検索フィールドを表示する」と「Spotlightウインドウを表示する」を、適当な別のショートカットに変更すればよいい。(USキーボードなら"Control `" と "Option Control `"など)
Mac OS X Tiger, X11-Emacs 22.0.50

英語キーボードになってしまったWindowsを日本語キーボードに戻す

MacBook(JISキーボード)にVMware Fusionをインストールして、BootCampパーティションのWindowsXPを仮想マシンで実行できるようにしたら、BootCampで起動したWindowsXPのキーボードが英語キーボードになってしまった。
BootCampのWindowsドライバを再インストールしてみたが改善せず。
レジストリを確認すると、
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters
の、
LayerDriver JPN
の値が、
kbd101.dll
になっていたので、
kbd106n.dll
に変更して再起動したら、復旧。

AppleK BC for 7/Vista 32bit - AppleキーボードWindowsドライバ(BootCamp起動環境用) の「キーボードの刻印通りに記号が入力できません」のところにregファイルがあります。

emacs で PHP-modeを使う

SourceForge.net: PHP mode for Emacsからphp-modeをダウンロードして、emacsのsite-lispディレクトリにphp-mode.elをコピーする。
・.emacs.elに以下を追加。

(load-library "php-mode")
(require 'php-mode)
(add-hook 'php-mode-user-hook
'(lambda ()
(setq tab-width 2)
(setq indent-tabs-mode nil))
)

PHPプロ!TIPS
閑古鳥 -> 呟き -> emacs で PHP-mode と mmm-mode を使う