2003-04-03(木) 晴 だけど肌寒い この日を編集
_ Windows サービス アプリケーション
UNIXで言うところのdaemonです。自作のWebサーバをサービスアプリケーションにしたところ、CGIが動かなくなってしまいました。CGIプログラムはC言語で書いているのですがfreadで制御が返ってこないようです。サービスにしなければ普通に動くので不思議です。
2005-04-03(日) 晴 安静時心拍数 56 この日を編集
_ portupgrade misc/gnome-icon-theme japanese/gaim textproc/libxml2 textproc/libxslt security/openssl misc/shared-mime-info
gnome-icon-theme-2.10.0 < needs updating (port has 2.10.1) ja-gaim-1.2.0 < needs updating (port has 1.2.0_1) libxml2-2.6.18 < needs updating (port has 2.6.19) libxslt-1.1.13 < needs updating (port has 1.1.14) openssl-0.9.7e_2 < needs updating (port has 0.9.7f) shared-mime-info-0.15_9 < needs updating (port has 0.16_1)
2006-04-03(月) 晴 安静時心拍数 63 この日を編集
_ MTA まわりの設定 失敗編
最近環境が変わり MTA も自分でいじれるようになった、ということと bsfilter の処理が重たいので、上流の MTA 側でなんとかしたいと思い、いろいろ試してみました。Windows 環境はあまり利用しないようにしているつもりなので anti-virus よりも anti-spam が重要なのですが、調べてみると amavisd-new の ports の依存関係で p5-Mail-SpamAssassin がインストールされるので一石二鳥です。
# portinstall security/amavisd-new
とするとデフォルトで MILTER "sendmail milter support" オプションが有効になっていますが、私は Postfix を使っているので外しました。依存関係のビルドが進んでいき p5-Mail-SpamAssassin のところでも OPTIONS があるのですが、ここではデフォルトのままにしておきました。しばらくするとインストールが終わります。
*******************************************************************
 To use amavisd-new, you need to install at least one virus scanner.
 The following virus scanners are available in the FreeBSD ports
 collection:
  
 /usr/ports/security/vscan      McAfee VirusScan
 /usr/ports/security/clamav     Clam Antivirus
 /usr/ports/security/f-prot     F-Prot Antivirus
 /usr/ports/security/drweb      DrWeb antivirus suite
  
 Enable amavisd-new in /etc/rc.conf with the following line:
  
    amavisd_enable="YES"
  
 If you want to use the amavis sendmail milter interface,
 you need the following additional line in /etc/rc.conf
  
    amavis_milter_enable="YES"
  
 Configuration templates are available in /usr/local/etc
 as amavisd.conf-dist, amavisd.conf-sample and amavisd.conf-default.
 Documentation is available in /usr/local/share/doc/amavisd-new.
*******************************************************************
と言われるので security/clamav をインストールすることにして /etc/rc.conf に
amavisd_enable="YES"
を追記します。設定フィルは
# diff -u /usr/local/etc/amavisd.conf{-dist,}
--- /usr/local/etc/amavisd.conf-dist    Mon Apr  3 22:23:07 2006
+++ /usr/local/etc/amavisd.conf Mon Apr  3 22:29:26 2006
@@ -17,7 +17,7 @@
 $daemon_user  = 'vscan';     # (no default;  customary: vscan or amavis)
 $daemon_group = 'vscan';     # (no default;  customary: vscan or amavis)
 
-$mydomain = 'example.com';   # a convenient default for other settings
+$mydomain = 'rtfm.jp';   # a convenient default for other settings
 
 $MYHOME   = '/var/amavis';   # a convenient default for other settings
 $TEMPBASE = "$MYHOME/tmp";   # working directory, needs to be created manually
@@ -96,8 +96,8 @@
 
 # $myhostname = 'host.example.com';  # must be a fully-qualified domain name!
 
-# $notify_method  = 'smtp:[127.0.0.1]:10025';
-# $forward_method = 'smtp:[127.0.0.1]:10025';  # set to undef with milter!
+$notify_method  = 'smtp:[xxx.yyy.zzz.www]:10025';
+$forward_method = 'smtp:[xxx.yyy.zzz.www]:10025';  # set to undef with milter!
 
 # $final_virus_destiny      = D_DISCARD;
 # $final_banned_destiny     = D_BOUNCE;
@@ -285,14 +285,14 @@
 # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/
 # ['Sophos SAVI', \&sophos_savi ],
 
-# ### http://www.clamav.net/
-# ['ClamAV-clamd',
-#   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
-#   qr/\bOK$/, qr/\bFOUND$/,
-#   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
-# # NOTE: the easiest is to run clamd under the same user as amavisd; match the
-# # socket name (LocalSocket) in clamav.conf to the socket name in this entry
-# # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"],
+### http://www.clamav.net/
+['ClamAV-clamd',
+  \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
+  qr/\bOK$/, qr/\bFOUND$/,
+  qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
+# NOTE: the easiest is to run clamd under the same user as amavisd; match the
+# socket name (LocalSocket) in clamav.conf to the socket name in this entry
+# When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"],
 
 # ### http://www.clamav.net/ and CPAN  (memory-hungry! clamd is preferred)
 # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
取り敢えずこんなかんじにしました。
$virus_admin = "virusalert\@$mydomain"; # notifications recip. $mailfrom_notify_admin = "virusalert\@$mydomain"; # notifications sender $mailfrom_notify_recip = "virusalert\@$mydomain"; # notifications sender $mailfrom_notify_spamadmin = "spam.police\@$mydomain"; # notifications sender
という記述があったので
# diff -u /etc/mail/aliases{.orig,}
--- /etc/mail/aliases.orig      Wed Mar  1 08:47:42 2006
+++ /etc/mail/aliases   Tue Apr  4 00:36:11 2006
(snip)
@@ -43,6 +45,8 @@
 tty:   root
 usenet: news
 uucp:  root
+virusalert:    root
+spam.police:   root
  
 # Well-known aliases -- these should be filled in!
 # manager:
(snip)
# newaliases
としておきました。次に clamav のインストールです。
# portinstall security/clamav
オプションがありますがデフォルトでインストールしました。/etc/rc.conf に
clamav_clamd_enable="YES" clamav_freshclam_enable="YES"
を追加して、設定ファイルを修正します。が、/usr/local/etc/clamd.conf は何もせずに大丈夫そうです。
# diff -u /usr/local/etc/freshclam.conf{.default,}
--- /usr/local/etc/freshclam.conf.default       Mon Apr  3 22:58:07 2006
+++ /usr/local/etc/freshclam.conf       Mon Apr  3 23:11:43 2006
@@ -52,7 +52,7 @@
 # Uncomment the following line and replace XY with your country
 # code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
 # Default: There is no default, which results in an error when running freshclam
-#DatabaseMirror db.XY.clamav.net
+DatabaseMirror db.jp.clamav.net
  
 # database.clamav.net is a round-robin record which points to our most
 # reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
としました。あとは README.postfix を参考にして
# diff -u master.cf{.orig,}
--- master.cf.orig      Mon Mar 27 22:45:14 2006
+++ master.cf   Tue Apr  4 00:56:39 2006
@@ -77,3 +77,17 @@
   flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
 bsmtp     unix  -       n       n       -       -       pipe
   flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
+smtp-amavis     unix    -       -       n       -       2       smtp
+        -o smtp_data_done_timeout=1200
+        -o disable_dns_lookups=yes
+localhost:10025 inet    n       -       n       -       -       smtpd
+        -o content_filter=
+        -o local_recipient_maps=
+        -o relay_recipient_maps=
+        -o smtpd_restriction_classes=
+        -o smtpd_client_restrictions=
+        -o smtpd_helo_restrictions=
+        -o smtpd_sender_restrictions=
+        -o smtpd_recipient_restrictions=permit_mynetworks,reject
+        -o mynetworks=xxx.yyy.zzz.www/32
+        -o strict_rfc821_envelopes=yes
# diff -u main.cf{.orig,}
--- main.cf.orig        Mon Mar 27 22:45:20 2006
+++ main.cf     Tue Apr  4 01:00:14 2006
@@ -642,3 +652,6 @@
 # readme_directory: The location of the Postfix README files.
 #
 readme_directory = no
+#
+#
+content_filter=smtp-amavis:[xxx.yyy.zzz.www]:10024
としておしまい。あとは
# /etc/rc.d/amavisd start Starting amavisd. # /usr/local/etc/rc.d/clamav-clamd.sh start Starting clamav_clamd. # /usr/local/etc/rc.d/clamav-freshclam.sh start Starting clamav_freshclam. # postfix reload postfix/postfix-script: refreshing the Postfix mail system
として起動。あれ?なんかうまくいってなさげ。。。また次回。参考
- http://d.hatena.ne.jp/stealthinu/20060110/p2
 - http://wiki.apache.org/spamassassin/IntegratedSpamdInPostfix
 - http://www.voyager.gr.jp/~sampei/freebsd/amavis.html
 - http://www.kobitosan.net/postfix/origdocs/install-sav.html
 - http://www.kncn.net/blog/item/502
 - http://www.aconus.com/~oyaji/suse9.3/amavisd-new_antivir_suse9.3.htm
 
2007-04-03(火) 雨ときどき曇 安静時心拍数 61 この日を編集
2008-04-03(木) 晴 安静時心拍数 60 この日を編集
_ AsiaBSDCon 2008の手提げの再利用
兵糧切れになってしまったため買い物に出かけようとしたのですが、ふとAsiaBSDCon 2008の手提げが目に付きました。この手提げには資料やちらしが入っていたのですが捨ててしまうには勿体無いですし、いつまでもレジ袋では偽善者の名を汚しますので、お買い物袋として再利用してみることにしました。
袋は結構深いので、2kgのお米の袋もすっぽり入って余裕です。ねぎなど入れてみるとその深さが分かりやすかったかもしれませんが、2本で198円もするので買えません。
街で見かけても声を掛けないでください。
2009-04-03(金) 晴 安静時心拍数 54 この日を編集
_ JTableで右クリックメニューを表示する
やりたかったことがそのまま載っていたのでメモ。セルの値によってメニューを表示したりしなかったりするにはJTable.getValueAt()で値を取ってきてJMenuItem.setVisible(false)でいいのかな?
2010-04-03(土) 曇のち晴 安静時心拍数 60 この日を編集
_ 
フリー~〈無料〉からお金を生みだす新戦略(クリス・アンダーソン/小林弘人/高橋則明)
商売のからくりが分かりました。ビット経済においては損して得取れが成り立つのかもしれません。それにしてもビット経済というビットの使い方は良いとしても、アトム経済のアトムってのが良く分からん。デジタル経済とアナログ経済と読み替えるといいのかもしれませんが著者の意図に反するかもしれないので参考までに。
第16章でシェリル・クロウやビルゲイツの意見への反論(?)は面白いですね。本の内容を踏襲して返答していると言えばそれまでなのですが、真っ先にこの箇所だけを読むと「ああ言えば上祐」的なものにも見えなくもないのがなんとも。しかし、これからのトレンドを考えるとビット経済はそうなのかもしれません。
_ 
プロの課題設定力(清水 久三子)
世に知られている物事を良く纏めたなぁといった感じの本で内容としては新しいことは全く書かれていません。例は良くできていますがあくまでも例です。まずは思考のトレーニングってものが必要なのかもしれません。
2012-04-03(火) この日を編集
_ 
Jenkins実践入門 ~ビルド・テスト・デプロイを自動化する技術 (WEB+DB PRESS plus)(佐藤 聖規/和田 貴久/河村 雅人/米沢 弘樹/山岸 啓/川口 耕介)
	
		
		
			Jenkins実践入門 ~ビルド・テスト・デプロイを自動化する技術 (WEB+DB PRESS plus)技術評論社
¥ 2,919
2013-04-03(水) この日を編集
_ 日経平均ボラティリティー・インデックスのローソク足
日経平均ボラティリティー・インデックスで公表されている日次データ(nikkei_stock_average_vi_daily_jp.csv)を読み取り,ローソク足を描くという簡単なコードです.が R をやりこんでいる訳ではないのでハマりました. まず,nikkei_stock_average_vi_daily_jp.csv の最終行に "本資料は日経の著作物であり、本資料の全部又は一部を、いかなる形式によっても日経に無断で複写、複製、転載または流布することができません。" という文字列があるので,正確には csv のフォーマットにはなっていません.なので,一度 data.frame で読み込んでから df[1:nrow(df)-1,] として最終行を切り落とし,xts に変換しています.もっとうまいやり方があれば教えてください.
参考
以下を参考にさせていただきました.
PRESIDENT (プレジデント) 2007年 4/16号 [雑誌]
		
		
28歳貯金ゼロから考えるお金のこと(田口 智隆)
		
住宅ローンはこうして借りなさい[改訂3版](深田 晶恵)
		
勝ち切る投資 お金の神様2(中原 圭介)