Archive

Archive for the ‘Alive’ Category

Solution after sudo/su is ruined

图像

Table for linux user/group permission format .

The command “sudo chmod -R 777 /usr” ruined /usr/bin/sudo and /usr/bin/su

After ruined, when “sudo …” is executed, error occurs like

$ sudo
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

or

$ su
Password: 
su: Authentication failure

According to the hints of error, this problem is solved by rebooting computer into a chroot mode, and execute following command

# chmod 4755 /usr/bin/sudo

# chown root:root /usr/bin/sudo # this makes ‘sudo’ owned by root (uid=0)

# chmod u+s /usr/bin/sudo        # this set the ‘setuid’ bit, which is the third character in first triad

Explaination of setuid:

setuid and setgid (short for “set user ID upon execution” and “set group ID upon execution”, respectively)[1] are Unix access rights flags that allow users to run anexecutable with the permissions of the executable’s owner or group respectively and to change behaviour in directories. They are often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id or group id privileges provided are not always elevated, at a minimum they are specific.

 

Advertisements
Categories: Alive Tags: , ,

韩寒谈姑娘

韩寒的文字虽然有些粗,但是话粗理不粗。最近也在思考,人应该以怎样的理想活着,是“崇高”的为了达到某精神境界?或者是“现实”的钱,车,房,姑娘?关于姑娘,韩寒的《1988:我想和这个世界谈谈》有这样一段叙述:

“对于当时的我这样从来没有弄明白自己有什么追求的人来说,姑娘就是唯一的追求。这种追求是多么的煎熬,这让我懂得了人生必须确定一个目标的重要性,无论车子、房子、游艇、飞机,都比把—切押在姑娘身上要好很多,因为这些目标从来不会在几个客户之中做出选择,只要你达到了购买标准,你就可以完全的得到他们,并且在产权上写上自己的名字,如果有人来和你抢,你可以大方地将他们送进监狱。但是姑娘不一样,把一个姑娘当成人生的追求,就好比你的私处永远被人握在手里一样,无论这个姑娘的手劲多小,她总能捏得你求死不能,当她放开一些,你也不敢乱动,当你乱动一下,她就会捏得更紧一些,最残忍的是,当她想去向其他的怀抱的时候,总是先捏爆你的私处再说。这种比紧箍咒更残忍的紧什么咒,使你永远无法淡定神闲。我知道生命里的各种疼痛,我发现这种疼是最接近心疼的一种疼痛,让你胸闷、无语、蜷缩、哭泣。这便是不平等
爱情,当你把手轻抚在她们的私处上,总想让他们更快乐一些的时候,她们却让你这样的痛苦。我常常看见那些为爱情痛苦的同学们,但我无法告诉他们,人生爱情是什么,我也正沉沦在里面,自闭和防备从来不是解决问题的答案。 ”

 

Categories: Alive

MATLAB error: libstdc++.so: version `GLIBCXX_3.4.15′ not found

Although I check with commands in terminal

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC

which shows version GLIBCXX_3.4.15 exists, MATLAB still repeats this error. After googling, I found that MATLAB searches the libraries firstly within its own library path /usr/local/MATLAB/R2012a/bin/glnxa64/ or /usr/local/MATLAB/R2012a/sys/os/glnxa64 and then the system library path. The build-in library is somehow out-of-date, and the version GLIBCXX_3.4.15 doesn’t exist in the old library. 

I tried to rename the build-in library into another name so that MATLAB can be forced to find the correct one, but there still many other candidates library files with the same name which are prior in the searching order. I need to rename all these old libraries with the same name to help MATLAB direct to correct one, which would be troublesome. 

Finally, I found an easy way to solve the problem by linking the correct library file with the MATLAB firstly searched old library file, i.e.,

sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 /usr/local/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6

After running this command in my terminal, the world calms down.

Debugging in Python[zz]

Repost from http://pythonconquerstheuniverse.wordpress.com/category/python-debugger/

As a programmer, one of the first things that you need for serious program development is a debugger.

Python has a debugger, which is available as a module called pdb (for “Python DeBugger”, naturally!). Unfortunately, most discussions of pdb are not very useful to a Python newbie — most are very terse and simply rehash the description of pdb in the Python library reference manual. The discussion that I have found most accessible is in the first four pages of Chapter 27 of the Python 2.1 Bible.

So here is my own personal gentle introduction to using pdb. It assumes that you are not using any IDE — that you’re coding Python with a text editor and running your Python programs from the command line.  Read more…

Categories: Alive Tags: ,

分享一篇很有启发性的文章

源自 人人网 奶牛Denny

给明年依然年轻的我们:欲望、外界、标签、天才、时间、人生目标、现实、后悔、和经历

今天是22岁的最后一天。几个月前,我从沃顿商学院毕业,用文凭上“最高荣誉毕业”的标签安抚了已经年过半百的老妈,然后转头辞去了毕业后的第一份工作,跟一家很受尊敬的公司、还有150万的年薪道了别,回到了上海,加入了“刚毕业就失业”俱乐部,开始了一天三顿盒饭的新生活,中间许多精彩剧情暂时略过。

我肯定不是第一个做过这样事的人,也肯定不会是最后一个。所以在说自己的一些有趣故事前,我想先说点别的,也就是过去的一年里,想和大家分享但是一直没说的一些话。所以前两部说的是对于一些一直困扰着我们的关键词的理解和体会。他们是:欲望、外界、标签、天才、时间、经历、人生目标、后悔、和现实。

这可能会是一篇科普文,也可能会是一篇长篇小说,但我不想这篇文章变成一篇励志文,大家都审美疲劳了。所以我想忽略阳春白雪,尽管信息量很大,但是至少说一些实实在在的经验和故事,说一些效果立竿见影的观点,再说说活捉林志玲什么的,总之让大家多看一点就多获得一点实际的价值。 Read more…

Categories: Alive

没素质的跟人吵了一架

2011-12-19 2 comments

与其说没素质地跟人吵了一架,倒不如说是跟一个没素质的人吵了一架。

事情发生在嫂子生日那天中午,我哥开车带着一家人去吃饭。周六的深圳,不管是哪儿,到处都停满了车,吃个饭停个车都找不到车位。在一家川菜店楼下停下来,绕了几圈好不容易看到了一个车位,我就先下车去占位,我哥倒车绕过来停。就在这时后面一辆破皇冠要借道,我哥以为他是要离开停车场了,就礼貌性地让他先过了,没想到他径直就冲过来想停这个我们要停的车位。。。我说大哥,您停个车也得分个先来后到吧。。。我站在车位说是不让,还跟他讲理说我们本来就在他之前来,还礼貌性地给他让道,我们之前就要停这个车位的,结果这哥们理讲不过还想停车竟然突然就爆粗口伤人了,操。。。看我戴眼镜学生模样斯斯文文是软柿子好捏是吧。。。随之一声怒吼,这哥们被震住了,然后乘胜追击骂还了两句,这时候我哥嫂子也下车过来帮着我说理,把他弄得哑口无言,我这闹得,把停车场的保安都惹过来了。。。这家伙果然是吃软怕硬的主,最后想个乌龟似的乖乖地开车到一旁的角落里蹲着,等我们停完车,这家伙就灰溜溜的跑了。。。囧,好久没拿出这种架势跟人杠了。。。好好的一个周六还是嫂子生日,全被这人扫兴了。不过还好,嫂子总是那么乐天派,说是30年都没跟人这么“雄起”过,这预示着30岁之后要“雄起”!!~

Categories: Jotting

Make A Change

寂寞蛋疼时爱发些感慨,不料却成为了过路看客茶余饭后的笑话。那谁说的很对,生命可贵,浪费不对!的确,这些蛋疼的感慨确实是一种浪费啊,生活嘛,如人饮水冷暖自知,自知足矣。所以,准备一改本博客的style~~暂定积极幽默欢乐学术派路线~~

Categories: Alive