Mr.Tブログを復活させるべくWordPress2.8.6を実家サーバーに入れてみる。
インストール
$ sudo apt-get install libapache2-mod-php5 php5-mysql$ mysqladmin -uroot -p create mrt
$ mysql -uroot -p -e "grant all on mrt.* to mrt@localhost identified by 'unk';"$ wget http://ja.wordpress.org/wordpress-2.8.6-ja.zip
$ unzip wordpress-2.8.6-ja.zip
$ mv wordpress mrt
$ cd mrt
$ cp wp-config-sample.php wp-config.php
$ sudo chown deployer:www-data wp-content
$ chmod g+w wp-content
できた。
ネットワーク
プライベート
192.168.0.1
255.255.255.0
グローバル
219.117.237.232 - 219.117.237.239
255.255.255.248 / 29
DHCP
192.168.0.? - 192.168.0.?
| Hostname | Reading | Private IP | Global IP | Memory | Swap | HDD | OS | Description |
|---|---|---|---|---|---|---|---|---|
| rooter | 192.168.1.1 | 202.61.22.113 | ルーター | |||||
| komagata | コマガタ | 192.168.1.100 | 無線LANアクセスポイント | |||||
| arial | アリアル | 192.168.1.101 | 219.117.237.234 | 8GB | 512MB | 8GB | Debian Lenny | Domain0 |
| lucida, storage | ルーシダ | 192.168.1.102 | 219.117.237.235 | 512MB | 256MB | 1TB | Debian Lenny | ファイルサーバー、リポジトリ |
| courier | クーリエ | 192.168.1.103 | 219.117.237.236 | 6GB | 3GB | 500GB | Debian Lenny | ステージング、開発 |
| verdana | ベルダナ | 192.168.1.104 | 219.117.237.237 | 512MB | 256MB | 100GB | Debian Lenny | BTS、ツール |
| helvetica | ヘルベティカ | 192.168.1.105 | 219.117.237.238 |
実家のサーバー(Debian lenny)にRemedie入れたら、動いたんだけどOPMLインポートしてアクセスすると落ちる。
動いてるヤツのremedie.db持ってこようかな?
$ perl bin/remedie-server.pl
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
HTTP::Engine::Interface::AnyEvent : You can connect to your server at http://0.0.0.0:10010/
We won't be doing any rendezvous publishing, please install a Net::Rendezvous::Publish::Backend:: module
We won't be doing any rendezvous publishing, please install a Net::Rendezvous::Publish::Backend:: module
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
"unicode" attribute will be deprecated. Use "sqlite_unicode" instead. at /usr/local/lib/perl/5.10.0/DBI.pm line 708.
Malformed UTF-8 character (fatal) at /usr/local/lib/perl/5.10.0/XML/LibXML/Error.pm line 217. at /usr/local/share/perl/5.10.0/HTML/TreeBuilder/LibXML.pm line 59
[Perl] Google Web Search API検索処理サンプル Kawa.netブログ(川崎有亮)/ウェブリブログGoogle Web Search API のサンプルコードもメモしておく。
Perlの場合は、SOAP::Liteモジュールを使うのがカンタン。
『link:www.kawa.net』 のリンク元検索をはじめ、特殊な検索も可能。(中略)(以下コメント欄)
SOAP::Liteモジュールの保存場所など設定の詳細がさっぱりわからないです。どうしても、このサンプルを実行できないです…
何か、保存場所が決まっていたりしていますか?ゆうすけさんがここにお示しになっているサンプルを改良すればどうにかなると思ったのですが、なにぶんGoogle Web Search API の詳細がわからない&期限が迫っているという状況で、もう困り果てています。よりによって、ゆうすけさんがお示しになっているサンプルすら実行できないですから…
よろしければ、以下のメールアドレスにGoogle Web Search API によって取得した検索結果の「上位100件取得」「それぞれ100文字取得」をテキストデータとして取得するということを達成するプログラムのサンプルを示してくださるとありがたいですが…もう切羽詰ってます…
dinamo_moskvaあっとhotmail.com
あっとは勿論@に直してください。よろしくお願い申し上げます。頼りにしてます…
勉強中の人
2006/08/21 09:55
サンプルスクリプトのソースコード中の『->』は『->』です。
たぶん、このブログのシステムの関係で化けてしまってますね。コマンドラインから
『perl -MSOAP::Lite -e "print($SOAP::Lite::VERSION)"』
を実行してみた結果はいかがでしょうか?また、SOAP-Lite-0.69.tar.gzをダウンロードした場合は、
libディレクトリ内のすべてのサブディレクトリ(SOAPなど)を
上記Perlスクリプトと同じディレクトリ(カレント)に置けば、 バージョン0.69を利用することができます。どのようなエラーが表示されるのでしょうか。
それとも、何も表示されない?
サマリ(おおむね先頭100文字相当)は $item->{snippet} で取り出せるので
そんなに難しくないと思います。がんばってください。ゆうすけ
2006/08/21 12:42
川崎ゆうすけさんは神か仏かゴータマ・シッダールタか。(重複)
兄貴ぃ(川崎さん)!俺にやらせてつかあさいっ!俺が必ずヤツのタマ取ったりますけん!
% wget "http://localhost:10010/rpc/collection/opml" -O remedie.opml
便利ー。sqlite3だからremedie.dbを直接コピーでもいいかも。
参照:コマンドラインでRemedieのRPC叩いて登録チャンネルリストをOPMLファイルに取っておく - otsune's SnakeOil - subtech
tridentをGem化してリリースしました - Hello, world! - s21gtridentは、 tail -f log/development.logと autotest、script/console を一枚の端末上で同時に実行するRailsプラグインでした(trident: tail -f, autotest and script/console at once参照)
便利すぐる。使わない人には宗教上の理由が必要ですね?
% trident
Rendered cemeteries/_cemetery (0.00263)
Rendered shared/_page_header (0.00083)
Rendered shared/_header_other (0.00068)
Prefecture Load (0.000395) SELECT * FROM `prefectures` WHERE (`prefectures`.`id` IN (10,11,12,13,14,19,22,23,26,27,28,29))
CACHE (0.000000) SELECT * FROM `costs`
Character Load (0.000364) SELECT * FROM `characters`
Character Columns (0.001453) SHOW FIELDS FROM `characters`
Rendered cemeteries/_finder (0.01049)
Rendered shared/_page_footer (0.00073)
Completed in 0.19417 (5 reqs/sec) | Rendering: 0.12335 (63%) | DB: 0.02105 (10%) | 200 OK [http://tsuisumi/cemeteries]
Loading development environment (Rails 2.0.2)
loading autotest/rails_rspec
./vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb:17: warning: method redefined; discarding old group_by
./vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb:8: warning: discarding old start_with?
./vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb:9: warning: discarding old end_with?
SQL (0.000168) SET NAMES 'utf8'
SQL (0.000089) SET SQL_AUTO_IS_NULL=0
SQL (0.097719) SELECT version FROM schema_info
>> Cemetery.find(1).name
Cemetery Columns (0.028357) SHOW FIELDS FROM `cemeteries`
Cemetery Load (0.000333) SELECT * FROM `cemeteries` WHERE (`cemeteries`.`id` = 1)
=> "駒形霊園"
Railsで都道府県のfixtureをcsvで作ってあったんだけどymlにしたかったのでpythonの勉強のためにpythonで書いてみた。
#!/usr/bin/env python
import sys
import csv
if (len(sys.argv) < 2):
print 'Usage: %s ' % sys.argv[0]
quit()
csv_file = sys.argv[1]
filename, suffix = csv_file.split('.')
reader = csv.reader(file(csv_file, 'r'))
i = -1
res = []
for row in reader:
i += 1
if i == 0:
column = row
continue
s = filename + str(i) + ":\n"
for j in range(len(column)):
s += " " + column[j] + ": " + row[j] + "\n"
res.append(s)
f = open(filename + ".yml", 'w')
f.write("\n".join(res))
f.close()
基本的な構文もわかってないので時間がかかりました。ただ、quickrun.vimを入れたら¥rで即座に実行してくれるので、「こんな感じかな?」と気軽に実行できるのが便利でした。
糞ダサイコードになってると思うのでどなたか添削いただければ幸いです・・・。
このブログ更新したらエラーが。
SQLite3::BusyException (database is locked):
timeoutをどんだけ増やしてもダメ。
% sqlite3 production.sqlite3 vacuum
SQL error: disk I/O error
passengerが掴んでるのか知らんけど、ロックしてるプロセスはどうやって探せば良いんだろう?
% cp production.sqlite3 foo
% rm -f production.sqlite3
% mv foo production.sqlite3
とりあえずコピーして削除したらロック消えた・・・。
% stat -c '%s' production.sqlite3
2905088
% sqlite3 production.sqlite3 vacuum
% sqlite3 production.sqlite3 reindex
% stat -c '%s' production.sqlite3
2865152
ついでにvacuumしたけどあんまりサイズ減らないなあ・・・。


