2008年5月アーカイブ

Rubyist Magazine - スはスペックのス 【第 1 回】 RSpec の概要と、RSpec on Rails (モデル編)

Rubyist Magazine - スはスペックのス 【第 2 回】 RSpec on Rails (コントローラとビュー編)

RSpec-1.1.4: Overview

Railsアプリのプラグインとしてインストールする
$ cd vendor/plugins
$ git clone git://github.com/dchelimsky/rspec.git
$ git clone git://github.com/dchelimsky/rspec-rails.git
$ cd ../../
$ ruby script/generate rspec

gitのインストールが必要。
Git - Fast Version Control System
mac osxはインストーラがある。Windowsはcygwinでインストールできる。

カテゴリー:

IIS.net : Learn IIS7: Using FastCGI to Host PHP Applications on IIS 7.0: Running PHP Applications: Hosting Applications on IIS 7.0: Developing on IIS 7.0

IIS7.0にはFastCGIがビルトインされている。IISのFastCGIを使用してPHPアプリケーションを動作させるチュートリアル。

Windows Vistaで、「プログラムと機能」でCGIをチェックしていても、モジュールにFastCGIModuleが組み込まれていなかった。いったんCGIのチェックを外して更新してから、再度CGIにチェックを入れると、FastCGIがモジュール一覧に入った。CGIを有効にした状態でSP1を適用したからかもしれない。

カテゴリー:

カテゴリー:

option + tab または コマンド + [ インデント
option + shift + tab または コマンド + ] インデント解除

カテゴリー:

rails2の、authenticity_token出力をとめる

rails2から導入されたauthenticity_tokenによるCSRF対策を無効にする方法。

この検証に失敗した場合、以下の例外が発生する。
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)
特定のアクションでauthenticity_tokenの出力、検証を無効にする。
class TestController < ApplicationController
  protect_from_forgery :except => [:hello]

  def hello
    self.allow_forgery_protection = false
  end
end
コントローラのアクションすべてでauthenticity_tokenの出力、検証を無効にする。
class ApplicationController < ActionController::Base
  #protect_from_forgery # See ActionController::RequestForgeryProtection for details
  self.allow_forgery_protection = false
end

カテゴリー:

インストール

# yum install vnc-server


サービスの自動起動設定

# chkconfig vncserver on


VNCサーバの設定

/etc/sysconfig/vncservers
VNCSERVERS="1:user1 2:user2"
VNCSERVERARGS[1]="-geometry 800x600 -depth 16"
VNCSERVERARGS[2]="-geometry 800x600 -depth 16"


VNCパスワードの設定

/etc/sysconfig/vncserversで設定したユーザでログインして、vncpasswdでパスワードを設定する。


各ユーザのホームディレクトリ下の.vnc/xsartupを編集

コメントを2か所外す。
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc


ファイアウォールの設定

VNCプロトコルは、5900 + 「ディスプレイ番号」のポートを使用する。
例えば、ディスプレイ番号が1の場合は、5901:tcpを開いておく


VNCサーバを起動する

サービスで起動
# service vncserver start
vncserverコマンドで起動(:1はディスプレイ番号)
# vncserver :1
vncserverコマンドで停止
# vncserver -kill :1

カテゴリー:

カテゴリー:

カテゴリー:

カテゴリー:

カテゴリー: