2008-02-01から1ヶ月間の記事一覧

湯沢で初スノボ

最初の一本は転げ落ちることしかできなかったが、初級者コースは転ばずに下まで降りれるくらいまで上達した。今シーズン中にもう一回くらい行きたいなぁ。

Xen DomainUで時計合わせ

XenのDomainUは デフォルトで Domain0の時刻がそのまま使われる。個別の時刻を持たせるには vi /etc/sysctl.conf xen.independent_wallclock = 1 で sysctl -pをしておくと良い

merbのevented_mongrelが無言で落ちる

ので、一旦普通のmongrelに戻した。

acts_as_searchable の reindex!がメモリを使いすぎるので修正

acts_as_searchable_col-0.1.1/lib/acts_as_searchable_col.rb def reinex + id = 0 + while rows = find(:all, :conditions => ['id > ?', id], :limit => 1000, :order => :id ) + break unless rows.any? + rows.each{|r| r.update_index(true)} + id = r…

merb with evented_mongrel

このまえ merb のバージョンを上げたのでソースを見てみたら merb.rbに if ENV['SWIFT'] require 'swiftcore/swiftiplied_mongrel' ... elsif ENV['EVENT'] require 'swiftcore/evented_mongrel' ... elsif ENV['PACKET'] require 'packet_mongrel' ... else…

Xenで domainUにコンソールからログインできなくなった時の対処

Xen3.0 で xenconsole: Could not open tty `/dev/pts/1': No such file or directoy とかでて ログインできなくなった 原因は 長時間コンソールへのアクセスがないと xenconsoled が落ちるっぽい。 ps aux | grep xenconsoled root 3998 0.0 0.0 3908 692 p…

productionでbacktraceを表示する

application.rb の ApplicationController 内に以下を追加 def log_error(exception) if RAILS_ENV == 'production' @bt = clean_backtrace(exception) end end public/500.htmlに以下を追加 <%=h @bt.inspect %>

restful

いまさらながら Rails 2.x のrestful Rails 1.x 機能 Verb Path Method Param 一覧 GET /book index 詳細 GET /book/show/1 show :id => 1 新規作成画面 GET /book/new new 新規作成実行 POST /book/create create 更新画面 GET /book/edit/1 edit :id => 1 …

merbのcookie ではまる

merbの0.4.1を使ってたんだけど set_cookieのコードが以下 # File lib/merb/mixins/controller.rb, line 140 140: def set_cookie(name, value, expires) 141: (headers['Set-Cookie'] ||='') << (Merb::Const::SET_COOKIE % [ 142: name.to_s, 143: escape(…

fastladderインストール

fastladderはクロールの間隔が長かったが、ローカルに入れれば自由に設定できる!ということで、CentOS5に早速入れてみました。 svn checkout http://fastladder.googlecode.com/svn/trunk/ fastladder-read-only 必要そうなものも入れておく sudo gem insta…

Mobile on Ralsで キャリアIPの更新を Test::Unit でテストする

ちゃんと過不足のIPも表示してくれる、いつ使えなくなるかはわからないけど。 require 'open-uri' class CarierIpTest < ActiveSupport::TestCase # Replace this with your real tests. @@SOFTBANK_URL = 'http://developers.softbankmobile.co.jp/dp/tech_…

OpenIDに対応する

忙しいので後で書く