(2005-08の一覧)
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

2005-08-20 Sat (他の年の同じ日: 2004 2006 2007)

今日の戦利品
2005-08-20-5 / カテゴリ: [diary][ぬいぐるみ] / [permlink]

友達と卓球してきた。革靴でやったから、マメできちゃったよ。。。

カウンター横でゲット(x2)
ブルーテディ

次の日、筋肉痛に…

fetchmailエラー cannot get a range of message sizes
2005-08-20-4 / カテゴリ: [linux][command][POP3][メール] / [permlink]

ここ数日、メールが全く届かないからおかしいなぁと思っていたら(個人メールはなくても、ML と spam は届くはず...orz)、fetchmail がエラー吐いていた。(というか全然気づかんかった...)
$ fetchmail 
fetchmail: 185 通のメッセージがアカウント zaki@mail.example.org , サーバ mail.example.org 宛に届いています。 (933330 バイト)
fetchmail: cannot get a range of message sizes (1-100).
fetchmail: クライアント/サーバプロトコルエラーが mail.example.org よりメールを 受信している最中に発生しました。
fetchmail: Query status=4 (PROTOCOL)
んぎゃぁ。

で、調べてみると、
http://lists.ccil.org/pipermail/fetchmail-friends/2003-October/008061.html
> This is the log:
fetchmail: cannot get a range of message sizes (1-14).

i have added fetchsizelimit 0 for this account and now it works (wasn't
necessary with 6.2.4)
新しい Bug なのね。

というか
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=323027
これかなぁ。

まぁ、
$ fetchmail --version
:
  Fetch message size limit is 100 (--fetchsizelimit 100).
:
と(そんな設定はしていないのに)なってるんで、.fetchmailrc に
fetchsizelimit 0
追加しておけば、とりあえず fetch できた。


数日前に、友人から結婚します(未来形)のご報告メールが...

alternativesアプリの変更
2005-08-20-3 / カテゴリ: [linux][debian] / [permlink]

x-terminal-emulator や x-www-browser 等のコマンドは、/etc/alternatives 以下に symlink があり、実態は rxvt や Eterm だったり、mozilla-firefox や galeon だったりする。
で、X の[ブラウザ]ボタンなんかでアプリを起動すると、大抵はここから起動されたりする。(…とりあえず、xfce4 on debian では)
また、単に emacs を実行すると、emacs20 だったり emacs21 だったり xemacs だったりするのも、この辺の設定。

で、これを確認・変更するには

# update-alternatives --display x-terminal-emulator
x-terminal-emulator - status is manual.
 link currently points to /usr/bin/Eterm
/usr/bin/krxvt - priority 9
 slave x-terminal-emulator.1.gz: /usr/share/man/man1/krxvt.1.gz
/usr/bin/crxvt - priority 8
 slave x-terminal-emulator.1.gz: /usr/share/man/man1/crxvt.1.gz
/usr/bin/grxvt - priority 8
 slave x-terminal-emulator.1.gz: /usr/share/man/man1/grxvt.1.gz
/usr/bin/Eterm - priority 10
 slave x-terminal-emulator.1.gz: /usr/share/man/man1/Eterm.1.gz
Current `best' version is /usr/bin/Eterm.
で、/usr/bin/Eterm になっている(2行目) 推奨は Eterm らしい(最後の行)
(つーか、ls -l /etc/alternatives/x-terminal-emulator でもいいけど)
また、Eterm 以外に設定できるターミナルエミュレータの候補として、krxvt, crxvt, grxvt が表示される。

候補リストを表示するだけなら
# update-alternatives --list x-terminal-emulator
/usr/bin/krxvt
/usr/bin/crxvt
/usr/bin/grxvt
/usr/bin/Eterm

設定(リンク)を変更するには
# update-alternatives --config x-terminal-emulator

There are 4 alternatives which provide `x-terminal-emulator'.

  Selection    Alternative
-----------------------------------------------
      1        /usr/bin/krxvt
      2        /usr/bin/crxvt
      3        /usr/bin/grxvt
*+    4        /usr/bin/Eterm

Press enter to keep the default[*], or type selection number:
となるので、krxvt に変更するには
Press enter to keep the default[*], or type selection number: 1
Using `/usr/bin/krxvt' to provide `x-terminal-emulator'.
と。

SMTPでNULL(0x00)文字を送信する
2005-08-20-2 / カテゴリ: [programming][perl][SMTP] / [permlink]

MUA(メーラ)や telnet じゃちょっと無理だけど、プログラム書いちゃえば簡単。
Net::SMTP, Mail::Sender, Mail::Sendmail の3つを試したが、どれも送信可能。RFC的にはコントロールコードを含むascii文字を送信して良いと読めるので、MTAは処理しなければならない…と思う。少なくとも、MTA が core 吐いて死んだりとかは NG でしょう。

RFC2821 4.5.2 Transparency より引用
   The mail data may contain any of the 128 ASCII characters. All
   characters are to be delivered to the recipient's mailbox, including
   spaces, vertical and horizontal tabs, and other control characters.

Net::SMTP版
use Net::SMTP;
$smtp = Net::SMTP->new("localhost",
                       Debug => 1) or die;
$smtp->mail('from@mail.example.org');
$smtp->to('to@mail.example.org');
$smtp->data();
$smtp->datasend("\x1\x0\x1");
$smtp->dataend();
$smtp->quit();

Mail::Sender版
use Mail::Sender;
$sender = new Mail::Sender{smtp => 'localhost',
                           from => 'from@mail.example.org'};
$sender->MailMsg({ to => 'to@mail.example.org',
                   msg => "\x1\x0\x1" });

Mail::Sendmail版
use Mail::Sendmail;
$Mail::Sendmail::mailcfg{mime} = 0;
sendmail( To => 'to@mail.example.org',
          From => 'from@mail.example.org',
          Message => "\x1\x0\x1" ) or die $Mail::Sendmail::error;

Mail::Sender は、デフォルトでは(MIME::QuotedPrintが使えれば)quoted-print エンコードして送信するので、mailcfg{mime} を false に設定する。

NTPを使ってマシンの時刻合わせ
2005-08-20-1 / カテゴリ: [linux][debian] / [permlink]

NTPサーバに問い合わせて、実行ホストの時刻を合わせる。
# aptitude install ntpdate
インストールと同時に、一旦時計あわせが実行される。

コマンドラインからの実行は
# ntpdate ntp1.jst.mfeed.ad.jp

# ntpdate -s ntp1.jst.mfeed.ad.jp
-s オプション付で、結果が syslog へ出力される。

debian的には、/etc/init.d/ntpdate にスクリプトが、/etc/default/ntpdate を見て実行できるみたいなので、/etc/default/ntpdate に NTP サーバを指定しておけばよいのかな。
NTPSERVERS="ntp1.jst.mfeed.ad.jp"
/usr/sbin/ntpdate はこのファイルを見るわけではないので注意。

あとは、/etc/cron.daily あたりに、/etc/init.d/ntpdate restart を実行するようにセットしておけばよいかな。
前の日 / 次の日 / 最新 / 2005-08

2013 : 01 02 03 04 05 06 07 08 09 10 11 12
2012 : 01 02 03 04 05 06 07 08 09 10 11 12
2011 : 01 02 03 04 05 06 07 08 09 10 11 12
2010 : 01 02 03 04 05 06 07 08 09 10 11 12
2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12

最終更新時間: 2013-05-02 16:12