Archives:

GDB cheatsheat No ratings yet.

GDB cheatsheat There is a good gdb cheatsheet at http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf The output format for print, x is missing  there, somehow I think it is useful to add the output formats: x,d,u,o,t,a,f,s,z,r please see https://sourceware.org/gdb/onlinedocs/gdb/Output-Formats.html  How do we usually run gdb commands normally we compile the source code with  CPPFLAG -g ( please no -O, otherwise some code are • Read More »


人生最曼妙的风景,竟是内心的淡定与从容 No ratings yet.

有人说《一百岁感言》并非杨绛先生本人所作,  咱们中国的网络真的是真假难辩,难道这也需要方舟子打假? 不管怎样,出于敬重缅怀, 摘录此文以之怀念杨绛先生 杨绛: 我今年一百岁,已经走到了人生的边缘,我无法确知自己还能走多远,寿命是不由自主的,但我很清楚我快“回家”了。 我得洗净这一百年沾染的污秽回家。 我没有“登泰山而小天下”之感,只在自己的小天地里过平静的生活。细想至此,我心静如水,我该平和地迎接每一天,准备回家。 在这物欲横流的人世间,人生一世实在是够苦。你存心做一个与世无争的老实人吧,人家就利用你欺侮你。你稍有才德品貌,人家就嫉妒你排挤你。 你大度退让,人家就侵犯你损害你。你要不与人争,就得与世无求,同时还要维持实力准备斗争。你要和别人和平共处,就先得和他们周旋,还得准备随时吃亏。 少年贪玩,青年迷恋爱情,壮年汲汲于成名成家,暮年自安于自欺欺人。 人寿几何,顽铁能炼成的精金,能有多少?但不同程度的锻炼,必有不同程度的成绩;不同程度的纵欲放肆,必积下不同程度的顽劣。 上苍不会让所有幸福集中到某个人身上,得到爱情未必拥有金钱;拥有金钱未必得到快乐;得到快乐未必拥有健康;拥有健康未必一切都会如愿以偿。 保持知足常乐的心态才是淬炼心智,净化心灵的最佳途径。一切快乐的享受都属于精神,这种快乐把忍受变为享受,是精神对于物质的胜利,这便是人生哲学。 一个人经过不同程度的锻炼,就获得不同程度的修养、不同程度的效益。好比香料,捣得愈碎,磨得愈细,香得愈浓烈。我们曾如此渴望命运的波澜,到最后才发现:人生最曼妙的风景,竟是内心的淡定与从容……我们曾如此期盼外界的认可,到最后才知道:世界是自己的,与他人毫无关系。 References: http://news.wenweipo.com/2016/05/25/IN1605250061.htm http://newspaper.jfdaily.com/xwcb/files/20130718/322242.PDF http://zj.zjol.com.cn/news/350115.html Please rate this rating



Bayes classifier in plain english No ratings yet.

Bayes theorem: where A and B are events and P(B) ≠ 0. P(A) and P(B) are the probabilities of observing A and B without regard to each other. P(A | B), a conditional probability, is the probability of observing event A given that B is true. P(B | A) is the probability of observing event B given that A • Read More »


Decision tree learning in plain english No ratings yet.

Decision tree works just like computer language if. In AI/ML world, the problem is usually like this: Given training set with features [( f1,f2 ….), ….] and known category/label [c1, ….], how can we learn from this training set/data and design a decision tree , so that for any new data, we can predict which • Read More »


std::unique_lock vs std::lock_guard No ratings yet.

The std::unique_lock class is a lot more flexible when dealing with mutex locks. It has the same interface as std::lock_guard but provides additional methods for explicitly locking and unlocking mutexes and deferring locking on construction As a general rule, std::lock_guard should be preferably used when the additional features of std::unique_lock are not needed use cases: • Read More »


k-Nearest Neighbors in plain English No ratings yet.

Here is how it works in plain English: we have training set ( known features ( normalized), and classification) : many data points: [ ( feature1,feature2,feature 3,…), ( f1,f2,f3 …), ….] and corresponding labels/classification: [category1, 2, …] for any new data point  t calculate the distance between this  t to each of the training set • Read More »


What is bro and how to install bro on debian 8 No ratings yet.

Bro, or sometimes referred to as Bro-IDS is a bit different than Snort and Suricata. In a way Bro is both a signature and anomaly-based IDS. Its analysis engine will convert traffic captured into a series of events. An event could be a user logon to FTP, a connection to a website or practically anything. • Read More »



how to install/config Suricata on debian 8 No ratings yet.

suricata: on Debian 8 apt-get install suricata  ( it is 2.0.7 version) vi /etc/default/suricata  ( change RUN=yes, and adjust IFACE to  the interface and listen mode to pcap) systemctl start suricata tail -f /var/log/suricata/fast.lg ( eve.json)   rules mangement: apt-get install oinkmaster add /etc/oinkmaster.conf url = http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz then run: oinkmaster -C /etc/oinkmaster.conf -o /etc/suricata/rules systemctl • Read More »