Author Archive

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


$ su
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.


Categories: Alive Tags: , ,



爱情,当你把手轻抚在她们的私处上,总想让他们更快乐一些的时候,她们却让你这样的痛苦。我常常看见那些为爱情痛苦的同学们,但我无法告诉他们,人生爱情是什么,我也正沉沦在里面,自闭和防备从来不是解决问题的答案。 ”


Categories: Alive

MATLAB error: version `GLIBCXX_3.4.15′ not found

Although I check with commands in terminal

strings /usr/lib/x86_64-linux-gnu/ | 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/ /usr/local/MATLAB/R2012a/bin/glnxa64/

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

Two basic probabilistic proofs[zz]

Repost from

Very elegant proof!!

Johan Jensen (mathematician)

I enjoy basic beautiful mathematical proofs. I see them like small jewels, that I collect from time to time. In this spirit, this post proposes probabilistic proofs of a couple of basic results.

Jensen inequality. The Jensen inequality states that if X is an integrable random variable on Rn and φ:Rn→R a convex function such that φ(X) is integrable, then




To prove it, we start by using the convexity of φ, which gives, for every integer n≥1 and every sequence x1,…,xn in Rn,




Now, we use the integrability of X and φ(X): we take x1,x2,… random independent and distributed as X, we use the strong law of large numbers for both sides, the fact that φ is continuous for the left hand side, and the fact that if P(A)=P(B)=1 then A∩B≠∅. I also appreciate the proof based on the equality for affine functions, the variational expression of a convex function as the envelope of its tangent hyperplanes, together with the fact that the supremum of expectations is less than or equal to the expectation of the supremum. Read more…

Categories: New Tech

Debugging in Python[zz]

Repost from

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: ,

Remote Linux Server in X11 mode from Windows

This post is to help you remote linux server from Windows, especially with X11 display specified.

First step is installation of Cygwin including OpenSSH package.

Then, it is followed by installation of X-Win32.

No need to set any configuration to PuTTY in X-Win32, all you need are the following two commands in Cygwin with X-Win32 opened.

1) ssh -X -p [your port] [usrname]@[linux server address]

2) export DISPLAY=[host address]:0

Hope this would help you!

Categories: Gallery

Instructions for Installing RPM Files Using Alien [zz]

Repost from Ubuntu Blog.

Installing Alien

You can install alien itself from the Ubuntu Universe repository by adding the repository to your list of sources and doing:

$sudo apt-get update
$sudo apt-get install alien

Installing the .rpm file

To install the .rpm file, you first need to convert it to a .deb file which can be installed on Ubuntu.
I assume that you downloaded the package to your Desktop (~/Desktop is the directory)
You can convert the .rpm to a .deb by using the following commands.
$cd ~/Desktop
-This will change the directory to your desktop, where you have the .rpm file.

$sudo alien -k name-of-rpm-file.rpm
– This will convert the .rpm to a .deb.
– The “-k” will keep the version number. Otherwise alien adds a “1″ to the version number.
– Tip: Use Smart Tab Completion to avoid mistyping the file names :)

$sudo dpkg -i name-of-deb-file.deb
– This will install the .deb package

Try reading the alien manpage for more details on how to convert other kinds of packages and the options available.

Categories: Ubuntu