2010年2月18日木曜日

emacs & svn

下記プラグインを利用する。
psvn.el

こいつを~/.emacs-dirに保存し
~/.emacsを編修する

###################
(setq load-path
(append
(list (expand-file-name "~/.emacs-dir/")) load-path))

(require 'psvn)
###################

使い方についてpsvn.elを開いて参照してください。

2010年2月7日日曜日

Ubuntu でパッケージのソースコードを入手する

元ネタ:
http://masaoo.blogspot.com/2009/07/ubuntu.html

あるコマンドのソースコードを調べてみたいとか、見てみたいということがあります。
そんなときは apt-get で簡単にソースコードを取ってくることができます。

以下は dig コマンドのソースを取ってくる場合の例。
1. which コマンドで dig コマンドの保存場所を調べます。

# which dig
/usr/bin/dig

2. dpkg コマンドで dig コマンドが含まれるパッケージを調べます。

# dpkg -S /usr/bin/dig
dnsutils: /usr/bin/dig

3. dnsutils のソースコードを apt-get で取得します。

# mkdir dig
# cd dig
# apt-get source dnsutils

4. ls で見るとこんな感じになります。

あとは bind9-9.4.2.dfsg.P2 ディレクトリ内を調べます。
他のコマンドでも同様のやり方でいけます。

# ls
bind9-9.4.2.dfsg.P2 bind9_9.4.2.dfsg.P2-2ubuntu0.1.dsc
bind9_9.4.2.dfsg.P2-2ubuntu0.1.diff.gz bind9_9.4.2.dfsg.P2.orig.tar.gz

投稿者 まさお 時刻: 19:40
ラベル: Ubuntu

2010年1月23日土曜日

bash コマンドの結果を配列として格納する

コマンドの結果を配列として格納する。

$ls_result=($(ls))
$echo ${ls_result[@]}

2010年1月17日日曜日

C言語defineテクニック

以下定義の理由
#define DUMP_WRITE(addr,nr) do { memcpy(bufp,addr,nr); bufp += nr; } while(0)


if (addr)
DUMP_WRITE(addr,nr);
else
do_something_else();

(unsigned long)(&((type *)0)->member))
構造体のメンバーmemberのシフト量

2009年11月5日木曜日

Dependency Walker

Dependency Walker(ディペンデンシーウォーカー)は、32ビット/64ビット(exe、dll、ocx、sysなど)のWindowsモジュールをスキャンするユーティリティです。全ての依存モジュールの階層的ツリーダイアグラムを表示します。

2009年10月26日月曜日

gdbでテストを行う

1.gdbで入力したコマンドを下記で記録できる
 (gdb) set history filename test-pattern1
 (gdb) set history save on
2.記録したファイルを下記コマンドで起動できる
> gdb a.out -x test-pattern1
3.詳しくは下記を参考に
http://www.fireproject.jp/feature/gdb/advanced/auto-test.html

2009年10月22日木曜日

linux svn server (tested in fedora 11)

svn server setup tutorial in fedora core 9
1. First you should Create a SVN Repository
svnadmin create $REPO_URL/svnrepos

2. Then Create a SVN User
vi $REPO_URL/svnrepos/conf/svnserve.conf

In that file add these three lines below:
anon-access = none
auth-access = write
password-db = passwd

Create a password file:
vi $REPO_URL/svnrepos/conf/passwd

In that file add a line for your user:

# add users in the format : user = password
tony = mypassword

3. Now Import Your Project
(assuming you’ve put your project files in /projects/mytestproj)
svn import /projectsToImport/mytestproj file://$REPO_URL/svnrepos/mytestproj

4. Start the SVN Server as Daemon, Lets Ahead
svnserve -d -r $REPO_URL
^^ -r is used to tell the server to refer to the REPO_URL directly.

now you have a SVN server running with one project named mytestproj.
Try checking it out of the repository:svn co svn://$YOUR_IP/svnrepos/mytestproj

original page
http://codefighters.blogspot.com/2009/02/svn-server-setup-tutorial-in-fedora.html