Friday, May 28, 2010

rogue virus leading to

My wife's computer was infected by a rogue virus. It's constantly asking to buy anti-virus software from And it blocked the execution of other program by saying they are infected.
The only exception is browser. You can still open a browser. Apparently, they don't want to block the way so that the infected user can purchase their software.

Here is how I dealt with it:

In explorer, copy \windows\system32\taskmgr.exe to some other place. Then rename it as firefox.exe and run it. Now the task manager appears. In the task manager find and kill a process with a very strange name which unfortunately I forgot what exactly it is. And I also deleted the corresponding .exe file from the file system.

Now everything is back to normal. I am not sure this is a permanent fix. But so far so good.

Thursday, April 22, 2010

Increase limit on RLIMIT_NOFILE or other resources

Use setrlimit() to change the soft limit. But there is a hard limit which the setrlimit can not increase beyond.

In order to change the hard limit, you need to change the setting in following file

The syntax of the lines is as follows:

[domain] [type] [item] [value]

Use man limits.conf to see detailed explanation.

You can use command 'lsof -p [pid]' to see files opened by process pid.

Install Gnome On centos machine

Citing from

yum --exclude=nautilus-sendto groupinstall "GNOME Desktop Environment"

Friday, February 12, 2010

NX broken session

If the remote server is restarted during an NX session, then you will encounter error when establishing a new session. You need to go to /usr/NX/var/db/running and delete files in the directory.

Friday, January 29, 2010

Passing Special Characters to Commands

Citing from The Linux Cookbook: Tips and Techniques for Everyday Use

Some characters are reserved and have special meaning to the shell on their own. Before you can pass one of these characters to a command, you must quote it by enclosing the entire argument in single quotes (`'').

For example, here's how to pass `Please Stop!' to a command:

'Please Stop!'
When the argument you want to pass has one or more single quote characters in it, enclose it in double quotes, like so:

"Please Don't Stop!"
To pass special characters as a string, give them as:

where string is the string of characters to be passed. Special backslash escape sequences for certain characters are commonly included in a string, as listed in the following table.
\a Alert (rings the system bell).
\b Backspace.
\e Escape.
\f Form feed.
\n Newline.
\r Carriage return.
\t Horizontal tab.
\v Vertical tab.
\\ Backslash.
\NNN Character whose ASCII code is NNN in octal (base 8).
To demonstrate the passing of special character sequences to tool, the following examples will use the figlet tool, which displays the text you give as an argument in a "font" made up of text characters (see Horizontal Text Fonts).

To pass a backslash character as an argument to figlet, type:
$ figlet $'\\' [RET]
To pass a form feed character followed by a pilcrow sign character (octal character code 266) to figlet, type:
$ echo $'\f\266' [RET]