Showing posts from June, 2008

Setting the PuTTY window title from command line

I sometimes want to set the title of my PuTTY windows, like "Editor", "Compiler", etc. to identify distinct windows. I found the following script very useful. You can add that to your ~/.bash_profile. Once you login, you can set the title to whatever you want:

function wtitle {
if [ "$TERM" == "xterm" ] ; then
# Remove the old title string in the PS1, if one is already set.
PS1=`echo $PS1 | sed -r 's/^\\\\\[.+\\\\\]//g'`
export PS1="\[\033]0;$1 - \u@\h:\w\007\]$PS1"
echo "You are not working in xterm. I cannot set the title."
The above function will make the window title to be whatever argument you give followed by the usual user@host:workingdirectory. I think this should work with any xterm client. Not just PuTTY. (I haven't tested with any other xterm client.)

For e.g. to set the window title to be Editor, you would give th…

Changing color schemes in vim

You can change the color scheme of vim by the following command:
:color The list of available color schemes could be found under /usr/share/vim/vim63/colors/ (If you are using a different version of vim then vim63 might be different for you). If you see file called blue.vim under this directory, to make use of that color scheme, you should give:
:color blue
If you would like to make the change permanent, add this line to your ~/.vimrc file.

Configuring the core file name pattern in Linux

First of all, you must make sure that you have set proper ulimit in your shell. You can check this by giving "ulimit -a" command. If the core file size is set to be 0, you can make it unlimited by giving "ulimit -c unlimited". Refer to your shell's man page to know how to set this. The child always inherits the ulimit from its parent process.

You can configure your system such that when an application dumps core the name of the core file has some meaningful name instead of just the bare word core. There are two files you should modify under /proc/sys/kernel configure this.

/proc/sys/kernel/core_pattern - This contains pattern of the core file name. The following patterns are allowed:
%% output one '%'
%p pid
%u uid
%g gid
%s signal number
%t UNIX time of dump
%h hostname
%e executable filename

/proc/sys/kernel/core_uses_pid - If this file contains a non-zero val…