using rsync to copy files and folders

Monday, May 2, 2011

Quest for a tool to do a copy excluding hidden files lead me to find the rsync command. Here is how I copy a folder from source to destination excluding all hidden files/folders (all that with a "." prefix in the name).

rsync -a --exclude='.*' source/ destination/

This might be especially useful when copying folders checked out from SVN, that needs to be checked-in to a different location. Having the .svn folder under sub-folders can cause them not to be checked in.

Read more...

vim 101 - my vimrc

Monday, December 20, 2010

 "colorscheme ron  
"colorscheme jagadeesh
"color ir_black
colorscheme koehler
set nu
set nocindent
set hlsearch
set tabstop=4 shiftwidth=4 expandtab
set laststatus=2
"i don't want a toolbar in gvim
set guioptions-=T
"i dont want to see menu in gvim
set guioptions-=m
"map "+y
"imap "+y
"map "+gP
"imap "+gP
nmap "+g
map tnext
map tprev
map "+y
map "+x
map "+gP
imap "+y
imap "+x
imap "+gP
map gj
map gk
imap gki
imap gji
map []
map ][
imap []i
imap ][i
map gg
imap ggi
"Tab navigation
map gt
imap gta
au FileType tex set ai et tw=70 spell
au FileType c set cindent tw=80 nospell
au FileType h set cindent tw=80 nospell
au FileType cpp set cindent tw=80 nospell
autocmd BufEnter *.cu set cindent tw=80 nospell
au FileType cuh set cindent tw=80 nospell
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh set guifont=Courier\ 10\ Pitch\ 12
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh map [[
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh map ]]
filetype plugin on
set ofu=syntaxcomplete#Complete
" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview
let c_no_if0=0

Read more...

vim 101 : tip 1

Normally I use vim with multiple splits and tabs. Once I quit vim, I have to open them up all again, and remember which file (and the location in the file) I was editing before I quit.

Here is trick:
Before quitting vim, just run ":mksession" (if you have multiple tabs open, then in just one of them). And then quit.

Next time you are in the same folder, and want to open the same session just run the command "gvim -S"

The contexts are stored in session.vim. So if you want to overwrite it at some later point of time run the command with an override ":mksession!"

Read more...

svn - 1

Friday, December 17, 2010

To get the list of all modified files, after a specific REVNO to the latest HEAD
svn diff -r REVNO:HEAD --summarize

Read more...

Downloading an MMS stream with mencoder

Wednesday, November 24, 2010

All you need is one command:


mencoder mms://url/filename.wmv -ovc copy -oac copy -o output.wmv

Read more...

ctags with CUDA files

Wednesday, November 10, 2010

To get ctags to properly tag functions in your *.cu files, run ctags as below (--exclude is to exclude the .pc directory generated by quilt):

 ctags  --langmap=c:+.cu --exclude=".pc" --recurse 

Read more...

getting ~/.bashrc to be executed

Monday, November 8, 2010

If your ~/.bashrc is not getting executed every time you login, add these lines to your ~/.bash_profile file:

 # include .bashrc if it exists 
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

Read more...