hns - 日記自動生成システム - Version 2.19.9

先月 2001年10月 来月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2001年10月17日(水) 旧暦 [n年日記]

#1 [Namazu] こわれた bzip2 形式を読むと ?

I try to index some files (8000+ for that matter) and mknmz fails with a broken bzip2 compressed file. Exit code was 141.
というメールが来ている。虫のような気がする。 bzip2 って何だっけ。

#2 [Emacs] w3 が Meta tag を見ていないのかな

を w3-4.0(cvs, 2001/10/15) で見ると、文字が読めない。 telnet で取って来たら、次のようなもの
...
Content-Type: text/html

<!-- MHonArc v2.4.6 -->
<!--X-Subject: 日本語ファイルを保存したら、文字が消えた??? -->
...
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML LANG="ja">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=EUC-JP">
c-u r euc-japan しても、やはり読めない。 M-x describe-current-coding-system すると euc-japan になっていない。
Coding system for saving this buffer:
  J -- iso-2022-jp (alias: junet)
Default coding system (for new files):
  J -- iso-2022-jp (alias: junet)

試しに 2001/07 版 + 私家版変更に戻して見たが:

Debugger entered--Lisp error: 
(wrong-type-argument number-or-marker-p nil)
  +(nil 12)
  font-spatial-to-canonical("+12pt")
  css-expand-length("+12pt" t)
  css-expand-value(height "+12pt")
  css-parse-args(238 257)
  css-parse("file:/usr/local/share/default.css" nil nil)
これは 2001/04/17 #3 に同じことが書いてある。default.css を変更してしのいで いたのを忘れていた。「新しい版ではこんな小細工は必要ない」かな。
こちらの古い方が快適。CharSet を何にしても読める。不思議。
w3-4.0 cvs ってメーリング・リストがないのかな。

#3 [Network] ipnat

NetBSD/1.5E の上で作業
/etc/rc.conf に
ipfilter=YES   
  と書いておいて ipfilter を生かす。
             (しかし /etc/ipf.conf は空にしておく)
ipnat=YES   
  も書いておく
...
Enabling ipfilter.
IP Filter: v3.4.9 initialized.  Default = pass all, Logging = enabled
Installing NAT rules ... 0 entries flushed from NAT table
...
/etc/ipnat.conf を設定して

map de0 192.168.48.120/24 -> 210.145.40.120/32 proxy port ftp ftp/tcp
map de0 192.168.48.120/24 -> 210.145.40.120/32 portmap tcp/udp 10000:40000

touch  /etc/ipf.conf
ipnat -f /etc/ipnat.conf
ちょっと直したりして、初めからということであれば
makoto@komekome  12:22:09/011017(/var/log)# ipnat -C
3 entries flushed from NAT list
makoto@komekome  12:22:12/011017(/var/log)# ipnat -f  /etc/ipnat.conf
makoto@komekome  12:22:18/011017(/var/log)# ipnat -ls
mapped  in      313     out     418
added   147     expired 146
no memory       0       bad nat 0
inuse   1
rules   3
List of active MAP/Redirect filters:
map de0 192.168.48.0/24  -> 210.145.40.120/32  proxy port ftp ftp/tcp
map de0 192.168.48.0/24  -> 210.145.40.120/32  portmap tcp/udp 272:40000

List of active sessions:
MAP 192.168.48.105  50255 <- -> 210.145.40.120  50255 [210.145.40.114 80]
makoto@komekome  12:22:23/011017(/var/log)# 
de0 と書いてあるものは 外側の i/f。 初め内側の ne0 と書いていて、動かないと悩んでいた。
これって最近移動してしまったという話が。 (20010801 -> 入っている /sbin/ipf) 多分
  • ipnat (IP address 変換) を使うには ipfilter も生かす
  • ipfilter(/etc/ipf.conf) ipnat (/etc/ipnat.conf) それぞれを設定する必要がある。
  • ただし実際問題として ipnat だけを使うなら ipfilter の設定 (ipf.conf) は空にしておけば良い ( 「pass in all 」と書いたのと同じ)
  • これらは kernel の表を書換えるというような作業。ps ax で見えたりはしない。 ipnat の方は ipnat -l, ipnat -s, ipnat -ls などで設定の状態が見える
  • kernel の ip forwarding を生かしておく
    • sysctl -w net.inet.ip.forwarding=1 か、または
    • /etc/sysctl.conf に
      net.inet.ip.forwarding=1
      
      と書いておく

ipfilter:

ipnat でなくて ipfilter の方は、もう少し面倒 (これは cisco IOS の世界)

#4 [Namazu] filter が正常終了しなかった時

mknmz の 815 行目付近で、
eval '$err = ' . $var::REQUIRE_ACTIONS{$mtype} .
  '::filter($orig_cfile, $contref, $weighted_str, 
                                             $headings, $fields);';
if ($err) {
	return ($file_size, $file_size, 0, "$mtype; x-error=$err");
}
となっているのに、bzip2.pl の方で、
{
    my $fh = util::efopen("|$bzip2path -d > $tmpfile");
    print $fh $$cont;
}
util.pl の方で、
sub efopen ($) {
    my ($fname) = @_;
    my $fh = fopen($fname) || cdie("$fname: $!\n");
    return $fh;
}
となっていては、そこで終ってしまう。
やはり Perl 的には、正常終了で non 0, 問題がある時は undef or 0 を返す ようにした方がいい。
util::efopen
    my $fh = fopen($fname) || print ("$fname: $!\n") && return 0;
filter
    my $fh;
    if ($fh = util::efopen("|$bzip2path -d > $tmpfile")) {
        print $fh $$cont;
    }
    else {
       return 0 }
filter あるいは
    my $fh = util::efopen("|$bzip2path -d > $tmpfile");
    if (!$fh) { return 0}
でいいような気がする。(だめ。 file handle が返せない)
grep util::efopen */* |wc
すると 74 箇所もある。
ところが、現在のやり方は、error message を戻したいということがあって、 そこまで変えるかという気がする。
しかし、 やはり file handle も返したい。誤り文も返したいというのは無理な注文。 (だから、今までは cdie していた)
誤り文って $! に 代入してしまえばというのはどう ?

試して見ているが、:

表示がうまくない。でも、一応 「file がこわれていても無視して通過する」という 目的は達成しているという説もある。
// 検出された形式: application/x-gzip
@@ 部品: gzip.pl
// tmpnam: index/NMZ.gzip.tmp
@@ Processing gzip file ... (using  '/usr/bin/gzip')
gzip: stdin: unknown method 126 -- get newer version of gzip
// 検出された形式: text/plain
// pre_codeconv
// load_document 実行後: /tmp/test/index.html.gz: 190, 0, 0, text/plain
1/2 - /tmp/test/index.html.gz は大きさが 0 なので無視します
これでは何が問題なのかは個別に gunzip して見ないと分らないが。



最近の日記
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
2024年02月29日
opendkim and senmail
2024年01月24日
chat/iam 0.0.8
2024年01月21日
uselocale vs setlocale (textproc/R-readxl)
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)