Skip to main content

Posts

Showing posts from August, 2010

A simple test on Kyoto Cabinet

Kyoto Cabinet is an update of Tokyo Cabinet as an light-weighted key-value database solution. The installation of Kyoto Cabinet and its python library could be done by the following script: wget http://fallabs.com/kyotocabinet/kyotocabinet-1.2.9.tar.gz tar vxzf kyotocabinet-1.2.9.tar.gz cd kyotocabinet-1.2.9/ ./configure make sudo make install cd .. wget http://fallabs.com/kyotocabinet/pythonlegacypkg/kyotocabinet-python-legacy-1.5.tar.gz tar vzxf kyotocabinet-python-legacy-1.5.tar.gz cd kyotocabinet-python-legacy-1.5/ make sudo make install cd .. I have a very simple test on Kyoto Cabinet. I have test set and get 1,000,000 entries to the db and compared it with python dict. The result is as below: kc write time: 4.4425470829 kc read time: 1.49812507629 dict write time: 3.50502705574 dict read time: 1.01603198051 kc key/value iteration time: 2.5863609314 dict key/value iteration time: 3.59536600113

oauth2

The OAuth protocol provides a secure way for users to share their information with third-party web resources. Twitter is pushing their OAuth 1.0 login while Facebook adopts OAuth 2.0. The difference between OAuth 1.0 and 2.0 are well described in this article . Mainly, OAuth 2.0 uses SSL connection to ensure the security and simplify the authorize process while OAuth 1.0 uses signature to avoid the overhead caused by SSL. For python users, this library may be used for both OAuth 1.0(the Client class) and OAuth 2.0(the Client2 class).

Solve "verify error:num=20:unable to get local issuer certificate" in openssl

Using openssl s_client to test a ssl connection, we may get the following error: verify error:num=20:unable to get local issuer certificate For example: openssl s_client -connect facebook.com:443 CONNECTED(00000003) depth=2 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA verify error:num=20:unable to get local issuer certificate  ... ... Server certificate -----BEGIN CERTIFICATE----- MIIGiDCCBXCgAwIBAgIQCoLvg+TMQDau82d6KfXrwDANBgkqhkiG9w0BAQUFADBp MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSgwJgYDVQQDEx9EaWdpQ2VydCBIaWdoIEFzc3VyYW5j ZSBFViBDQS0xMB4XDTA4MTExODAwMDAwMFoXDTEwMTEyMjIzNTk1OVowgfYxGzAZ BgNVBA8MElYxLjAsIENsYXVzZSA1LihiKTETMBEGCysGAQQBgjc8AgEDEwJVUzEZ MBcGCysGAQQBgjc8AgECEwhEZWxhd2FyZTEQMA4GA1UEBRMHMzgzNTgxNTEbMBkG A1UECRMSMTU2IFVuaXZlcnNpdHkgQXZlMQ4wDAYDVQQREwU5NDMwMTELMAkGA1UE BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVBhbG8gQWx0bzEX MBUGA1UEChMORmFjZWJvb2ssIEluYy4xGTAXBgNVB