Thursday, July 14, 2011

Linux/Unix NFS bug

Sometimes it seems that we are not able to 'touch' the file becaue of error "already exists", but we try to delete it we get an error "file does not exists".

To solve this issue,
We need to create a temp file.
mv to original file
and then delete this file.

Now, we will be able to create a new file in same location.

Friday, July 8, 2011

Finding database size through mysql query


SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;

My bashrc

This is a initial setup. You can work on things similar to these.





PATH=$PATH:.:~/hpatil/0/
export EDITOR=/usr/bin/vim

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
PS1="[\t \u@\h:\w]$ "
export HISTSIZE=10000
export HISTCONTROL=erasedups
shopt -s histappend

BC_ENV_ARGS=~/.bcrc
export BC_ENV_ARGS
export INPUTRC=~/.inputrc

#alias vim="vim -c 'set nopaste'"
alias ll="ls -l"
alias rl="readlink -f"
alias vim='vim -c"set nopaste" '
alias vr='vim -MR -c"set nopaste" '

alias li='less -niFX'


alias grep_dir='_(){ bd;grep -a "mt=j" app.$1.tlog | grep -av "not active" | li;}; _'