Skip to content →

Author: Daoyuan Li

The well known secret

The Secret should be a great book haven’t I read many books about self control, positive thinking and success, etc. Honestly I didn’t find much new in the book. The overall theme is quite clear: embrace your positive thoughts and get rid of negative ones. And I think this Ted talk explains the concept better and is more persuasive. The book is tedious if not boring, like many other books on “success”. I guess the author believes in “repetition is the key of persuasiveness.”

After reading this book, I don’t even bother reading another book of hers: The Power. After skimming through its table of contents, it’s basically the same thing after all. I need examples, logic and insights, instead of pure propagandas!

Leave a Comment

OpenVPN client TLS-Auth problem on Windows

It seems that the OpenVPN Client on windows does not support TLS-Auth with a separate key file. So instead, you can paste your key contents in your openvpn client’s config file and use some thing like the following (inline ta.key):

client
dev tun
proto udp

# enter the server's hostname
# or IP address here, and port number
remote server_ip port_number

resolv-retry infinite
nobind
persist-key
persist-tun

# Use the full filepaths to your
# certificates and keys
ca "C:\\yabroad.tblk\\ca.crt"
cert "C:\\yabroad.tblk\\client.crt"
key "C:\\yabroad.tblk\\client.key"

key-direction 1

<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END OpenVPN Static key V1-----
</tls-auth>


ns-cert-type server
comp-lzo
verb 1

When not using the above but using something like:

tls-auth ta.key 1  # which works for tunnelblick

The server log shows something like:

Thu Apr 18 20:55:26 2013 TLS Error: incoming packet authentication failed from [AF_INET] IP_ADDRESS:60454
Thu Apr 18 20:55:57 2013 Authenticate/Decrypt packet error: packet HMAC authentication failed
20 Comments

funf smart phone data collecting

读完几本大数据的书,偶然发现了一个叫funf的手机应用,号称能将安卓手机变身为数据收集器。于是我很兴奋的下载安装,让这个app在我手机上采集了两天的数据,分析得到的结果如下:

battery_life phone_temperature relative_activity screen_activity

 

老实说,收集了两天的数据,就能分析出这么点东西,着实让人失望。不过这个生成图像信息的程序是开源的,而且是用Python实现的,今后有空了也可以自己来分析一下收集到的数据。funf在我的手机上也经常不能响应,可以说这个app是十足的半成品。不过这个由来自MIT的团队开发的不仅仅是一个手机app,号称是一个Open Sensing Framework,前几天还刚刚被Google收购了。虽然是个半成品,但Google这个时候收购团队总比让他们羽翼丰满之后再收购所花的代价要小得多。

Leave a Comment

Notes on Big Data

《大数据时代》这本书强调了这个时代数据的重要性,所谓大数据,即全体数据而非抽样数据,大数据强调混杂性而不追求准确性,注重相关关系而非因果关系。在商业中,不仅需要得到大数据,而且需要知道如何利用大数据。例如,如何筛选自己需要的信息,了解自己真正需要什么。在这个过程中重视产生的结果,却不要过分纠结于产生这个结果的原因。本书作者似乎是业界翘楚,书中旁征博引,很有说服力。可以看出来作者Viktor Mayer-Schonberger是Taylorism的坚定信徒,他相信任何事情都是可以用数据测量和表述的。这一点跟《The Shallows》的作者Nicholas Carr的观点不一样,Carr认为并不是所有的东西都是可以测量的。当然Schonberger在书最后也提到了这一点,他也认为我们处理的信息不过是世界的某个投影,大数据也只是一个工具,我们在使用大数据的时候不要自负,要“铭记人性之本”。

《删除》是《大数据时代》作者Schonberger的另一本书,作者这次从用户的角度出发,讲诉在大数据时代中应该做出对自己有利的事情。计算机和存储介质的发明,就意味着数据会被永久存储;特别是近年来各种软件和在线服务的出现,使得人们越来越没有能力控制自己信息的散布,流动,以及存在的时限。很多信息一旦公开(甚至是对少许几人公开),你就没有在将它控制住的能力了,颇有“覆水难收”的味道。书中举了一个在MySpace上贴出自己饮酒照片被上司发现而最终被取消教师资格的女孩的故事;而我前几天发现我的网站被另一个网站做了历史镜像的经历也同样让我不安。一旦信息公布,就不能再收回了。作者在书中给了很多建议,如节制数字化信息的使用,知道自己应该公开那些信息,重视公开信息的后果;重视隐私法律的建立以及提供相应的技术支持;调整大众对数字隐私的认知;等等。同时作者最后还抛出了一个给所有信息都加上一个存储期限的想法,这个不管从技术上还是用户体验上都难以在近期时限。但是,最近确实有类似的在线服务出现,如阅后即焚的聊天服务snapchat,在线文本存储与共享工具pastebin等,同时Google等巨头也一再缩短存储用户信息的时间。随着大众对隐私的觉醒,相信在不久会有更多的服务在信息存储期限上下功夫。下一个会不会是email呢?毕竟我们需要的只是一小部分对我们有用的东西,如果我们都根本不记得邮件里有哪些内容,就让它们被慢慢的遗忘吧。

《爆发》从行为预测的角度讲诉了大数据的用途。这本书看到一半时我觉得这是我看过的最好的业界趋势读物,因为作者巴拉巴西的写作手法很奇特:全书每一章都分为两个部分,前半部分讲技术,后一部分讲历史故事。每看完一章我都想迫不及待的看下一章,颇有章回体小说的味道。但是等我把全书看完之后却还是云里雾里,完全不理解作者的观点是什么,到底人的行为是否可以被准确预测。不过确定的有一点,如书名所诉,我们的行为充满爆发性(Bursts)。我们可以很长时间不写邮件,但是同时也有可能在短时间里写很多邮件;我写博客也是,可能好几个月都不写一篇,有时候又连续几天都写;我好几个月都不看书,一看就连续看好几本;甚至花钱也是,好几天一分钱都不花,也有可能一天花好多……作者认为我们之所以会有这些行为,从根本来讲是因为我们的生物特性中即有爆发性,细胞生成的过程即是由一个又一个的爆发组成的。从行为学上讲,我们会给自己要做的事情安排一个优先级,只有优先级高的事情才会被完成。由此生成的优先级队列就隐含了爆发性,导致我们实际完成事情的时候也是一组一组爆发式的完成的。因为我们的行为不是一个随机过程,所以我们不遵循泊松分布。书中的历史故事也很精彩,讲诉了16世纪发生在匈牙利的一个农民起义的故事。起义领袖赛克勒从发起起义到被捕都发生在很短的时间内,按作者的说法他的起义过程实际上是一个快速燃烧完的爆发点。赛克勒并没有经历太多就变成了起义领袖,由此就注定必败的命运。一切来的太突然了,不是每个人都能把握好自己。所以“天将降大任于斯人也,必先苦其心志,劳其胫骨,乏其体肤”也是不无道理的。一个人需要蛰伏很久,才能从容的面对破茧而出的那一刻。

Leave a Comment

Notes on The Shallows

This book was recommended by several colleagues at Ericsson. After reading it I find it quite worth reading. It is objective, profound in examples and analysis, persuasive, and smooth to read.

The author argues that our brains are plastic; and they are shaped gradually by new mediums, such as printing, radio, computers and the Internet,  throughout the history. When we take advantage of certain technologies, we tend to consider the technology as a part of ourselves. And by heavily relying on those technologies, we gradually loose the ability to do what’s been done by them. When we starts to use clocks, we loose the sense of timing; when we use GPS to guide ourselves, we loose the sense of orientation; after using typewriters/computers, we can no longer writing by hand. Our brains physically change during the course of using tools or memorizing things. Tools shape the way we think and act.

Computers and the Internet make information broadly accessible, however this does not increase our knowledge or problem solving skills. What we have done is just adapting ourselves to the tools. The contents are superflous while we only concentrate on the superficial. We get interrupted.

We mistakenly think ourselves as simulations of computers. However, computers are designed and built to simulate human behaviours but not otherwise. We may take advantage of them, but we should realise there are borders between us and the tools. We should not let them dominate our lives.

In the middle of writing the first two paragraphs of this post: I closed several previously opened browser tabs and took a glimpse over them; checked opened Linkedin to see if there are any interesting news; after two seconds I tried to open facebook and then realised I haven’t open up SSH tunnel yet, so I closed the facebook tab; then I changed the default text editor application for my system; tried to uninstall one of the text editors but aborted the task; navigated to the ebooks I have on my computer and tried to find something I have now already forgotten about; skimmed some books on Python, Ruby, Joomla, LaTex, and finally read one chapter on using regular expressions in Vim; after that I’m back in the browser to record this in my post. This happened probably within 10 minutes and now I have no idea why I interrupted writing this post in the first place. Oh, just now I Googled the word ‘interrupt’ since I couldn’t decide whether to use ‘interrupt’ or ‘pause’.

Indeed computers and the Internet are nice tools, for certain purposes. But they are merely tools. Don’t let them get in your way of doing what you really want and building what you want to become.

Leave a Comment

基因决定公司前途定律

看完《浪潮之巅》,收获不小。这本书讲述了美国各大科技公司的沉浮历史,从科技和商业两方面讨论了它们成功的秘密和失败的根源,提出了不少我很认同的观念。

首先是基因决定定律,一个公司的创始人和早期员工决定了公司的基因,这个基因会在公司成长的过程中不断影响公司做出的决定,从一定意义上来说决定了公司能否成功和公司对员工及社会的影响。苹果是一个设计公司,所以它推出的手机在设计上没有出彩的地方的时候消费者就不会买账;Google是一个做工程的公司,所以它的Android系统做了七年也做不出好的用户体验;爱立信是一个设备提供商,所以它不可能跟最终消费者走的太近,它会更多的考虑运营商而不是最终消费者的利益;微软是卖软件的,所以它在免费在线服务上竞争不过Google跟Yahoo,因为后者提供的服务是免费的……

其次是摩尔定律,反摩尔定律和安迪比尔定律。摩尔定律大家都知道,即每18个月计算机硬件性能提升一倍或者价格下降至原先的一半;反摩尔定律说的是如果一个IT公司18个月之后的卖出产品的数量与现在一样,那么它一年半之后的营业额就会减半;安迪比尔定律说的是英特尔的硬件带来的提升会被微软软件消耗的资源抵消,软硬件产业的发展是相辅相成的。

还有一些管理公司的诀窍。如思科为了留住早期员工让他们进行内部创业,然后再将他们创立的公司收购,从而不断获得新的技术和留住最好的人才;Google初创时期为了让员工充满动力,每周都会公布一周里签下的大合同和公司的运营额以及现金数量等“商业机密”,让每个员工知道公司运营状况;Google用人采取“杀鸡用牛刀”的方式保证产品质量和工作效率;一个公司在IPO之后往往创始人的股权都小于10%;伯克希尔-哈撒韦采用双层股权,A股面值是B股的30倍,投票权是B股的200倍,A股能转为B股而B股不可能转为A股,这样来保证创始人公司的控制;Google也采用双层股权的方式,A股每股一个投票权而B股每股10个投票权,B股掌握在创始人和高管手中而不能流通。

虽然这本书的作者吴军对技术细节可能不太重视(比如他写到IPv6中地址是6个字节48位,实际为16字节128位),但他在Google的工作经验和对公司商业上的看法十分深刻,推荐此书。

Leave a Comment

《活着》的信念

之前看过电影,但对电影情节一点印象都没有了,所以现在再来看书的时候就像是新拿到一本小说一样,一口气看完之后才慢慢回忆起之前电影里面的一些场景。一个人活着,信念是最重要的,对福贵也好,对少年Pi也一样,这个信念的产生并不需要有前提诱因,也不需要有情操来支持它,它是每个人与生俱来的。活着的信念本身是卑微的,关键时刻产生的继续生存下去的动力却是其它信念无法比拟的。

Leave a Comment

Installing mod_xsendfile on OS X Lion

First download mod_xsendfile.c from https://tn123.org/mod_xsendfile/

Then compile and install it:

sudo apxs -cia mod_xsendfile.c

Add the following line to /etc/apache2/httpd.conf at the end of the first block of “Load” statements:

LoadModule xsendfile_module libexec/apache2/mod_xsendfile.so

At last, restart the apache server

sudo apachectl restart

Hi, the company I’m working for (yabroad.com) is hiring Website Backend and Frontend Developers to our platform team. We are building an open platform for youngsters to travel beyond boarders and we offer youngsters internship, language study, travel and volunteer opportunities. Please contact me if you are interested.

Leave a Comment

XBMC and OS X firewall permission popups

I installed XBMC on my Mac OS X Lion and every time I open up the program, a firewall permission dialog pops up. It didn’t help even if I added the XBMC in my firewall configurations. Popups still show up. This link solves the problem neatly — You can generate a certificate and sign the program by yourself. After that the frustrating dialog should appear only once (at most). In case the link becomes invalid, here’s a screenshot of the instructions. Click to see the large picture.

Leave a Comment

Block unauthorized ssh login attempts (attacks)

My friends and I am working on a hobby project and  we need a Git server, so I set up one on my MacBook Pro. We access the repository via SSH. However when I checked the ssh log I found someone trying to get ssh access to my machine by guessing usernames. The log looks as follows:

Jun 29 21:06:52 doh1 sshd[19400]: Invalid user postgres from 190.181.132.70
Jun 29 21:06:52 doh1 sshd[19401]: input_userauth_request: invalid user postgres
Jun 29 21:06:52 doh1 sshd[19401]: Received disconnect from 190.181.132.70: 11: Bye Bye
Jun 29 21:06:54 doh1 sshd[19402]: reverse mapping checking getaddrinfo for wimax132-70.yota.com.ni [190.181.132.70] failed - POSSIBLE BREAK-IN ATTEMPT!
Jun 29 21:06:54 doh1 sshd[19403]: Received disconnect from 190.181.132.70: 11: Bye Bye
Jun 29 21:06:55 doh1 sshd[19405]: reverse mapping checking getaddrinfo for wimax132-70.yota.com.ni [190.181.132.70] failed - POSSIBLE BREAK-IN ATTEMPT!
Jun 29 21:06:55 doh1 sshd[19405]: Invalid user backup from 190.181.132.70
Jun 29 21:06:55 doh1 sshd[19406]: input_userauth_request: invalid user backup
Jun 29 21:06:56 doh1 sshd[19406]: Received disconnect from 190.181.132.70: 11: Bye Bye
Jun 29 21:06:57 doh1 sshd[19407]: reverse mapping checking getaddrinfo for wimax132-70.yota.com.ni [190.181.132.70] failed - POSSIBLE BREAK-IN ATTEMPT!

I first tried to use DenyHosts, however, there are still attempts from other IP addresses. Since there are three of us accessing the repository, I configured the hosts.allow and hosts.deny manually: deny all hosts other than the IP addresses I trust.

hosts.deny:

~$ cat /etc/hosts.deny 
sshd: ALL

hosts.allow:

~$ cat /etc/hosts.allow
sshd: [The IP addresses you allow to connect via SSH]
ALL: localhost

Now the log file should be quite…

Leave a Comment

Cycling to work in the rain

Yesterday the weather forecast said it would rain at 8am today, but not before that. So last night I went to bed very early and got up at 6 o’clock. When I headed out the rain already started, but it was not raining heavily. After some time it rained harder and I got all wet — the clothes are wet both inside and outside since I was sweating heavily. I thought it would take me longer time to get to work, but when I arrived it took me only one hour and ten minutes, even less time than yesterday!

I only wish I had brought another pair of socks since it became all wet because I was wearing sandals…

Leave a Comment

Cycling back from work

Cycling to work this morning took about one hour and 20 minutes; and cycling back took one hour and 5 minutes. 😀

Speed 17.75 kph vs. 19.4 kph, quite impressive!

Leave a Comment

Eat that frog

According to this book, the key to success is: clarify your goals and objectives; divide them into smaller tasks; prioritize the tasks; conquer them in an efficient way; take into account your talents and constraints while targeting the tasks; motivate yourself; do not multitask; set deadlines; carry the plan through.

The author is surely correct, however the book does not guarantee success. This book, like other books discussing about success, is pointless, since anyone knows what it takes to succeed — practice — while reading a book is quite a different experience from that.

Leave a Comment

Migrating JComments to WordPress

I switched back to WordPress from Joomla! after I registered this new domain. After migrated all the posts to WordPress using FG Joomla to WordPress, I noticed the comments have not been transferred. After some digging I didn’t find satisfactory plugin to do that, so I wrote my own PHP script to fulfill this task. The code is also available from GitHub.


13 Comments

Downgrade Preview in OS X Lion

I’ve had enough with the slow Preview application in Lion. After some digging I found this tutorial to downgrade the Preview in Lion to the Snow Leopard version. Basically you need to have a copy of both the Preview.app and /System/Library/PrivateFrameworks/MeshKit.framework from Snow Leopard. If you need to associate the default app to open pdf/png with the downgraded Preview, you have to delete the original Preview.app.

tar -pczf Preview.app.tar.gz /Applications/Preview.app
sudo rm -rf /Applications/Preview.app

Update: after installing OS X updates you need to remove the Preview.app again and put the SL Preview.app to /Applications/ directory.

Leave a Comment