Thursday, July 8, 2010
How to check CPU and memory Hardware detials in RHEL system?
#cat /proc/meminfo
#cat /proc/cpuinfo
Wednesday, June 9, 2010
How to write / setup SCTP client server program in RHEL system?
Before run any SCTP application, we need to install SCTP libs from
http://lksctp.sourceforge.net/
Using the below command, register the SCTP module into kernel.
#modprobe sctp
http://linux.about.com/od/commands/l/blcmdl8_modprob.htm
SCTP Application writing:-
SCTP client and server system call follow same as TCP. ( like socket,bind,listen and accept )
Creating SCTP socket
Sock = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP );
Before listen, we need to set the value for the no.of stream for the socket using setsockopt system call.
struct sctp_initmsg startupsctp;
startupsctp.sinit_num_ostreams = 3;
startupsctp.sinit_max_instreams = 3;
startupsctp.sinit_max_attempts = 4;
ret = setsockopt( listen_Socket, IPPROTO_SCTP, SCTP_INITMSG, & startupsctp, sizeof(startupsctp) );
Using sctp_sendmsg() and sctp_recvmsg() system calls , we can send/receive data over the SCTP socket.
Example code:-
Please refer : http://www.ibm.com/developerworks/linux/library/l-sctp/
Tuesday, May 25, 2010
How to decompress the tar.bz2 format file?
tmp/test.txt
Options:
* x - extract
* c - create to create
* v - verbose
* z - gzip
* j - bzip2 ( .bz2 )
* f - file name ( after the “f” indicate the input/output file name )
Friday, April 16, 2010
Monday, April 5, 2010
How to prepare ISO image and test it?
Create folder name with "cd"
#mkdir cd
#cd cd
copy your application/package/rpm/script file into the folder
#cp /root/test/Add-lnx26.sh .
#ls
Add-lnx26.sh
run the below command for creating the iso image with the name of add.iso
#cd ..
#mkisofs -l -r -N -d -D -J -o add.iso -V "Add-1.0" -A "Add program for ISO image test" cd
Warning: creating filesystem that does not conform to ISO-9660.
Total translation table size: 0
Total rockridge attributes bytes: 247
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used c000
182 extents written (0 MB)
#ls
cd add.iso
Monday, March 29, 2010
How to find the particular package installed or not?
Using “rpm –qa ” command, we can find whether the package installed or not.
Below shell script use the command for determine the given string/name package rpm installed or not installed.
rpmcheck.sh
############
rpm -qa "*$1*" > r1
line_no=$( wc -l < r1 )
echo "$line_no"
if [ $line_no == 0 ]
then
echo "rpm not installed "
else
echo "rpm installed "
fi
Output:
[root@home linux]# ./rpmcheck.sh milton
0
rpm not installed
[root@home linux]# ./rpmcheck.sh boost
2
rpm installed
How to find which rpm (package) install the particular file?
Using “rpm –qf” command, we can find the rpm package name for the lib file.
Example:
[root@home linux]# rpm -qf /usr/lib/libpython2.3.sopython-2.3.4-14.1
[root@home linux]# rpm -qf /usr/include/boost/blank.hpp
boost-devel-1.32.0-1.rhel4
