2010年3月24日 星期三

Develop with git, on svn repository

With mplayer svn tree, for example.

1. Check out mplayer source
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

2.Init git
git init
git add .
git rm --cached -r .svn
git rm --cached -r */.svn
git rm --cached -r */*/.svn
...
git commit -a -c "svn 30936"

3.Coding and commit with git

4.git log
commit 2714b3e5893e4fa72714839cc6e3b7b0c841f596
Author: Gung Shi Jie <adolf@gung-shi-jiede-macbook.local>
Date:   Wed Mar 24 18:33:29 2010 +0800

    Fix visualize buffer crash.
    Restore mp_msg in draw_arrow
.....
commit 74b2ef7c90a3c06191c87b1c2cef037f394bfa31
Author: Gung Shi Jie <adolf@gung-shi-jiede-macbook.local>
Date:   Fri Mar 19 15:32:31 2010 +0800

    mplayer-svn  rev. 30936.

5.generate a patch
git diff 74b2ef 2714b3 > my.diff

6.reverse the patch
patch -p1 -R < my.diff

7.commit for svn update
git commit -a -C "reverse to svn 30936"

8.svn update
9.patch
patch -p1 < my.diff
10.check for error and commit
Blogged with the Flock Browser

pkgsrc.se

CVSROOT=anoncvs@anoncvs.se.netbsd.org/cvsroot
CVS_RSH=ssh

cvs checkout wip
cvs checkout othersrc

2010年3月9日 星期二

DKIM,Domainkey

Yahoo真的有在用。

 _domainkey.yahoo.com txt  "t=y\; o=~\; n=http://antispam.yahoo.com/domainkeys"

還不清楚他的格式,不過像我的。

netbsd._domainkey.netbsd.pfctl.info TXT "v=DKIM1\; g=*\; k=rsa\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWv8fdQDN1FUJJxeZ6NMdOy8tAEwuTEzpsk1wYfxtYFwz1hHPiuOhF/KJSR2gvR8JuVAC92sI7RupEmBafscJdcqwepb2IVV+4GCZMNUfDpWtmXcoLQ+DZabZvpdlo9xLnZ5nR/oXiM00DlUlS2wI6nrF0Zf44Ib8eCJAo1x/+JQIDAQAB"

DNS record的格式是

selector._domainkey.domain
selector是在dkim-milter裡面指定的,可以有很多不同的selector,簽名的時候會標記說是用哪個selector簽名的。

2010年3月6日 星期六

DKIM,DomainKeys,SPF

之前有寫過SPF
現在發現Yahoo喜歡檢查DKIM/DomainKeys,這兩個好像是不一樣的東西啦,DKIM據說是Yahoo跟Cisco弄出來的。

跟SPF不一樣的就是,他是用來對發出去的郵件做簽章,沒有簽章的就是垃圾郵件。
public key則是放再dns的txt欄位。

目前還不是很清楚怎麼弄。
也不知道有誰家的郵件有加這個,yahoo自己也沒有。而且每封信都要驗證太麻煩了吧。那乾脆對身分驗證好了ksc91u@ksc91u.info 變成自己放一個txt ksc91u.at.ksc91u.info到dns去。

2010年3月2日 星期二

Build XNU Kernel

http://shantonu.blogspot.com/2009/09/mac-os-x-kernel-source-xnu-has-been.html

The Mac OS X kernel source (xnu) has been released for Mac OS X 10.6 Snow Leopard: here

Building xnu requires some open source (but not pre-installed) tools. Darwinbuild is the most reliable way for building these dependencies and xnu itself. Until that is ready, you can build the tools manually as follows:

  1. Download the build tools source(s)

    $ curl -s -O http://www.opensource.apple.com/tarballs/cxxfilt/cxxfilt-9.tar.gz
    $ curl -s -O http://www.opensource.apple.com/tarballs/dtrace/dtrace-78.tar.gz
    $ curl -s -O http://www.opensource.apple.com/tarballs/kext_tools/kext_tools-177.tar.gz
    $ curl -s -O http://www.opensource.apple.com/tarballs/bootstrap_cmds/bootstrap_cmds-72.tar.gz
  2. Unpack the tools

    $ tar zxf cxxfilt-9.tar.gz
    $ tar zxf dtrace-78.tar.gz
    $ tar zxf kext_tools-177.tar.gz
    $ tar zxf bootstrap_cmds-72.tar.gz
  3. Build cxxfilt

    $ cd cxxfilt-9
    $ mkdir -p obj sym dst
    $ make install RC_ARCHS="i386 x86_64" RC_CFLAGS="-arch i386 -arch x86_64 -pipe" RC_OS=macos RC_RELEASE=SnowLeopard SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
    ...
    $ sudo ditto $PWD/dst/usr/local /usr/local
    Password:
    $ cd ..
  4. Build dtrace

    $ cd dtrace-78
    $ mkdir -p obj sym dst
    $ xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge ARCHS="i386 x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
    ...
    $ sudo ditto $PWD/dst/usr/local /usr/local
    Password:
    $ cd ..
  5. Build kext_tools

    $ cd kext_tools-177
    $ mkdir -p obj sym dst
    $ xcodebuild install -target kextsymboltool -target setsegname ARCHS="i386 x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
    ...
    $ sudo ditto $PWD/dst/usr/local /usr/local
    Password:
    $ cd ..
  6. Build bootstrap_cmds

    $ cd bootstrap_cmds-72
    $ mkdir -p obj sym dst
    $ make install RC_ARCHS="i386" RC_CFLAGS="-arch i386 -pipe" RC_OS=macos RC_RELEASE=SnowLeopard SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
    ...
    $ sudo ditto $PWD/dst/usr/local /usr/local
    Password:
    $ cd ..
  7. Download the xnu source

    $ curl -s -O http://www.opensource.apple.com/tarballs/xnu/xnu-1456.1.26.tar.gz
  8. Unpack xnu

    $ tar zxf xnu-1456.1.26.tar.gz
  9. Build xnu

    $ cd xnu-1456.1.26
    $ make ARCH_CONFIGS="I386 X86_64" KERNEL_CONFIGS="RELEASE"
    ...
    $ file BUILD/obj/RELEASE_*/mach_kernel
    BUILD/obj/RELEASE_I386/mach_kernel: Mach-O executable i386
    BUILD/obj/RELEASE_X86_64/mach_kernel: Mach-O 64-bit executable x86_64

原來,blogspot沒有引用的功能...