Asterisk 1.6.0.6 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
4.0

- 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-1.6.0.6.tar.gz
# tar xvzf asterisk-1.6.0.6.tar.gz
# cd asterisk-1.6.0.6

- 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

Posted under Asterisk, Infrastructure, Linux

This post was written by Chirag on March 2, 2009

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!

Posted under Infrastructure, Linux

This post was written by Chirag on December 31, 2008

PCI standard requirements

PCI standard requirements - compiled by Chirag Patel December 27, 2008

Payment Card Industry (PCI) requirements of Data Security Standard (DSS) include following basic compliances:

- Install and maintain firewall configuration to protect card holder data.
- Do not use vendor supplied defaults for system passwords and other secuirity parameters.
- Protect stored cardholder data.
- Encrypt transmission of cardholder data across open, public networks.
- Use and regularly update anti-virus software.
- Develop and maintain secure systems and applications.
- Restrict access to cardholder data by business need-to-know.
- Assign a unique ID to each person with computer access.
- Restrict physical access to cardholder data.
- Track and monitor all access to network resources and cardholder data.
- Regularly test security systems and processes.
- Maintain a policy that addresses information security.

(Ref: WEBSITE magazine November, 2008)

Posted under Infrastructure

This post was written by Chirag on December 28, 2008

Folding with VIM

Folding with VIM - Chirag Patel Dec 14, 2008

– Edit “~/.vimrc”

– Add following options
set fmr={,}
set fdm=indent

– To use syntax folding for a file, enter following command after opening it.
:set fdm=syntax

– To set no folding, edit “~/.vimrc”
set nofoldenable

– By default all available folds are folded. Change that to preferred max in “~/.vimrc”.
set fdn=1

1 is good value as it will close all top level folds to be closed (e.g. functions), but not any blocks inside.

– Some commands while in command in command mode:
zo ==> open fold under cursor
zO ==> open folds recursively under cursor
zc ==> close fold under cursor
zC ==> close folds recursively under cursor
zA ==> toggle folds recursively
zM ==> close all folds in a file
zR ==> open all folds in a file

Posted under Infrastructure, Linux

This post was written by Chirag on December 15, 2008

My VIM configuration

Vim Basic Configuration - Chirag Patel Dec 14, 2008

— Edit “~/.vimrc” file and add following tags per need

set autoindent ==> auto-indent code
set incsearch ==> start searching as we type word for search
set hlsearch ==> highlight all occurrences for search
set nowrap ==> disable line wrapping
set ts=4 ==> set tabsize to 4 space size
set softtabstop=4 ==> tabbing match my tabsize of 4
set shiftwidth=4 ==> shifting match my tabsize of 4
set noexpandtab ==> do not replace tab with spaces
set showmatch ==> highlight matching bracket/braces as we move cursor
set mat=5 ==> matching for search
set nocompatible ==> no vi compatibility
filetype on ==> vim detects file type
syntax on ==> highlight syntax words for file type
set ruler
set cindent ==> “C” indent rules for auto-indent
==> following command restores file position while re-opening
autocmd BufReadPost *
\ if expand(”:p:h”) !=? $TEMP |
\ if line(”‘\”") > 0 && line(”‘\”") following command postpones using “zv” until after reading the modelines
autocmd BufWinEnter *
\ if exists(”b:doopenfold”) |
\ unlet b:doopenfold |
\ exe “normal zv” |
\ endif

Posted under Infrastructure, Linux

This post was written by Chirag on December 15, 2008

Code analysis

Check www.valgrind.org. This is Linux based tool and can detect code bugs early on.

Beware. It is not bug free either ;-) It is meant for dynamic analysis, and sometimes falsely alarms.

Posted under Infrastructure, Linux, c++

This post was written by Chirag on September 8, 2008

Datacenter tiering

Tier 1:
- 99.671% uptime
- annual 28.8 hrs downtime
- full shutdown for preventive maintenance

Tier 2:
- 99.741% uptime
- annual downtime of 22 hrs
- some redundancy with single path for power, requiring shutdown for preventive maintenance

Tier 3:
- 99.982% uptime
- annual 1.6 hrs downtime
- sufficient redundancy to allow planned maintenance
- at least 13.2 KV power

Tier 4:
- 99.995% uptime
- annual downtime of 0.4 hrs
- multiple paths to power and AC and designed to handle worst case scenario with no critical impact
- at least 26.2 KV power

Posted under General, Infrastructure

This post was written by Chirag on September 7, 2008

Network tiering

Tier 4:
- most datacenters
- owns internal network
- pay other networks for IP transit outside the facility

Tier 3:
- regional providers
- build redundancy thru’ redundant POPs (points of presence) outside facility
- pay for IP transit past the POPs

Tier 2:
- national or international footprint
- still pay IP transit to reach some portions of Internet

Tier 1:
- do not pay IP transit
- global presence
- don’t pay other providers for any portion of connectivity

Posted under General, Infrastructure

This post was written by Chirag on September 7, 2008