Harishvk27′s Weblog

June 14, 2011

extracting files from deb to temporary directory.

Filed under: random - collection — harishvk27 @ 6:04 am

please use following steps.

# ~$ mkdir temp
# ~$ cd temp
# ~/temp$ cp ~/x.deb .
# ~/temp$ ar x x.deb
# ~/temp$ tar xf data.tar.gz

December 31, 2010

for quick learning of python

Filed under: python,techy — harishvk27 @ 10:03 am

http://www.tutorialspoint.com/python/

December 17, 2010

coding guidlines

Filed under: C++ — harishvk27 @ 5:45 am

)1) while coding it;s better to maintain single return statement when method/function handles critical sections and uses locks or other synchronization mechanism

(2) in case of C++, use ++ instead of ++. ++ is more efficient when compared to ++ because post increment will result in copy constructor getting called while pre-increment will not.

(3) it’s always better to initialize the member variables of class as part of class construction using member variable constructors.

December 7, 2010

emacs align-regexp

Filed under: emacs — harishvk27 @ 6:40 am

M-x align-regexp

[^ ]+\((\|;\)

for align c/c++ member variables

September 22, 2010

tracking proc using strace.. and specific fd

Filed under: Uncategorized — harishvk27 @ 10:56 am

/proc/9533/fd/socket:[505625660]
root@topaz:/var/cae/log# netstat -anp | grep Sys | grep 505625660
unix 3 [ ] STREAM CONNECTED 505625660 9533/SystemMgrCae
root@topaz:/var/cae/log# strace -p 9533
Process 9533 attached – interrupt to quit
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29287) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=35, u64=35}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 35, {EPOLLERR|EPOLLHUP, {u32=35, u64=35}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
read(35, “=”, 4) = 4
read(35, “\203h\fa(a\10a\2a\10m\5admind\3clia\2h\4a”…, 61) = 61
write(35, “\16\203h\4aZa\10a\2d\2ok”, 18) = 18
epoll_ctl(3, EPOLL_CTL_MOD, 35, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=35, u64=35}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 27159) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 27159) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=49, u64=49}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
recvfrom(49, “A”, 1, MSG_DONTWAIT, NULL, NULL) = 1
write(5, “”, 1) = 1
write(5, “”, 1) = 1
recvfrom(49, 0x7fff30052820, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 49, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=49, u64=49}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 3
write(5, “”, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 128, 29999) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
read(4, “”, 1024) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
epoll_wait(3,
Process 9533 detached

August 16, 2010

web polygraph load testing

Filed under: Uncategorized — harishvk27 @ 6:04 am

Following tcp and ip parameters would help to get high load tests with less/no connection failures from poly server and poly client.

make sure to set these values on both the systems.

echo 1000 64000 > /proc/sys/net/ipv4/ip_local_port_range
echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse

Please save your self my backing the current setting for reference.

July 9, 2010

AWK scripting example

Filed under: scripting — harishvk27 @ 11:29 am

the following awk could help you to process file content after certain line-number.

does matching and apply conditions.

cat audit.log | awk ‘ BEGIN { i=0;found=0} { i=i+1; if ( i >= 2430344 ) { regex1=”userGroup”;regex2=”pcl”;result1=0; result2=0; result1=match($9,regex1); result2=match($9,regex2);if ( result1 || result2) { found=1; };regex3=”exit”;result3=0;result3=match($9,regex3); if ( result3 && found) { print $_;found=0 } if (found) { print $_ } } }’ > /tmp/cli.txt

July 1, 2010

using tshark for watching protocol traffic

Filed under: Uncategorized — harishvk27 @ 8:15 pm

most of the telecom/wireless network elements in deployment don’t have X-windows on them installed and will just have core linux kernel installed.. and sometime we want to watch particular protocol details on network elements which don’t support X-windows, which means we can not use wireshark.

tshark helps to get this going..

you can watch live traffic using tshark command.
tshark -i -R

for e.g. tshark -i any -R sctp would help you to watch sctp traffic live hitting the box on all available interfaces on system

May 27, 2010

dpkg useful options.

Filed under: system infrastructure — harishvk27 @ 8:59 am

dpkg -L lists all files installed as part of the package on system

dpkg -S searches all packages and lists the package(s) which have installed the file.

December 4, 2008

collecting url list from web…

Filed under: random - collection — harishvk27 @ 2:31 pm

i wanted to collect random urls from net… and this post talks about my current dirty way of doing so.

(1) Visited http://www.adddirectoryeasy.com/ and collected the source pages and executes following command;

(2) grep “a href=” web-sites.txt | grep “target=\”_blink\”" | awk ‘{ print $2 }’ | grep -v src | cut -d’=’ -f2 | cut -d’”‘ -f2 | uniq | wc -l > websites.txt

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.