2011年3月31日木曜日

Firefox 4 のアドオンバーの閉じるボタン

ことのおこり

…あれ,間違って閉じません?あたしだけ??

ぐぐる

機能拡張があったような気がしてたんだけれども,違うものを見つけたの。

Firefox 4 アドオンバーの中にリンク先URLの表示を移動させてみた | Firefox Fan Club + More Browsers をまねまね~。

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Firefox 4 アドオンバーの中にリンク先URLの表示を移動させてみた | Firefox Fan Club + More Browsers - http://doheny.blog137.fc2.com/blog-entry-72.html */
/* アドオンバーを閉じるボタンを非表示にする */
#addonbar-closebutton {
  display: none !important;
}
/* アドオンバーの中にリンク先URLを埋め込み */
#main-window:not([inFullscreen]) #statusbar-display {
  margin-top: -17px !important;
  max-width: 80% !important;
}
#main-window:not([inFullscreen]) .statuspanel-label {
  background: transparent !important;
  border: none !important;
}
/* ページ内検索バーを表示の時にもアドオンバー内に表示させる */
#main-window:not([inFullscreen]) #statusbar-display[mirror="true"] {
  position: fixed !important;
  left: -12px !important;
  margin-top: 11px !important;
}

を Stylish に書いておいたの。

2011年3月29日火曜日

Debian Lenny から Squeeze へ - その 8

アップグレード後 その 2

Redmine で,みごとにこれに当てはまってみたり。

--- environment.rb.org 2010-11-28 21:48:46.000000000 +0900
+++ environment.rb 2011-03-29 09:37:29.000000000 +0900
@@ -17,6 +17,18 @@
# Not available
end

+# "version_requirements is deprecated" $X$NBP1~
+if Gem::VERSION >= "1.3.6"
+ module Rails
+ class GemDependency

+ def requirement
+ r = super
+ (r == Gem::Requirement.default) ? nil : r
+ end
+ end
+ end
+end
+
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence those specified here

Debian Lenny から Squeeze へ - その 7

アップグレード後

MySQL にね,つながんないんだよ…?

かくにん

ろぐをよ~くみると,

$ sudo apt-get dist-upgrade
  :
以下のパッケージは「削除」されます:
irb1.8 libept0 libreadline-ruby1.8 libxcb-xlib0 mysql-server mysql-server-5.0 proftpd
rdoc1.8
以下のパッケージが新たにインストールされます:
  :
  :
libxapian22 lsb-release mime-construct mysql-server-core-5.1 os-prober php5-suhosin
  :
Debian -- squeeze の mysql-server-core-5.1 パッケージに関する詳細 には,
本パッケージはサーバのバイナリを含んでいますが、システムデータベースを構成するのに必要な基盤のすべては含まれていません。
??? mysql-server(-5.1) をいれろってことかな?

まだへん

ろぐがね…。

Mar 28 16:19:32 servername mysqld: 110328 16:19:32 [ERROR] Invalid (old?) table or database name 'tablename1'
Mar 28 16:19:32 servername mysqld: 110328 16:19:32 [ERROR] Invalid (old?) table or database name 'tablename2'
Mar 28 16:19:32 servername mysqld: 110328 16:19:32 [ERROR] Invalid (old?) table or database name 'tablename3'
Mar 28 16:19:32 servername mysqld: 110328 16:19:32 [ERROR] Invalid (old?) table or database name 'tablename4'
2010-06-23 - 知のレバレッジを最大化せよ によると,innodb 使っているときのバグだとか。
mysql> OPTIMIZE TABLE `databasename`.`tablename`;
をちまちま発行していったらエラーは消えた。

まだまだへん

view もエラーでてる。

Mar 28 18:53:30 servername mysqld: 110328 18:53:30 [Warning] View 'databasename'.'viewname1': there is unknown charset/collation names (client: ''; connection: '').
Mar 28 18:53:30 servername mysqld: 110328 18:53:30 [Warning] View 'databasename'.'viewname2': there is unknown charset/collation names (client: ''; connection: '').
SHOW CREATE VIEW して,DROP VIEW して,CREATE VIEW したらなおった。

まだまだまだへん

default-character-set がどうとか。

Mar 28 16:19:31 servername mysqld: 110328 16:19:31 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
mysqld は,default-character-set ではなくて,character-set-server をつかうらしいよ。

Debian Lenny から Squeeze へ - その 6

アップグレードのつづき

ssh からつながらなくなった件は,キーボードから Ctrl + Alt + Delete したらなおった(?)

システムのアップグレード

さて。

$ sudo apt-get dist-upgrade
 :
アップグレード: 91 個、新規インストール: 67 個、削除: 8 個、保留: 1 個。
途中でいくつか訊かれたけど,よきにはからっておいた。

保留があったので,もう一回。

$ sudo apt-get dist-upgrade
 :
アップグレード: 1 個、新規インストール: 1 個、削除: 1 個、保留: 0 個。

さいきどう。

$ sudo reboot

Debian Lenny から Squeeze へ - その 5

アップグレードのつづき

必要なファームウェアファイルがなくなっている可能性があります とか言われて…

カーネルと udev のアップグレード のつづき

lennyからsqueezeへアップグレード | ソースコード備忘録Press によると,non-free な firmware をいれるらしいよ。

apt/sources.list を,squeeze main としていたのを squeeze main contrib non-free に変更して,

$ sudo apt-get update
$ sudo apt-get install firmware-realtek

udev もインストール。

$ sudo apt-get install udev

で,再起動。

$ sudo reboot

…ssh,つながんないんだけど。

Debian Lenny から Squeeze へ - その 4

アップグレード

パッケージリストの更新

lenny から squeeze へのアップグレードは,aptitude ではなくて,apt-get が推奨らしいよ。何でかは知らないけど。

$ sudo apt-get update

システムの最小アップグレード

まずはちょっとだけ…。

$ sudo apt-get upgrade
 :
アップグレード: 231 個、新規インストール: 0 個、削除: 0 個、保留: 113 個。
…ちょっと?

カーネルと udev のアップグレード

するんだって。…かえってこなくならないかなぁ?

$ sudo apt-get install linux-image-2.6-amd64
あそうそう,64bit のほうをつかってます。
 ┌--------------------┤ linux-base を設定しています ├--------------------┐
 │                                                                         │
 │ 新しい Linux カーネルバージョンでは、いくつかの PATA (IDE) コントロー   │
 │ ラについて別のドライバを提供します。ハードディスク、CD-ROM、テープデバ  │
 │ イスの名前のいくつかは変更される可能性があります。                      │
 │                                                                         │
 │ 新旧両方のカーネルバージョンで動作させつつ、設定ファイル中でディスクデ  │
 │ バイスを識別するために、デバイス名よりもラベルまたは UUID (固有識別子)  │
 │ を使うことが、現在推奨されます。                                        │
 │                                                                         │
 │ システムの設定を自動更新することを選ばない場合は、次のシステム再起動の  │
 │ 前にあなた自身でデバイス ID を更新する必要があります。さもないと、シス  │
 │ テムは起動不能になってしまうかもしれません。                            │
 │                                                                         │
 │ システム設定のディスクデバイス ID を更新しますか?                       │
 │                                                                         │
 │                 <はい>                            <いいえ>              │
 │                                                                         │
 └-------------------------------------------------------------------------┘
うむ,よきにはからえ。
 ┌--------------------┤ linux-base を設定しています ├--------------------┐
 │                                                                         │
 │ 次のデバイスは UUID またはラベルに割り当てられます:                     │
 │                                                                         │
  :
 │ ディスクデバイス ID の設定変更を適用しますか?                           │
 │                                                                         │
 │                 <はい>                            <いいえ>              │
 │                                                                         │
 └-------------------------------------------------------------------------┘
うむ,よきにはからえ。
 ┌------------┤ linux-image-2.6.32-5-amd64 を設定しています ├------------┐
 │                                                                         │
 │ 必要なファームウェアファイルがなくなっている可能性があります            │
 │                                                                         │
 │ このシステムは現在 Linux 2.6.26-2-amd64 を実行しており、                │
 │ Linux 2.6.32-5-amd64 をインストールしようとしています。新しいバージョ   │
 │ ンでは、このシステムで使われるドライバのいくつかは追加のファームウェア  │
 │ ファイルを必要とするかもしれません:                                     │
 │                                                                         │
 │ r8169: rtl_nic/rtl8168d-2.fw, rtl_nic/rtl8168d-1.fw                     │
 │                                                                         │
 │ ほとんどのファームウェアファイルは、Debian フリーソフトウェアガイドラ   │
 │ インに合致しないため、システムに含まれていません。これらのファームウェ  │
 │ アファイルをインストール可能にするために、パッケージアーカイブの        │
 │ contrib および non-free セクションを含むようパッケージマネージャを再設  │
 │ 定する必要があるかもしれません。                                        │
 │                                 <了解>                                  │
 │                                                                         │
 └-------------------------------------------------------------------------┘
…え゛?

Debian Lenny から Squeeze へ - その 3

アップグレードのまえに

APT の pin 機能を無効にする

らしいんだけど…。/etc/apt/preferences を削除すればいいのかな?lenny-backports のために作ったような…?

APT のインターネットソースの追加

/etc/apt/sources.list の lenny を squeeze に変更。

Debian Lenny から Squeeze へ - その 2

ばっくあっぷ

公式でも バックアップは大切だとおっしゃってます。

せってい

/etc をかためておく。

$ cd /
$ sudo tar zcf etc.tgz etc/
$ sudo mv etc.tgz ~/backup

DokuWiki

DokuWiki もかためておく。DokuWiki はデータベース使ってないから dokuwiki/ 以下を単にバックアップすればいい。

Subverion

とりあえず svnadmin hotcopy で。

# svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH

Redmine

redmine/files ディレクトリだけでいいみたいだけど,ぜんぶとっちゃえw

MySQL

とりあえず mysqldump で。

$ mysqldump -A -u root -p --opt > dump_filename

Debian Lenny から Squeeze へ

したしらべ

Redmine のために lenny-backports 使ってるけど,これどうしたら…?

$ apt-show-versions | grep backports
debian-backports-keyring/lenny-backports uptodate 2009.02.20
libactiverecord-ruby1.8/lenny-backports uptodate 2.3.5-1~bpo50+1
libactivesupport-ruby1.8/lenny-backports uptodate 2.3.5-1~bpo50+1
libapache2-mod-passenger/lenny-backports uptodate 2.2.11debian-1~bpo50+1
libi18n-ruby1.8/lenny-backports uptodate 0.3.6-1~bpo50+1
libjs-jquery/lenny-backports uptodate 1.4.2-2~bpo50+1
libjs-prototype/lenny-backports uptodate 1.6.1-1~bpo50+1
libmemcache-client-ruby1.8/lenny-backports uptodate 1.7.8-1~bpo50+1
librack-ruby/lenny-backports uptodate 1.1.0-4~bpo50+1
librack-ruby1.8/lenny-backports uptodate 1.1.0-4~bpo50+1
libredcloth-ruby1.8/lenny-backports uptodate 4.2.2-1~bpo50+1
libtzinfo-ruby1.8/lenny-backports uptodate 0.3.19-1~bpo50+1
rails/lenny-backports uptodate 2.3.5-1~bpo50+1
rails-ruby1.8/lenny-backports uptodate 2.3.5-1~bpo50+1
rake/lenny-backports uptodate 0.8.7-1~bpo50+1
rubygems/lenny-backports uptodate 1.3.4-1~bpo50+1
rubygems1.8/lenny-backports uptodate 1.3.4-1~bpo50+1

ようは

Rails 関連なんだから。パッケージ: rails-ruby1.8 (2.3.5-1.2) で,バージョンが 2.3.5 で同じだから大丈夫でないかな~?

2011年3月25日金曜日

Redmine を Debian Squeeze にインストールしてみる - その 8

Apache2 のせってい

とりあえずこれを放り込んでおく。apache2/conf.d/RailsBaseURI

RailsBaseURI /redmine
で,…。「Index of …」とな?

…ちゃんと Apache 再起動しようね。

$ sudo /etc/init.d/apache2 restert
Restarting web server: apache2 ... waiting .

ちゃんときどうできました。

Redmine を Debian Squeeze にインストールしてみる - その 7

gem

もういいや。gem でインストールしよう…。

$ sudo gem install -v=0.4.2 i18n
Successfully installed i18n-0.4.2
1 gem installed
Installing ri documentation for i18n-0.4.2...
Installing RDoc documentation for i18n-0.4.2...

まいぐれーしょん!

では,再度。

$ sudo rake generate_session_store
(in /var/local/lib/redmine-1.1.2)
$ sudo rake db:migrate RAILS_ENV=production
(in /var/local/lib/redmine-1.1.2)
rake aborted!
Could not find RubyGem rack (~> 1.0.1)

(See full trace by running task with --trace)
やっぱり rack もダメなのね…。
$ sudo gem install -v=1.0.1 rack
Successfully installed rack-1.0.1
1 gem installed
Installing ri documentation for rack-1.0.1...
Installing RDoc documentation for rack-1.0.1...
$ sudo rake db:migrate RAILS_ENV=production
(in /var/local/lib/redmine-1.1.2)
== Setup: migrating ==========================================================
:
== ChangeProjectsIdentifierLimit: migrated (0.0184s) =========================

Redmine を Debian Squeeze にインストールしてみる - その 6

Redmine のせってい

config/database.yml

config/database.yml.example をコピーして作成。production: を変更

production:
adapter: mysql
database: db_redmine
host: localhost
username: redmineUser
password: P*a*s*s*w*o*r*d
encoding: utf8

config/email.yml

config/email.yml.example をコピーして作成。''# === Simple SMTP server at localhost'' のあたりを変更。

# === Simple SMTP server at localhost

production:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25

まいぐれーしょん!

$ sudo rake generate_session_store
(in /var/local/lib/redmine-1.1.2)
Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`
…あれ?
$ sudo rake db:migrate RAILS_ENV=production
(in /var/local/lib/redmine-1.1.2)
Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`
……あれれ??

'--character-set-sever' instead ???

logcheck さんからおてがみついた。

Mar 25 13:31:40 vmware-squeeze mysqld: 110325 13:31:40 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
…とりあえず動いているからいいや。

Redmine を Debian Squeeze にインストールしてみる - その 5

MySQL

そういえば MySQL に何も手を加えていないので。

ちょうさ

Redmine 1.0をCentOSにインストールする手順 | Redmine.JP Blog に書いてあることを試してみる。

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 35
Server version: 5.1.49-3 (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

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

mysql> show variables like 'character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> exit;
Bye

過去の記憶によると/etc/mysql/conf.d に設定ファイルを書いたはず。

utf8.cnf

[mysqld]
default-character-set = utf8

[mysqld_safe]
default-character-set = utf8

[mysql]
default-character-set = utf8


mysql/conf.d って?

mysql/my.cnf には最後にこんな記述があるんだよ。

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/


ちょうさ - 2

再起動して,もう一度。

$ sudo /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 35
Server version: 5.1.49-3 (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

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

mysql> show variables like 'character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> exit;
Bye

そのたのせってい

Debian で MySQL をインストールすると,debconf (?)で最初に root のパスワードを設定してくれるようになったね~。いつからだろ?

Redmine 用のデータベースとユーザを作成しておく。

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.49-3 (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

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

mysql> create database db_redmine charset=utf8;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on `db_redmine`.* to 'redmineUser'@'localhost' identified by 'P*a*s*s*w*o*r*d';
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

Redmine を Debian Squeeze にインストールしてみる - その 4

じゅんびをいんすとーる

しらべるのもあきてきたので。

$ sudo aptitude install ruby rails libdbd-mysql-ruby libjs-scriptaculous libapache2-mod-passenger
[sudo] password for takashima:
以下の新規パッケージがインストールされます:
libactionmailer-ruby1.8{a} libactionpack-ruby1.8{a} libactiverecord-ruby1.8{a}
libactiveresource-ruby1.8{a} libactivesupport-ruby1.8{a} libapache2-mod-passenger
libbreakpoint-ruby1.8{a} libbuilder-ruby1.8{a} libcmdparse2-ruby1.8{a}
libdaemons-ruby1.8{a} libdbd-mysql-ruby libdbd-mysql-ruby1.8{a} libdbi-ruby1.8{a}
libdeprecated-ruby1.8{a} libi18n-ruby1.8{a} libjs-jquery{a} libjs-prototype{a}
libjs-scriptaculous liblog4r-ruby1.8{a} libmemcache-client-ruby1.8{a}
libmmap-ruby1.8{a} libmysql-ruby1.8{a} libncurses-ruby1.8{a} librack-ruby{a}
librack-ruby1.8{a} libredcloth-ruby1.8{a} libruby1.8{a} libruby1.8-extras{a}
libsqlite3-ruby1.8{a} libtext-format-ruby1.8{a} libtmail-ruby1.8{a}
libtzinfo-ruby1.8{a} rails rails-ruby1.8{a} rake{a} ruby ruby1.8{a} rubygems{a}
rubygems1.8{a}
以下のパッケージが推奨されていますがインストールされません:
build-essential javascript-common libmocha-ruby1.8 ruby1.8-dev zip
更新: 0 個、新規インストール: 39 個、削除: 0 個、保留: 0 個。
5,994 kB のアーカイブを取得する必要があります。展開後に 32.0 MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?]
rubygems (バージョン無し)がふえてるなぁ…。

Redmine を Debian Squeeze にインストールしてみる - その 3

libjs-scriptaculous ってなに?

そういえばlibjs-scriptaculous なるものが減ってた。

ぐぐってみる

公式では

パッケージ: libjs-scriptaculous (1.8.3-1)

JavaScript library for dynamic web applications
script.aculo.us is a JavaScript library providing dynamic visual effects and user interface elements via the Document Object Model.
script.aculo.us extends the Prototype Javascript Framework by adding visual effects, user interface controls, and utilities. It is most notably included with Ruby on Rails, but also provided separately to work with other web application frameworks and scripting languages.
…よくわかんないけど,いれといたほうがいいのかな?

Redmine を Debian Squeeze にインストールしてみる - その 2

インストールするパッケージのげんせん

てけとーにいれてうごいた~!でもいいんだけれども。ruby, rails, libdbd-mysql-ruby ではどんなもんでしょ?

$ sudo aptitude install ruby rails libdbd-mysql-ruby
[sudo] password for takashima:
以下の新規パッケージがインストールされます:
libactionmailer-ruby1.8{a} libactionpack-ruby1.8{a} libactiverecord-ruby1.8{a}
libactiveresource-ruby1.8{a} libactivesupport-ruby1.8{a} libbreakpoint-ruby1.8{a}
libbuilder-ruby1.8{a} libcmdparse2-ruby1.8{a} libdaemons-ruby1.8{a}
libdbd-mysql-ruby libdbd-mysql-ruby1.8{a} libdbi-ruby1.8{a}
libdeprecated-ruby1.8{a} libi18n-ruby1.8{a} libjs-jquery{a} libjs-prototype{a}
liblog4r-ruby1.8{a} libmemcache-client-ruby1.8{a} libmmap-ruby1.8{a}
libmysql-ruby1.8{a} libncurses-ruby1.8{a} librack-ruby{a} librack-ruby1.8{a}
libredcloth-ruby1.8{a} libruby1.8{a} libruby1.8-extras{a} libsqlite3-ruby1.8{a}
libtext-format-ruby1.8{a} libtmail-ruby1.8{a} libtzinfo-ruby1.8{a} rails
rails-ruby1.8{a} rake{a} ruby ruby1.8{a} rubygems1.8{a}
以下のパッケージが推奨されていますがインストールされません:
build-essential javascript-common libmocha-ruby1.8 ruby1.8-dev zip
更新: 0 個、新規インストール: 36 個、削除: 0 個、保留: 0 個。
5,396 kB のアーカイブを取得する必要があります。展開後に 29.5 MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?]

けんしょう

増えたのは libdbd-mysql-ruby 関連。減ったのは…

  • dbconfig-common は,honeplusのメモ帳 aptでRedmineをインストールしてみた(Debian 6.0 "Squeeze") によると redmine のインストール時の設定に使うだけみたいだから,いらないはず。
  • libactionmailer-ruby, libactionpack-ruby, libactiveresource-ruby, libactivesupport-ruby はそれぞれ1.8のついたパッケージをインストールしてるからいらない。
  • libdbd-sqlite3-ruby, libdbd-sqlite3-ruby1.8, sqlite3 は,SQLite 使わないからいらない。

あ゛,Passenger わすれてた…

2011年3月24日木曜日

mpt-statusd: detected non-optimal RAID status

ことのおこり

新しく作った vmware な Debian Squeeze 君が,10分おきなんか言ってる…。

これは logcheck が送ってきたメール。

This email is sent by logcheck. If you no longer wish to receive
such mail, you can either deinstall the logcheck package or modify
its configuration file (/etc/logcheck/logcheck.conf).

System Events
=-=-=-=-=-=-=
Mar 24 17:08:40 vmware-squeeze mpt-statusd: detected non-optimal RAID status
Mar 24 17:18:42 vmware-squeeze mpt-statusd: detected non-optimal RAID status
Mar 24 17:28:42 vmware-squeeze mpt-statusd: detected non-optimal RAID status
Mar 24 17:38:44 vmware-squeeze mpt-statusd: detected non-optimal RAID status
Mar 24 17:48:46 vmware-squeeze mpt-statusd: detected non-optimal RAID status
Mar 24 17:58:46 vmware-squeeze mpt-statusd: detected non-optimal RAID status

ぐぐる

英語でわかんないけど,これかな~? Debian User Forums • View topic - Debian Reports Non-optimal RAID Status

Uninstall mpt-status.

It may have been installed because you are running on vmware, or it could be a default from ticking the mail server option in the installer.
とのことなので,mpt-status をパージしておきましょう。…どうなるかな?

一時間経って,ログ見てみたけど,出なくなったみたい。

Redmine を Debian Squeeze にインストールしてみる

ことのおこり

Debian GNU/Linux 6.0 "Squeeze" には Redmine 1.0.1 なパッケージがあるから,インストール楽なんぢゃないかな?

ちょうさ

しらべてみましょ。vmwareにインストールしたばかり…,ええと,Apache2 と MySQL はすでにインストール済み,な環境。

$ sudo aptitude install redmine
以下の新規パッケージがインストールされます:
dbconfig-common{a} libactionmailer-ruby{a} libactionmailer-ruby1.8{a}
libactionpack-ruby{a} libactionpack-ruby1.8{a} libactiverecord-ruby1.8{a}
libactiveresource-ruby{a} libactiveresource-ruby1.8{a} libactivesupport-ruby{a}
libactivesupport-ruby1.8{a} libbreakpoint-ruby1.8{a} libbuilder-ruby1.8{a}
libcmdparse2-ruby1.8{a} libdaemons-ruby1.8{a} libdbd-sqlite3-ruby{a}
libdbd-sqlite3-ruby1.8{a} libdbi-ruby1.8{a} libdeprecated-ruby1.8{a}
libi18n-ruby1.8{a} libjs-jquery{a} libjs-prototype{a} libjs-scriptaculous{a}
liblog4r-ruby1.8{a} libmemcache-client-ruby1.8{a} libmmap-ruby1.8{a}
libncurses-ruby1.8{a} librack-ruby{a} librack-ruby1.8{a} libredcloth-ruby1.8{a}
libruby1.8{a} libruby1.8-extras{a} libsqlite3-ruby1.8{a} libtext-format-ruby1.8{a}
libtmail-ruby1.8{a} libtzinfo-ruby1.8{a} rails{a} rails-ruby1.8{a} rake{a} redmine
redmine-sqlite{a} ruby{a} ruby1.8{a} rubygems1.8{a} sqlite3{a}
以下のパッケージが推奨されていますがインストールされません:
build-essential javascript-common libmocha-ruby1.8 ruby1.8-dev zip
更新: 0 個、新規インストール: 44 個、削除: 0 個、保留: 0 個。
7,698 kB のアーカイブを取得する必要があります。展開後に 44.2 MB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?]

redmine-mysql

ほおっておくとSQLiteを使うながれになりそうなので。これも調査。

$ aptitude show redmine-mysql
パッケージ: redmine-mysql
状態: インストールされていません
バージョン: 1.0.1-1
優先度: 特別
セクション: web
メンテナ: Jérémy Lal
展開サイズ: 65.5 k
依存: libdbd-mysql-ruby, mysql-client | virtual-mysql-client
提案: mysql-server
説明: metapackage providing MySQL dependencies for Redmine
This package only provides MySQL dependencies for Redmine, a flexible project management
web application. Install this one if you want to use a MySQL database with Redmine.

Redmine package should be installed along with this package.
ホームページ: http://www.redmine.org

$ aptitude show libdbd-mysql-ruby
パッケージ: libdbd-mysql-ruby
状態: インストールされていません
バージョン: 0.4.4-1
優先度: 任意
セクション: ruby
メンテナ: Dmitry Borodaenko
展開サイズ: 61.4 k
依存: libdbd-mysql-ruby1.8
説明: Ruby/DBI MySQL driver
Ruby/DBI is a database independent interface for accessing databases, similar to Perl's
DBI.

This package is a dependency package, which depends on the package containing actual
Ruby/DBI MySQL driver for the default Ruby version (currently 1.8).
ホームページ: http://rubyforge.org/projects/ruby-dbi

$ aptitude show libdbd-mysql-ruby1.8
パッケージ: libdbd-mysql-ruby1.8
状態: インストールされていません
バージョン: 0.4.4-1
優先度: 任意
セクション: ruby
メンテナ: Dmitry Borodaenko
展開サイズ: 123 k
依存: libmysql-ruby1.8, libdbi-ruby1.8 (>= 0.4.2)
説明: Ruby/DBI MySQL driver for Ruby 1.8
Ruby/DBI is a database independent interface for accessing databases, similar to Perl's
DBI.

This package contains Ruby/DBI driver for MySQL database.
ホームページ: http://rubyforge.org/projects/ruby-dbi
…なんとなくredmine-rubyは入れたくないので,libdbd-mysql-rubyあたりをいれればいいかな?

2011年3月3日木曜日

DokuWiki-2010-11-07a その2

inc/indexer.php

こんな感じに変更。

でぃふ


--- indexer.php.org 2011-03-03 16:42:26.000000000 +0900
+++ indexer.php.110303171410 2011-03-03 17:14:10.000000000 +0900
@@ -42,6 +42,8 @@
']?');
define('IDX_ASIAN', '(?:'.IDX_ASIAN1.'|'.IDX_ASIAN2.'|'.IDX_ASIAN3.')');

+define('PRE_TOKENIZER', '/usr/bin/mecab -O wakati');
+

/**
* Measure the length of a string.
* Differs from strlen in handling of asian characters.
@@ -49,11 +51,15 @@
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function wordlen($w){
- $l = strlen($w);
+ $l = utf8_strlen($w);
+
+ /*

// If left alone, all chinese "words" will get put into w3.idx
// So the "length" of a "word" is faked
if(preg_match('/'.IDX_ASIAN2.'/u',$w))
$l += ord($w) - 0xE1; // Lead bytes from 0xE2-0xEF
+ */
+
return $l;
}

@@ -217,6 +223,28 @@

list($page,$body) = $data;

+ if(function_exists(proc_open) && defined('PRE_TOKENIZER')) {

+ $dspec = array(
+ 0 => array("pipe", "r"),
+ 1 => array("pipe", "w"),
+ 2 => array("file", "/dev/null", "w")
+ );
+ $process = proc_open(PRE_TOKENIZER, $dspec, $pipes);

+ if(is_resource($process)) {
+ stream_set_blocking($pipes[0], FALSE);
+ stream_set_blocking($pipes[1], FALSE);
+ fwrite($pipes[0], $body . "\n");
+ fclose($pipes[0]);
+
+ $body = '';
+ while(!feof($pipes[1])) {
+ $body .= fgets($pipes[1], 32768);

+ }
+ fclose($pipes[1]);
+ proc_close($process);
+ }
+ }
+
$body = strtr($body, "\r\n\t", ' ');
$tokens = explode(' ', $body);
$tokens = array_count_values($tokens); // count the frequency of each token
@@ -533,7 +561,7 @@
$wild |= 2;
$wlen -= 1;
}

- if ($wlen < IDX_MINWORDLENGTH && $wild == 0 && !is_numeric($xword)) continue;
+ if (preg_match('/[^0-9A-Za-z]/u', $string) && $wlen < IDX_MINWORDLENGTH && $wild == 0 &
& !is_numeric($xword)) continue;
if(!isset($tokens[$xword])){
$tokenlength[$wlen][] = $xword;
}

@@ -676,12 +704,36 @@
*/
function idx_tokenizer($string,&$stopwords,$wc=false){
$words = array();
+
+ if(function_exists(proc_open) && defined('PRE_TOKENIZER')) {
+ $dspec = array(
+ 0 => array("pipe", "r"),

+ 1 => array("pipe", "w"),
+ 2 => array("file", "/dev/null", "w")
+ );
+ $process = proc_open(PRE_TOKENIZER, $dspec, $pipes);
+ if(is_resource($process)) {
+ stream_set_blocking($pipes[0], FALSE);
+ stream_set_blocking($pipes[1], FALSE);

+ fwrite($pipes[0], $string . "\n");
+ fclose($pipes[0]);
+ $string = '';
+ while(!feof($pipes[1])) {
+ $string .= fgets($pipes[1], 32768);
+ }
+ fclose($pipes[1]);
+ proc_close($process);
+ }

+ }
+
$wc = ($wc) ? '' : $wc = '\*';

if(preg_match('/[^0-9A-Za-z]/u', $string)){
+ /*
// handle asian chars as single words (may fail on older PHP version)
$asia = @preg_replace('/('.IDX_ASIAN.')/u',' \1 ',$string);
if(!is_null($asia)) $string = $asia; //recover from regexp failure
+ */

$arr = explode(' ', utf8_stripspecials($string,' ','\._\-:'.$wc));
foreach ($arr as $w) {

DokuWiki-2010-11-07a その1

ことのおこり

ひさしぶりに管理者でDokuWikiにログインしたら上のほうがうるさいの。

ぐぐる…

DokuWiki はぐぐっても情報ないんだよね…。

ちょうさ

うちのDokuWikiは ここを参考に MeCab 入れて,inc/indexer.php に手を加えている。indexer.php が変わると,ただコピペしているだけの身としては手が出なくなる…。

ええと,

  • idx_listIndexLengths()
    が増えた。
  • idx_indexLengths(&$filter)
    idx_listIndexLengths()
    を使って書き換えられた。
  • idx_upgradePageWords()
    がなくなった。

かな?これならいけそう??

でぃふ

--- E:/dokuwiki/dokuwiki-2009-12-25c/dokuwiki-2009-12-25/inc/indexer.php    Sun Jan 17 19:35:46 2010
+++ E:/dokuwiki/dokuwiki-2010-11-07a/inc/indexer.php    Mon Jan 17 03:04:09 2011
@@ -1,15 +1,12 @@
<?php /** - * Common DokuWiki functions + * Functions to create the fulltext search index * * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author Andreas Gohr <andi@splitbrain.org> */ if(!defined('DOKU_INC')) die('meh.'); -require_once(DOKU_INC.'inc/io.php'); -require_once(DOKU_INC.'inc/utf8.php'); -require_once(DOKU_INC.'inc/parserutils.php'); // set the minimum token length to use in the index (note, this doesn't apply to numeric tokens) if (!defined('IDX_MINWORDLENGTH')) define('IDX_MINWORDLENGTH',2); @@ -308,6 +305,8 @@ } unset($page_idx); // free memory + idx_saveIndexLine('title', '', $pid, p_get_first_heading($page, false)); + $pagewords = array(); // get word usage in page $words = idx_getPageWords($page); @@ -413,7 +412,58 @@ return join(':',$updated)."\n"; } +/** + * Get the list of lenghts indexed in the wiki + * + * Read the index directory or a cache file and returns + * a sorted array of lengths of the words used in the wiki. + * + * @author YoBoY <yoboy.leguesh@gmail.com> + */ +function idx_listIndexLengths() { + global $conf; + // testing what we have to do, create a cache file or not. + if ($conf['readdircache'] == 0) { + $docache = false; + } else { + clearstatcache(); + if (@file_exists($conf['indexdir'].'/lengths.idx') and (time() < @filemtime($conf['indexdir'].'/lengths.idx') + $conf['readdircache'])) { + if (($lengths = @file($conf['indexdir'].'/lengths.idx', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ) !== false) { + $idx = array(); + foreach ( $lengths as $length) { + $idx[] = (int)$length; + } + return $idx; + } + } + $docache = true; + } + if ($conf['readdircache'] == 0 or $docache ) { + $dir = @opendir($conf['indexdir']); + if($dir===false) + return array(); + $idx[] = array(); + while (($f = readdir($dir)) !== false) { + if (substr($f,0,1) == 'i' && substr($f,-4) == '.idx'){ + $i = substr($f,1,-4); + if (is_numeric($i)) + $idx[] = (int)$i; + } + } + closedir($dir); + sort($idx); + // we save this in a file. + if ($docache === true) { + $handle = @fopen($conf['indexdir'].'/lengths.idx','w'); + @fwrite($handle, implode("\n",$idx)); + @fclose($handle); + } + return $idx; + } + + return array(); +} /** * Get the word lengths that have been indexed. @@ -421,35 +471,27 @@ * Reads the index directory and returns an array of lengths * that there are indices for. * - * @author Tom N Harris <tnharris@whoopdedo.org> + * @author YoBoY <yoboy.leguesh@gmail.com> */ function idx_indexLengths(&$filter){ global $conf; - $dir = @opendir($conf['indexdir']); - if($dir===false) - return array(); $idx = array(); if(is_array($filter)){ - while (($f = readdir($dir)) !== false) { - if (substr($f,0,1) == 'i' && substr($f,-4) == '.idx'){ - $i = substr($f,1,-4); - if (is_numeric($i) && isset($filter[(int)$i])) - $idx[] = (int)$i; + // testing if index files exists only + foreach ($filter as $key => $value) { + if (@file_exists($conf['indexdir']."/i$key.idx")) { + $idx[] = $key; } } }else{ - // Exact match first. - if(@file_exists($conf['indexdir']."/i$filter.idx")) - $idx[] = $filter; - while (($f = readdir($dir)) !== false) { - if (substr($f,0,1) == 'i' && substr($f,-4) == '.idx'){ - $i = substr($f,1,-4); - if (is_numeric($i) && $i > $filter) - $idx[] = (int)$i; + $lengths = idx_listIndexLengths(); + foreach ( $lengths as $key => $length) { + // we keep all the values equal or superior + if ((int)$length >= (int)$filter) { + $idx[] = $length; } } } - closedir($dir); return $idx; } @@ -657,51 +699,6 @@ } return $words; -} - -/** - * Create a pagewords index from the existing index. - * - * @author Tom N Harris <tnharris@whoopdedo.org> - */ -function idx_upgradePageWords(){ - global $conf; - $page_idx = idx_getIndex('page',''); - if (empty($page_idx)) return; - $pagewords = array(); - $len = count($page_idx); - for ($n=0;$n<$len;$n++){ - $pagewords[] = array(); - } - unset($page_idx); - - $n=0; - foreach (idx_indexLengths($n) as $wlen) { - $lines = idx_getIndex('i',$wlen); - $len = count($lines); - for ($wid=0;$wid<$len;$wid++) { - $wkey = "$wlen*$wid"; - foreach (explode(':',trim($lines[$wid])) as $part) { - if($part == '') continue; - list($doc,$cnt) = explode('*',$part); - $pagewords[(int)$doc][] = $wkey; - } - } - } - - $fn = $conf['indexdir'].'/pageword'; - $fh = @fopen($fn.'.tmp','w'); - if (!$fh){ - trigger_error("Failed to write word index", E_USER_ERROR); - return false; - } - foreach ($pagewords as $line){ - fwrite($fh, join(':',$line)."\n"); - } - fclose($fh); - if($conf['fperm']) chmod($fn.'.tmp', $conf['fperm']); - io_rename($fn.'.tmp', $fn.'.idx'); - return true; } //Setup VIM: ex: et ts=4 enc=utf-8 :

つづく