Pistolfly のすべての投稿
簡単で柔軟なパンくずリスト
Rails アプリでプリファレンスを保存する方法
PostgreSQL運用&チューニング
suでスーパーユーザになれるユーザを限定するとroot以外のユーザにもなれなくなる
PAMでsuでrootになれるユーザを限定する(suでスーパーユーザー(root)になれるユーザーを限定する)と、wheelグループに属さないユーザは、suでroot以外のユーザにもなれなくなってしまう。
[J] スーパーユーザー root へのスイッチを制限すると su 自体が機能しなくなる - Jamz (Tech)
PAM-0.78以降であれば、以下の方法で解決できるらしい。
(それより前のバージョンのPAMでは、解決方法はなさそう。)
・use_uidオプションを使用せず、root_onlyオプションを使用する。
auth required /lib/security/$ISA/pam_wheel.so root_only
Bug 161579: pam_wheel restricts "su - otheruser" for users of non wheel group
The Worst Rails Code
Postfixの送受信最大サイズの設定
/etc/postfix/main.cf
message_size_limit = 20480000
message_size_limitが未指定の場合のデフォルトは、10240000(10MB)。
main.cfのパラメータについては、main.cfの最初のコメントにあるとおり、
$ man 5 postconf
で見ることができる。
message_size_limit (default: 10240000) The maximal size in bytes of a message, including envelope information.
注意
message_size_limit を変更する場合、mailbox_size_limit を超えないようにしないといけない。
message_size_limit が mailbox_size_limit より大きい場合、メールが一切受信できなくなる。
mailbox_size_limit のデフォルトは51200000(50MB)。
0を設定しておけば無制限になる。
mailbox_size_limit = 0
mailbox_size_limit (default: 51200000) The maximal size of any local(8) individual mailbox or maildir file, or zero (no limit). In fact, this limits the size of any file that is written to upon local delivery, including files written by external commands that are executed by the local(8) delivery agent. This limit must not be smaller than the message size limit.
Rails 2.0でruby-debugを使う
Rails 2.0でデバッグをする新しいやり方 - Hello, world! - s21g
Rails 2.0ではruby-debugを使ったdebuggerが正式に採用された。
Ruby On Rails ピチカート街道 - デバッグ初体験03【ruby-debug v0.9.3 マニュアルお気楽翻訳】 -
バージョンを指定してRailsプロジェクトを作成する
$ rails _2.0.2_ myproject
RSpec の使い方
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でインストールできる。