昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期四, 五月 22, 2014

小宝两岁

小宝昨天过生日. 两岁了
今天下午小宝醒后, 无声无息的出现在厨房. 果然长大了.
她以前醒后第一件事就是哭. 然后被抱起.

--
Feng

星期五, 五月 16, 2014

公钥私钥浅喻

私钥好比钞票上的仿伪记号
公钥就是验钞机

通常来说,公钥往往是从网上下载的。这就会有一个问题。

公钥和私钥用法很多

这里说一种, 用来验证发布者。

我们知道, 人民币要由中央银行印的才是真钞。
我印的那肯定是假钞。

我现在给你一千万人民币, 还送了你一台验钞机。 你用验钞机一验, 全是真币。。。你高兴了。。。

但你惨了, 那验钞机是我做的,它验我的假币当然都说是真的。

假验钞机验假币,当然完蛋。

那怎么知道验抄机是假的呢? 那就牵扯到公证机构了。

现在你收到一叠假币, 和一个假验钞机。 假币上的防伪标记是我做的。 验钞机也是我做的。 但是你知道,验抄机上也是有防伪标记的, 验钞机上写着"此验钞机是真的-中央银行认证"。

好了, 你正好有一个验钞机验证器, 是从可靠的来源获得的。 于是你验证了一下这个验钞机。。。它妈的, 原来是假货。 于是, 你认定这叠钞票是假的。 如果验证出这个验钞机是真的, 那说明这些抄票是由中央银行授权的机构生产, 也是真钞。

这个验钞机上的防伪标记就相当于公证机构的私钥。 而那个验钞机验证器就是公证机构的公钥了。 公钥机构的公钥 (ROOT CA)一般在操作系统里已经带了。 是可靠的, 当然, 病毒软件也可以安装一些不可靠的公钥进去。

总的来说, 一个证书(CERT),就是由公证机构用私钥签过名的你的公钥。 公证机构证明,这个公钥的确是你发布的。 所以证书不是公钥, 证书里包含公钥。

--
Feng

星期三, 五月 14, 2014

git server on mac os over ssh

To set up git server on mac over ssh, you don't need extra tools. You will need ssh + git.

Once you set up a git repository on the server. 

you can git clone it over ssh.

But I got this problem:

1. git-upload-pack cannot be found

bash: git-upload-pack: command not found
fatal: Could not read from remote repository.

Reason:

The ssh environment is different to terminal. The PATH has different value which doesn't contains git's path.

Solution:

add a .bashrc file in the home folder. and add this lines

export PATH=/usr/local/git/bin:$PATH

2.  Symbol not found

dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
  Referenced from: /usr/local/git/bin/git-upload-pack
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___strlcpy_chk
  Referenced from: /usr/local/git/bin/git-upload-pack
  Expected in: /usr/lib/libSystem.B.dylib

Then I cannot resolve this issue. (should be able to resolve by the path as well)

Then I installed the xcode command line tool... and delete the bashrc. The problem gone...

So... the solution is install xcode command line tool.

Because xcode command line tool will install another version of git under /usr/bin folder. 

The git environment before is under /usr/local/git/bin, this version don't need to set the path.

--
Feng

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.