Custom syntax with vim

Custom syntax with vim – Chirag Patel August 10, 2015

On Linux, install vim if you do not have.
On Windows, install gVim (I tried 7.4).

Create vjn.vim file similar to following example.


” Vim syntax file
” Language: config file
” Maintainer: Chirag Patel

if exists(“b:current_syntax”)

:syn keyword error ERROR
:syn keyword warn WARNING

:syn keyword user chirag vrund svara parul
:syn keyword admin digant vikas hina

hi def error guibg=red guifg=white
hi def warn guibg=yellow guifg=black

hi def user guifg=’tomato1′
hi def admin guifg=’deep pink’


Check vim74/rgb.txt file to find color definitions.
Add vjn.vim to vim74/syntax folder.
Edit vim74/filetype.vim file and add following lines to alphabetical order of file types.


” Config
au BufNewFile,BufRead *.vjn setf vjn


You are all set to have fun and have interesting configuration file looks.

Also, do not forget to add following to your vim settings (_vimrc or .vimrc) for more fun.


colorscheme slate
set guifont=Courier_New:h10:cANSI
set autoindent
set ts=4
set softtabstop=4
set shiftwidth=4
set incsearch
set hlsearch
set nowrap
set noexpandtab
set showmatch
filetype on
syntax on
set ruler
set cindent
set noswapfile
set mat=5



detached process on centos

If you want to run an application from ssh even if you exit ssh session, do the following:

# nohup <application with arguments > &

This will put the process in background and will detach from terminal as well.

Also, edit /etc/rc.local and add above line to execute application from startup.

This works fine with CentOS 6.


CVS tag to repository

cvs co -kk MODULE
cvs tag -b <your_branch_name>

if cvs tag gives error, try

cvs rtag –b (your branch name) MODULE

This will tag MODULE in the repository instead of from a local checkout.


mkdir mybranch
cd mybranch
cvs co -r <your_branch_name> MODULE


Post crash debugging in Linux

– Enable core dump for your current session
chandra # ulimit -c unlimited

– Verify it is enabled
chandra # ulimit -c

– Once you have a crash while running executable, check for core dump file.
chandra # ls -al core*
-rw——- 1 root root 50966528 Mar 26 14:57 core.7812

– Open your executable in kdbg. Then, import core dump file from File -> Core Dump.

You will see where the exe crashed and all memory and local variable goodies.


Asterisk on Debian 4.0

– Check Linux kernel version
# uname -a
Linux ElectronWork 2.6.24-etchnhalf.1-686 #1 SMP Fri Dec 26 04:10:16 UTC 2008 i686 GNU/Linux

– Check Debian version
# cat /etc/debian_version

– Install various pre-requisite libraries.
# apt-get install make
# apt-get install gcc
# apt-get install g++
# apt-get install libc-dev
# apt-get install bison
# apt-get install ncurses-dev
# apt-get install libssl-dev
# apt-get install libnewt-dev
# apt-get install zlib1g-dev
# apt-get install initrd-tools
# apt-get install cvs
# apt-get install procps
# apt-get install doxygen

– Get Asterisk package.
# wget http://downloads.digium.com/pub/asterisk/releases/asterisk-
# tar xvzf asterisk-
# cd asterisk-

– Install Asterisk
# ./configure
If you see asterisk symbol in the end, configuration is successful. Else, grep for “no” in config.log and try to install those missing libraries/utilities.
# make
takes ~11min
# make install
# make samples (optional)
# make progdocs (optional)

– Test your installation.
# asterisk -r


System language for Debian Linux

System language for Debian Linux – Chirag Patel December 30, 2008

I ran into a simple but typical issue.

I was installing Debian 4 (kernel 2.6) today using minimal boot image CD and out of curiocity I selected its installation language to Gujarati. All screens showed almost 90% of the content in Gujarati (incorrectly translated at many places though). I select “English -US” as my choice of language for system locales. But, after installation and reboot, all the user screens had weird characters on screen (I was expecting English). I kept looking for a way to change locales and did this:

– I opened root terminal.
– Entered following command:
chirag@work~# dpkg-reconfigure locales
– I selected “en-US-utf-8” from the list shown.
– After OKing this and rebooting the system, I found characters known to me!