goo blog サービス終了のお知らせ 

TECH日記

技術の薀蓄

記事のタイトルを入力してください(必須)

2011-01-03 23:42:35 | Weblog
この何日のメモ


■メデア・プレーヤ再挑戦
marshal mal-mp01hdbを買って試した。幾つか問題があった。一番大きいのは途中でフリーズして勝手に再起動。ネットワーク使えるがsambaやftpではなく、UPnpの共有のみを利用できる、またyoutubeにアクセスできない。結局返品した、さすがヨドバシ、ご迷惑をおかけしました。

http://www.marshal-no1.jp/products/MAL-MP01HDB.html

いいところもいっぱいあるから、リモコンあること、字幕利用できること、文字コード変えられること、テレビ選ばないこと、内蔵DISKなど便利なこと。


■コンデンサ液漏れ
前から不調したdell dimension 4500cの原因わかった。マザーボードのコンデンサが寿命のようだ。以下のサイトを参考に交換を試みたが、30Wのはんだこてどうも温度足りなくて、取れなかった。

コンデンサ交換
http://www.slotware.net/blog/



■ディスククロン
ノートのCドライブ急にアクセス不能になった、メーカーイメージから12分で戻したものの、windows updateなど6時間もかかった。ので、せめてSP3+virus baster+無線LANドライバ入れた状態でのイメージがあればと。とはいえ、5年一回の入れ替えのため、無駄でしょうかね。

まとめサイト
http://www.techmixer.com/free-hard-disk-image-and-disk-cloning-software/

これを決めた理由は使いやすそう
http://redobackup.org/

fail to run GV-BCTV5/USB on vista 64

2008-10-04 01:23:43 | Weblog
inf file download from iodata not support vista,

change Bt5usb.inf like this
-----------------------------------
[Manufacturer]
%IODATA%=IODATA, ntx86, ntamd64

[IODATA.ntx86]
%P0506.DeviceDesc% = P0506.Install.NT,USB\VID_04BB&PID_0506

[IODATA.ntamd64]
%P0506.DeviceDesc% = P0506.Install.NT,USB\VID_04BB&PID_0506
-----------------------------------

this makes installer work, but failed run.
looks like the driver binary not work.

so. failed

porting a c/c++ prog from linux/gcc to HP-UX/aCC

2008-09-09 01:14:05 | Weblog
# how to porting a c/c++ prog from linux/gcc to HP-UX/aCC

#use this compiler
export CC=cc
export CXX=aCC

# to find compile options for a c++ program
export CXXFLAGS='-g -AA -N'

# there are 4 set include files in HP-UX
# to use ICU package, make a symble link first
ln -s /usr/local/include/unicode /opt/aCC/include_std

# this cause a compile error
static const UChar WCH_DOT = L'.';

# don't forget this
export ORA_NLS10=/opt/oracle/product/10.2.0/nls/data
export ORACLE_SID=CRM01
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10.2.0
export NLS_LANG=Japanese_Japan.JA16SJIS

# for c/c++ many header files are necessary

# for c/c++ struck can not omit
struct flock lock;

# max_element not defined error, need
#include <IOSTREAM.H>


# 32bit program link with oracle should use lib32 folder
Can't find library or mismatched ABI for -lclntsh

# make are different from gmake
$<

# can not use "string::erase(0)"
# use it as "string::erase()"


# !!!!! FILENAME_MAX has only 14byte
# I use PATH_MAX instead


# mkstemp reuse same temp file name,
# if you remove it


# no enough memory
maxdsiz 4194300

# use sam to config system parameters
maxtsiz 1073741824
maxmsiz 401604608

# use -N on compiler

# ps command need this to work like linux
export UNIX_STD=2003

# usleep(x) not work if x > 1000000






install 32bit print driver on 64bit vista

2008-09-09 00:28:26 | Weblog
to install 32bit type 3 print driver for canon 560i on 64bit vista

1. download 32bit driver from canon homepage
http://download.canon.jp/pub/driver/bj/winxp/wxp560i173e.exe

2. rename wxp560i173e.exe to wxp560i173e.exe.zip
and expend it with any zip utility.

3. fix 560i.inf
find "Canon PIXUS 560i" in section [Canon.NTx86.5.1]
change it to "Canon Inkjet PIXUS 560i"
note. make a backup copy 1st.

4. open control panel -> printer -> share -> add driver -> x86
select 560i.inf
to the warning message, click yes as your own risk.

5. from a 32bit client, ex. windows xp, open the shared printer and print a test page.

function step counter for c/c++

2008-04-05 14:30:38 | Weblog
関数レベルのステップ数を数えてくれるツールを探していたが、
ccccに気づいた。

もっと高度なこといろいろやってくれる。

本家
http://sourceforge.net/projects/cccc/

レポートの説明
http://x68000.q-e-d.net/~68user/unix/pickup?cccc

TODO
・引数にソースファイル名だが、プロジェクト丸ごと渡す方法が必要。
・関数一覧をexcelに整理する方法の整備

gcc on AIX

2008-03-25 01:10:26 | Weblog
昔からi○m toolboxを信用してgccを入れようとしても
入れられなかった時代があったが、つい別のサイトを見つかった。

http://www.perzl.org/aix/index.php?n=Main.Gcc

ここからdownloadすれば、なんの抵抗もなくaixでもgccが動かせる。


あ、感動。


ちなみに、toolboxのバージョンを使うと
ただのhello worldでもこんな感じなエラーが出る

ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char, std::char_traits& std::operator<< >(std::basic_ostream<char, std::char_traits&,char const*)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status

要するに libstdc++.a 正しくないとかの話だ。


ついでに、いつも忘れるrpmの利用法もメモしとく
rpm -qa インストール済みのを一覧
rpm -ql <ライブラリ名> ライブラリ内ファイル一覧
rpm -qf <ファイル名> ファイルはどのライブラリのものかを調べる

http://www.a-yu.com/system/rpmc.html

mkstemp() for win32

2008-01-26 09:25:47 | Weblog
仕様
http://www.linux.or.jp/JM/html/LDP_man-pages/man3/mkstemp.3.html

実装Hint
16進数を使うのは頭いいですね
http://lists.osuosl.org/pipermail/darcs-devel/attachments/20050127/ef5b98af/
attachment.bin

GetTempFileName()関数を考えてが、フォルダー文字("\")の問題であきらめた
http://www.ipa.go.jp/security/awareness/vendor/programmingv2/contents/c603.h
tml
http://nienie.com/~masapico/api_GetTempFileName.html

乱数の初期化
自分で考えたが、同じやり方みたい
http://www9.plala.or.jp/sgwr-t/lib/srand.html

Printf
http://www.linux.or.jp/JM/html/LDP_man-pages/man3/snprintf.3.html


ソースコード
// license free and risk free
// 自由に使っていいですが動作保障しません
int mkstemp(char *temp)
{
// 乱数を初期化(最初のみ)
static bool rand_seed_done;
if(!rand_seed_done)
{
srand((unsigned)time(NULL));
rand_seed_done = true;
}

// 空引数禁止
if(!temp) { return -1;}

// 最後6文字がXかを確認
size_t len = strlen(temp);
if(len <6 || strcmp(temp+len-6, "XXXXXX") ) // 最後6文字X以外はダメ
//errno = EINVAL;
return -1;
}

// ファイル名作成
_snprintf(temp+len-6, 2,"%02x", rand()); // 引数が定数の場合
ここでエラー
_snprintf(temp+len-4, 2,"%02x", rand());
_snprintf(temp+len-2, 2,"%02x", rand());
*(temp+len) = 0; // 念のため

return open(temp, O_CREAT | O_RDWR, 0666);
}


もう少し頑張ればちゃんとしたファイル名もつくれるけどね。まぁいいか

can not access saamba on redhat as 5

2008-01-02 23:41:53 | Weblog
start samba service on redhat as 5, but can not access it from windows box, got this errors in server log


smbd/service.c:make_connection_snum(1003) does not exist or permission denied when connecting to Error was 許可がありません

[2007/12/26 16:03:24, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:24, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:24, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:24, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:24, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:25, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:25, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:44, 0] smbd/service.c:make_connection_snum(1003) '/home/izaoi' does not exist or permission denied when connecting to [izaoi] Error was 許可がありません
[2007/12/26 16:03:44, 0] smbd/service.c:make_connection(1191) fm-198778267 (10.68.80.72) couldn't find service izayo

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

see audit.log, found this:

type=AVC msg=audit(1198654162.789:143): avc: denied { search } for pid=6780 comm="smbd" name="home" dev=dm-0 ino=983041 scontext=root:system_r:smbd_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1198654162.789:143): arch=40000003 syscall=195 success=no exit=-13 a0=9248668 a1=bfe62d30 a2=3eaff4 a3=bfe62d30 items=0 ppid=6767 pid=6780 auid=0 uid=500 gid=0 euid=500 suid=0 fsuid=500 egid=500 sgid=0 fsgid=500 tty=(none) comm="smbd" exe="/usr/sbin/smbd" subj=root:system_r:smbd_t:s0 key=(null)
type=AVC msg=audit(1198654182.373:144): avc: denied { search } for pid=6780 comm="smbd" name="home" dev=dm-0 ino=983041 scontext=root:system_r:smbd_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1198654182.373:144): arch=40000003 syscall=195 success=no exit=-13 a0=928e248 a1=bfe62d30 a2=3eaff4 a3=bfe62d30 items=0 ppid=6767 pid=6780 auid=0 uid=500 gid=0 euid=500 suid=0 fsuid=500 egid=500 sgid=0 fsgid=500 tty=(none) comm="smbd" exe="/usr/sbin/smbd" subj=root:system_r:smbd_t:s0 key=(null)


Answer: the Firewall named SELinux is running, and block the connect.

to stop it, use this command


getenforce で確認
setenforce 0 で停止

ref
http://kajuhome.com/cgi-bin/patio/patio.cgi?mode=view&no=928
http://homepage.dynalias.net/linux/archives/2005/12/selinux.html

p3006854 == libcwait

2007-12-22 21:27:58 | Weblog
title: p3006854_9204_LINUX.zip == compat-libcwait-2.1-1.i386.rpm
when install oracle 9i on redhat as 3,
need patch 3006854 to fix a bug in libwait.so first.

but the patch can be found only for users who paid for oracle support.

it looks like update libwait can fix due to this also.

compat-libcwait-2.1-1.i386.rpm



but i can not found the on the net also...

install pop3 on redhat as 4

2007-12-14 22:32:06 | Weblog
必要モジュール
cyrus-imapd-2.2.12-3.RHEL4.1.i386.rpm <-- imap/pop3サーバー
dovecot-0.99.11-4.EL4.i386.rpm <-- これは別のpop3
サーバーだが、今回要らない
cyrus-imapd-utils-2.2.12-3.RHEL4.1.i386.rpm <-- pop3サーバー管理用ツール
perl-Cyrus-2.2.12-3.RHEL4.1.i386.rpm <-- 管理ツールのために、これ
が先に入れる
sendmail-cf-8.13.1-3.RHEL4.5.i386.rpm <-- sendmailサーバーの管理
ツール

こいつら皆CD4にある
rpm -i でインストール
rpm -qlp で内容確認


入れた後にこの手順に従う
http://kbase.redhat.com/faq/FAQ_81_5254.shtm
が、簡単に記述する


-------------------------------------------------------
service cyrus-imapd start でpop3を起動する
-------------------------------------------------------

認証サービスないとこのように怒られる
-ERR [AUTH] Invalid login

/var/log/maillog にこんな感じで
... no mechanism available
... SASL(-1): generic failure: checkpass failed

-------------------------------------------------------
service saslauthd start で認証サービスを起動する
-------------------------------------------------------

メールボックスつくらないとまた怒られる
Unable to locate maildrop for xxx: Mailbox does not exist
-ERR [SYS/PERM] Unable to locate maildrop: Mailbox does not exist

いやだね、昔inetd.confに入れるだけなのに、面倒くさぇ

-------------------------------------------------------
cyradm --user xxx localhost でユーザーxxxとしてログイン
パスワード聞
かれる、これで自分で作るの?全員
社長に殺され
るぞ
localhost.localdomain> cm user.xxx
作成はuser.
を前につける必要がある
localhost.localdomain> quit
-------------------------------------------------------


作ったが、sendmail受信したメールはこちらにまわすようにする必要がある。
/etc/mail/sendmail.mc を編集、一番最後に2行コメント、2行追加
-------------------------------------------------------
dnl MAILER(smtp)dnl
dnl MAILER(procmail)dnl
define(`confLOCAL_MAILER', `cyrus')
MAILER(`cyrus')
-------------------------------------------------------

/etc/mail/sendmail.cfをバックアップを取てね、失敗する可能性があるから
これを実行すると設定ファイル再作成される
-------------------------------------------------------
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
-------------------------------------------------------

service sendmail restart sendmailを再起動する


それでもだめよ、sendmailが外部からの送信を受け付けない
それは先のファイルに一行の設定がある
/etc/mail/sendmail.mc を編集、1行をコメント。結果はこんな感じ
-------------------------------------------------------
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
-------------------------------------------------------

service sendmail restart sendmailを再起動する


boot時起動するように設定
chkconfig saslauthd on
chkconfig cyrus-imapd on
chkconfig sendmail on <-- 普通既に on になっているからいらない


ここまでくればoutlookなどでテスト送信すればよいが、
途中では telnet server_name 110 でテスト可能

例:受信
telnet testserver 110
+OK localhost Cyrus POP3 v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1 server ready
<2133890909.1197629206@localhost>
user xxx
+OK Name is a valid mailbox
pass xxxxxx
+OK Mailbox locked and ready
list
+OK scan listing follows
.
quit
+OK

例:送信
telnet testserver 25
220 localhost.localdomain ESMTP Sendmail 8.13.1/8.13.1; Fri, 14 Dec 2007
19:
49:00 +0900
mail from:xxx@somewhere
250 2.1.0 xxx@somewhere ... Sender ok
rcpt to:xxx
250 2.1.5 xxx... Recipient ok
data
354 Please start mail input.
subject:hello world
mars
.
250 Mail queued for delivery.
quit
221 Closing connection. Good bye.


参考pop3用コマンド
http://tools.ietf.org/html/rfc1939

送信コマンドはhelpで見れる

p5b mother board error Chassis intruded!

2007-09-10 22:30:23 | Weblog
再起動すると3回に2回このエラーが起きる

------------------------------------
Chassis intruded!
Fatal Error ... System Halted.
------------------------------------

解決法:
 最新のbiosに更新する

使っていた(問題がある)bios: 0701 10/02/06
更新後の(問題ない)bios: 1102 01/30/07 or 1604 2007/07/13

間違い:
ハードディスク問題と勘違いした 

vistaでwindows media 11の設定について

2007-09-10 21:52:59 | Weblog
codec
dixv[4] 基本codec、
xp code pack[1] 追加いろいろ

字幕
 sub/idxは vsfilter[5]を使用するが最新の2.37は使えない、2.33はできる[2]

 注意:
 誤って2.37を使用したら字幕どころか、画像もでなくなる。駆除方法は
 
regsvr32 /u VSFilter.dll

もしエラー0x80070005がでたら権限の問題[3]、コマンドプロンプトを探して右クリックで管理者で実行してから以上のコマンドを発行すること。

エラー
  その後エラーが発生し、ffdshow-truouts[6]が推奨された

参考資料
1.http://www.altech-ads.com/product/10002197.htm
2.http://www.katch.ne.jp/~kakonacl/douga/winplayer/codec_pack.html
3.http://support.microsoft.com/kb/816731/ja
4.http://www.divx.com/divx/windows/download/?lang=ja
5.http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84359
6.http://sourceforge.net/projects/ffdshow-tryout/





btw yahoo blog最低。