2008年4月アーカイブ

rsync で ssh のポートを指定する方法 - METAREAL

--rshまたは-eで指定するsshコマンドに、-p オプションを使えばよい。

rsync --rsh="ssh -p 22222"

または

rsync -e "ssh -p 22222"

カテゴリー:

CentOS5.1にdovecotをインストールして起動したが、メールの受信ができない。

以下の記事に解決方法があった。
万思記屋 : CentOS5.1(X86_64)とdovecot

/etc/dovecot.confに以下のパラメータを追記。
login_process_size = 64

カテゴリー:

設定の確認
iptables -L
設定の削除
iptables -F
設定の保存
service iptables save
設定例
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -j ACCEPT
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p tcp --sport 53 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -j ACCEPT
iptables -A INPUT -p udp --sport 53 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 110 -j ACCEPT
iptables -A INPUT -p tcp --dport 143 -j ACCEPT
iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -j REJECT
iptables -A FORWARD -j REJECT

カテゴリー:

Paginating_findでページネーション - cys b

rails2.0でpaginateが使えなくなった。
で、pluginを使う。
paginationプラグインのひとつ、paginating_findの使い方とカスタマイズ例。

カテゴリー:

MySQL :: MySQL 5.1 リファレンスマニュアル :: 2.10.3 最初の MySQL アカウントの確保

MySQLをインストールしたら、まず匿名アカウントを削除して、rootアカウントにパスワードを設定する。(最初の root アカウントパスワードは空)

匿名アカウントの削除

$ mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.0.85 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DELETE FROM mysql.user WHERE User = '';
Query OK, 2 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

root アカウントのパスワードの割り当て

$ mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 5.0.85 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
Query OK, 0 rows affected (0.00 sec)

mysql> SET PASSWORD FOR 'root'@'hostname' = PASSWORD('newpwd');
Query OK, 0 rows affected (0.00 sec)

mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');
Query OK, 0 rows affected (0.00 sec)

hostnameはmysql.userテーブルをselectして確認する。

カテゴリー:

rails 2.0.2.9216と 2.0.2.9126で新規にアプリケーションを作成すると、実行時にエラーが発生する。

rails trial
cd trial
ruby script/console 
Loading development environment (Rails 2.0.2)
/Users/pistolfly/railsprojects/trial/config/environment.rb:44:NoMethodError: undefined method `time_zone=' for #
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:88:NoMethodError: undefined method `cattr_accessor' for ActionController::Dispatcher:Class
/Users/pistolfly/railsprojects/trial/app/controllers/application.rb:4:NameError: uninitialized constant ActionController::Base

sudo gem uninstall rails --version 2.0.2.9216

のように新しい順にアンインストールしていき、2.0.2.9053まで戻して新規にプロジェクトを作成したら大丈夫になった。

カテゴリー:

Old Tech Per: Rails Fixture Tips

外部キーを扱うためにfixtureのロードの順番を指定する方法と、バイナリデータをロードする方法の解説。

カテゴリー:

カテゴリー:

Fedora5のphpのDOM拡張モジュールは、php-xmlパッケージに入っている。

yum install php-xml

でphp-xmlをインストール後、httpdをrestartすれば、DOMが使用できるようになった。

カテゴリー:

カテゴリー: