<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IndianGNU.org</title>
	<atom:link href="http://www.indiangnu.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indiangnu.org</link>
	<description>Unleash the power within!!</description>
	<lastBuildDate>Thu, 25 Feb 2010 11:35:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use socat with haproxy stat</title>
		<link>http://www.indiangnu.org/2010/how-to-use-socat-with-haproxy-stat/</link>
		<comments>http://www.indiangnu.org/2010/how-to-use-socat-with-haproxy-stat/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:28:48 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux Networking]]></category>
		<category><![CDATA[Linux commands]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>
		<category><![CDATA[UNIX/Linux]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=921</guid>
		<description><![CDATA[*** Introduction &#8211; 
All you know about the haproxy, that its the one of the good opensource load balancing software and to check the fun stats of haproxy here we using &#8216;socat&#8217; &#8211; Multipurpose relay (SOcket CAT)

* What is socat?
Socat  is  a  command  line based utility that establishes two bidirectional byte streams and transfers data [...]]]></description>
			<content:encoded><![CDATA[<p>*** <strong>Introduction &#8211; </strong></p>
<p>All you know about the <a href="http://haproxy.1wt.eu" target="_blank">haproxy</a>, that its the one of the good opensource load balancing software and to check the fun stats of haproxy here we using &#8216;<a href="http://www.dest-unreach.org/socat/" target="_blank">socat&#8217;</a> &#8211; Multipurpose relay (SOcket CAT)</p>
<p><strong><br />
* What is socat?</strong></p>
<p>Socat  is  a  command  line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address  types),  and  because  lots  of address options may be applied to the streams, socat can be used for many different purposes. (see more info at &#8216;man socat&#8217; <img src='http://www.indiangnu.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  or at http://www.dest-unreach.org/socat/)<br />
<strong>* How to use &#8217;socat&#8217; with haproxy stat</strong></p>
<p>Step 1) Download &#8217;socat&#8217; from http://www.dest-unreach.org/socat/download/  latest version ~ &#8220;socat-2.0.0-b3.tar.gz&#8221;</p>
<p>ravi@arun:~$ wget http://www.dest-unreach.org/socat/download/socat-1.7.1.2.tar.gz</p>
<p>ravi@arun:~$ tar xvzf socat-1.7.1.2.tar.gz</p>
<p>ravi@arun:~$ cd socat-1.7.1.2</p>
<p>NOTE ~ No need to install the &#8216;fipsld&#8217; package if you got the below msg after running the &#8216;make&#8217; just following steps for</p>
<p>compiling socat&#8230;.</p>
<p>FIPSLD_CC=gcc fipsld -O -D_GNU_SOURCE -Wall -Wno-parentheses  -DHAVE_CONFIG_H -I.  -I.   -c -o socat.o socat.c<br />
/bin/sh: fipsld: command not found<br />
make: *** [socat.o] Error 127</p>
<p>ravi@arun:~$ ./configure &#8211;disable-fips<br />
ravi@arun:~$ make</p>
<p>To install it login as root<br />
ravi@arun:~$ su -</p>
<p>ravi@arun:~# make install</p>
<p>Step 2) Now you need to add stats socket PATH in Haproxy configuration and restart haproxy as per shown in following example,</p>
<p>where I have added it under in &#8216;global&#8217; setting -</p>
<p>ravi@arun:~# more /etc/haproxy/myhaproxy.cfg</p>
<p>#&#8212;&#8212;&#8212;&#8211;Start of haproxy Config file&#8212;&#8212;&#8212;&#8212;&#8211;<br />
global<br />
log 127.0.0.1   local0<br />
log 127.0.0.1   local1 notice<br />
#log loghost    local0 info<br />
maxconn 25000<br />
#debug<br />
#quiet<br />
user ravi<br />
group ravi<br />
stats socket    /tmp/haproxy<br />
defaults<br />
option          contstats<br />
timeout         connect 5s<br />
timeout         client 25s<br />
timeout         server 25s<br />
maxconn         100</p>
<p>listen ravitestbed      0.0.0.0:80 ##ravi.com IP<br />
mode            tcp<br />
balance         roundrobin<br />
server          web1 192.168.19.117<br />
server          web2 192.168.19.122</p>
<p>listen stats<br />
bind            0.0.0.0:8081<br />
mode            http<br />
#stats          uri /stat  #Comment this if you need to specify diff stat path for viewing stat page<br />
stats enable<br />
stats auth admin:admin ##Auth user pass</p>
<p>#&#8212;&#8212;&#8212;&#8211;End of haproxy Config file&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Step 3) Used /tmp/haproxy. Now you can send the commands to get stats from HAProxy -</p>
<p>Now time to use socat</p>
<p>ravi@arun:~# echo &#8220;&#8221;  | socat unix-connect:/tmp/haproxy stdio<br />
Unknown command. Please enter one of the following commands only :<br />
show info   : report information about the running process<br />
show stat   : report counters for each proxy and server<br />
show errors : report last request and response errors for each proxy<br />
show sess   : report the list of current sessions</p>
<p><strong>This will dump (possibly huge) info about all know sessions. </strong></p>
<p>ravi@arun:~$ echo &#8220;show sess&#8221; | socat unix-connect:/tmp/haproxy stdio<br />
0&#215;9ee3520: proto=tcpv4 src=192.168.19.117:4721 fe=ravitestbed be=ravitestbed srv=arun as=0 ts=08 age=4s calls=3<br />
rq[f=009202h,l=0,an=00h,rx=20s,wx=,ax=] rp[f=009202h,l=0,an=00h,rx=20s,wx=,ax=] s0=[7,8h,fd=1,ex=] s1=[7,8h,fd=2,ex=] exp=20s<br />
0&#215;9eeb8e8: proto=tcpv4 src=192.168.19.117:4723 fe=ravitestbed be=ravitestbed srv=arun as=0 ts=08 age=4s calls=3<br />
rq[f=009000h,l=0,an=00h,rx=20s,wx=,ax=] rp[f=009202h,l=0,an=00h,rx=20s,wx=,ax=] s0=[7,8h,fd=8,ex=] s1=[7,8h,fd=9,ex=] exp=20s<br />
0&#215;9ef3d08: proto=tcpv4 src=192.168.19.117:4725 fe=ravitestbed be=ravitestbed srv=arun as=0 ts=08 age=4s calls=3<br />
rq[f=009000h,l=0,an=00h,rx=20s,wx=,ax=] rp[f=009202h,l=0,an=00h,rx=20s,wx=,ax=] s0=[7,8h,fd=12,ex=] s1=[7,8h,fd=13,ex=]<br />
exp=20s<br />
0&#215;9f04548: proto=unix_stream as=2 ts=09 age=0s calls=2 rq[f=00e042h,l=10,an=20h,rx=10s,wx=,ax=]</p>
<p>rp[f=048060h,l=716,an=00h,rx=,wx=10s,ax=] s0=[7,0h,fd=3,ex=] s1=[0,0h,fd=-1,ex=] exp=9s</p>
<p><strong>This will give you information about the running HAProxy process such as pid, uptime and etc.</strong></p>
<p>ravi@arun:~$ echo &#8220;show info&#8221; | socat unix-connect:/tmp/haproxy stdio<br />
Name: HAProxy<br />
Version: 1.3.23<br />
Release_date: 2010/01/28<br />
Nbproc: 1<br />
Process_num: 1<br />
Pid: 11829<br />
Uptime: 0d 0h42m53s<br />
Uptime_sec: 2573<br />
Memmax_MB: 0<br />
Ulimit-n: 50013<br />
Maxsock: 50013<br />
Maxconn: 25000<br />
Maxpipes: 0<br />
CurrConns: 1<br />
PipesUsed: 0<br />
PipesFree: 0<br />
Tasks: 1<br />
Run_queue: 1<br />
node: ravi.world<br />
description:</p>
<p><strong>This will give you stats on all of your backends and frontends, some of the same stuff you see on the stats page enabled by the stats uri configuration. As an added bonus it’s all in CSV.</strong></p>
<p>ravi@arun:~$ echo &#8220;show stat&#8221; | socat unix-connect:/tmp/haproxy stdio<br />
#<br />
pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,ch<br />
kdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,<br />
ravitestbed,FRONTEND,,,0,5,100,30,32582,50616,0,0,0,,,,,OPEN,,,,,,,,,1,1,0,,,,0,0,0,5,<br />
ravitestbed,trupti,0,0,0,2,,15,7020,22722,,0,,0,0,0,0,no check,1,1,0,,,,,,1,1,1,,15,,2,0,,2,<br />
ravitestbed,arun,0,0,0,5,,15,25562,27894,,0,,0,0,0,0,no check,1,1,0,,,,,,1,1,2,,15,,2,0,,3,<br />
ravitestbed,BACKEND,0,0,0,5,100,30,32582,50616,0,0,,0,0,0,0,UP,2,2,0,,0,2710,0,,1,1,0,,30,,1,0,,5,<br />
stats,FRONTEND,,,0,1,100,21,9605,152357,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,9,<br />
stats,BACKEND,0,0,0,1,100,5,9605,152357,0,0,,5,0,0,0,UP,0,0,0,,0,2710,0,,1,2,0,,0,,1,0,,4,</p>
<p><strong>show errors will give you a capture of last error on each backend/frontend.</strong></p>
<p>ravi@arun:~$ echo &#8220;show errors&#8221; | socat unix-connect:/tmp/haproxy stdio</p>
<p>Reffer:</p>
<p>http://www.dest-unreach.org/socat/</p>
<p>http://haproxy.1wt.eu/download/1.3/doc/configuration.txt</p>
<p>Thanks to Joe (http://www.joeandmotorboat.com)</p>
<p>Thank you,<br />
Ravi<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/zh-hans/2010/how-to-use-socat-with-haproxy-stat-2/" rel="bookmark" title="February 25, 2010">How to use socat with haproxy stat</a></li>
<li><a href="http://www.indiangnu.org/ru/2010/how-to-use-socat-with-haproxy-stat-3/" rel="bookmark" title="February 25, 2010">How to use socat with haproxy stat</a></li>
<li><a href="http://www.indiangnu.org/ja/2010/how-to-use-socat-with-haproxy-stat-4/" rel="bookmark" title="February 25, 2010">How to use socat with haproxy stat</a></li>
<li><a href="http://www.indiangnu.org/2009/haproxy-load-balancer/" rel="bookmark" title="August 14, 2009">HAProxy Load Balancer</a></li>
<li><a href="http://www.indiangnu.org/2007/mysql-full-db-dump-shell-script/" rel="bookmark" title="November 28, 2007">MySQL full DB dump  -shell  script</a></li>
<li><a href="http://www.indiangnu.org/2010/haproxy-apache-dropping-the-connections/" rel="bookmark" title="January 24, 2010">Haproxy + apache dropping the connections</a></li>
<li><a href="http://www.indiangnu.org/2008/capturing-a-unix-terminal-session/" rel="bookmark" title="January 17, 2008">Capturing a UNIX terminal session!</a></li>
</ul>
<p><!-- Similar Posts took 4.614 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-use-socat-with-haproxy-stat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use TCP Wrappers for system security</title>
		<link>http://www.indiangnu.org/2010/how-to-use-tcp-wrappers-for-system-security/</link>
		<comments>http://www.indiangnu.org/2010/how-to-use-tcp-wrappers-for-system-security/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 13:01:33 +0000</pubDate>
		<dc:creator>Manoj Chauhan</dc:creator>
				<category><![CDATA[Linux Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[System Security]]></category>
		<category><![CDATA[TCP Wrappers]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=911</guid>
		<description><![CDATA[Introduction:-
Access control to services compiled with TCP wrappers support is implemented by the /etc/hosts.allow and /etc/hosts.deny files. When a connection attempt is made, the hosts.allow file is checked. If a line is matched, the connection is allowed. Then the hosts.deny file is consulted, if a line is matched, the connection is denied. If no matches [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:-</strong></p>
<p>Access control to services compiled with TCP wrappers support is implemented by the /etc/hosts.allow and /etc/hosts.deny files. When a connection attempt is made, the hosts.allow file is checked. If a line is matched, the connection is allowed. Then the hosts.deny file is consulted, if a line is matched, the connection is denied. If no matches have occurred in either file, the connection is allowed.</p>
<p><strong>Create Authorized Use Only Banners</strong>-</p>
<p>If configured as described below, TCP wrappers will display a warning banner to any user attempting to connect to a service it monitors. The following set of commands generate the directory /etc/banners, and the files therein contain warning banner text for each service. In this example, the banner text is &#8220;Use of this system is restricted to authorized users.&#8221; Note that exact wording of a warning banner is site specific; however, it should at least emphasize that the use of the system is restricted to authorized persons and that consent to monitor activities is implied by logging in to the system.</p>
<p>[root@localhost]# /bin/mkdir -p /etc/banners<br />
[root@localhost]# /bin/echo &#8220;Use of this system is restricted to authorized users&#8221; &gt; /etc/banners/<br />
prototype<br />
[root@localhost]# cd /etc/banners ; /usr/bin/make -f /usr/share/doc/tcp_wrappers-7.6/Banners.Makefile</p>
<p><strong>Deny Everything Except What is Explicitly Allowed</strong>-</p>
<p>In order to implement the security best practice stance of deny everything except what is explicitly allowed, issue the following command.<br />
[root@localhost]# echo &#8216;ALL: ALL: spawn (/bin/echo -e &#8216;/bin/date&#8217;&#8221;\n%c attempted connection to %s<br />
and was denied&#8221; \<br />
&gt; | /bin/mail -s &#8220;Connection attempt to %s&#8221; root) &amp;&#8217; &gt; /etc/hosts.deny</p>
<p>Any connection attempt not listed in the hosts.allow file will be denied, a message will be logged to the syslog auth facility, and an email will be sent to root.<br />
Allow Access to Those Who Require It</p>
<p>Edit the hosts.allow file and add a line for each service to which access should be allowed. A few examples are shown below (See the man pages for hosts.allow for more detail).</p>
<p>ALL: LOCAL : banners /etc/banners            # All services from local clients (hostnames with no &#8220;.&#8221;)<br />
sshd: 10.1.1.0/255.255.254.0 : banners /etc/banners # SSH connections from host IP addresses  between 10.1.1.0 and 10.1.2.0</p>
<p>Thanks<br />
Manoj Chauhan<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/zh-hans/2010/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%b3%bb%e7%bb%9f%e5%ae%89%e5%85%a8tcp%e4%bc%9a%e7%bb%95/" rel="bookmark" title="February 22, 2010">如何使用系统安全TCP会绕</a></li>
<li><a href="http://www.indiangnu.org/2007/how-to-disabledenabled-access-to-crontab/" rel="bookmark" title="August 20, 2007">How to disabled/enabled access to crontab?</a></li>
<li><a href="http://www.indiangnu.org/2008/shell-script-to-monitor-running-services-such-as-webhttp-ssh-mail-etc/" rel="bookmark" title="January 2, 2008">Shell script to monitor running services such as web/http, ssh, mail etc.</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-configure-vsftp-server-on-redhat-debian-based-system/" rel="bookmark" title="January 15, 2008">How to configure FTP server on  Redhat &#038; debian based system</a></li>
<li><a href="http://www.indiangnu.org/2008/start-stop-oracle-service/" rel="bookmark" title="January 2, 2008">Start &#038; stop oracle service</a></li>
<li><a href="http://www.indiangnu.org/2007/plesk-access-denied-error-while-login/" rel="bookmark" title="October 17, 2007">Plesk &#8211; &#8220;Access Denied&#8221; Error while login!!</a></li>
<li><a href="http://www.indiangnu.org/2007/denial-of-service-dos/" rel="bookmark" title="December 31, 2007">Denial of Service (DoS)</a></li>
</ul>
<p><!-- Similar Posts took 4.062 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-use-tcp-wrappers-for-system-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good practices for apache &amp; php</title>
		<link>http://www.indiangnu.org/2010/good-practices-for-apache-php/</link>
		<comments>http://www.indiangnu.org/2010/good-practices-for-apache-php/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:40:14 +0000</pubDate>
		<dc:creator>Manoj Chauhan</dc:creator>
				<category><![CDATA[Debian & Ubuntu]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[UNIX/Linux]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=908</guid>
		<description><![CDATA[Introduction &#8211; 
To conclude the discussion about session management, here are some best practices to demonstrate that a robust scheme requires serious thinking:
•    Create a session token upon first visit.
•    When performing authentication, destroy the old session and create a new one.
•    Limit session lifetime to a short period (a few hours).
•    Destroy inactive sessions [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction &#8211; </strong></p>
<p>To conclude the discussion about session management, here are some best practices to demonstrate that a robust scheme requires serious thinking:<br />
•    Create a session token upon first visit.<br />
•    When performing authentication, destroy the old session and create a new one.<br />
•    Limit session lifetime to a short period (a few hours).<br />
•    Destroy inactive sessions regularly.<br />
•    Destroy sessions after users log out.<br />
•    Ask users to re-authenticate before an important task is performed (e.g., an order is placed).<br />
•    Do not use the same session for a non-SSL part of the site as for the SSL part of the site because non-SSL traffic can be intercepted and the session token obtained from it. Treat them as two different servers.<br />
•    If cookies are used to transport session tokens in an SSL application, they should be marked &#8220;secure.&#8221; Secure cookies are never sent over a non-SSL connection.<br />
•    Regenerate session tokens from time to time.<br />
•    Monitor client parameters (IP address, the User-Agent request header) and send warnings to the error log when they change. Some information (e.g., the contents of the User-Agent header) should not change for the lifetime of a session. Invalidate the session if it does.<br />
•    If you know where your users are coming from, attach each session to a single IP address, and do not allow the address to change.<br />
•    If you can, do not accept users coming through web proxies. This will be difficult to do for most public sites but easier for internal applications.<br />
•    If you can, do not accept users coming through open web proxies. Open proxies are used when users want to stay anonymous or otherwise hide their tracks. You can detect which proxies are open by extracting the IP address of the proxy from each proxied request and having a script automatically test whether the proxy is open or not.<br />
•    If you do allow web proxies, consider using Java applets or Flash movies (probably a better choice since such movies can pretend to be regular animations) to detect the users&#8217; real IP addresses. It&#8217;s a long shot but may work in some cases.<br />
•    Web users can upload only jpeg, gif, png files not php extension<br />
•    We can place a blank index page in each directory in question and users can not execute php etc scripts from the image folders or image/document upload folders.<br />
•    Upgrade apache current version (2.0) to newer version (2.2)</p>
<p>Thanks<br />
Manoj Chauhan<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/2007/how-to-secure-session-in-php/" rel="bookmark" title="July 25, 2007">How to secure Session in PHP</a></li>
<li><a href="http://www.indiangnu.org/2007/php-ip-address-to-country/" rel="bookmark" title="September 15, 2007">PHP &#8211; IP address  to Country</a></li>
<li><a href="http://www.indiangnu.org/2007/denial-of-service-dos/" rel="bookmark" title="December 31, 2007">Denial of Service (DoS)</a></li>
<li><a href="http://www.indiangnu.org/2008/is-2008-going-to-be-the-year-of-linux/" rel="bookmark" title="January 9, 2008">Is 2008 going to be the year of Linux?</a></li>
<li><a href="http://www.indiangnu.org/2008/the-ruby-programming-language/" rel="bookmark" title="January 26, 2008">The Ruby Programming language</a></li>
<li><a href="http://www.indiangnu.org/2007/ipv6-internet-protocol-version-6/" rel="bookmark" title="October 13, 2007">IPv6 -Internet Protocol version 6</a></li>
<li><a href="http://www.indiangnu.org/2007/php-and-ftp/" rel="bookmark" title="March 23, 2007">PHP and FTP</a></li>
</ul>
<p><!-- Similar Posts took 4.048 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/good-practices-for-apache-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Haproxy + apache dropping the connections</title>
		<link>http://www.indiangnu.org/2010/haproxy-apache-dropping-the-connections/</link>
		<comments>http://www.indiangnu.org/2010/haproxy-apache-dropping-the-connections/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 17:14:35 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux Networking]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>
		<category><![CDATA[UNIX/Linux]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=898</guid>
		<description><![CDATA[Many times  haproxy and apache does not reliable to serve the connections without tune or we say we need to set system as well some kernel parameters to work it better.
Here haproxy gives an errors to connect to apache, at that time it logs the errors into &#8216;dmesg &#124; tail&#8217; or in &#8216;/var/log/messages&#8217; &#8220;kernel: ip_conntrack: [...]]]></description>
			<content:encoded><![CDATA[<p>Many times  haproxy and apache does not reliable to serve the connections without tune or we say we need to set system as well some kernel parameters to work it better.</p>
<p>Here haproxy gives an errors to connect to apache, at that time it logs the errors into &#8216;dmesg | tail&#8217; or in &#8216;/var/log/messages&#8217; &#8220;kernel: ip_conntrack: table full, dropping packet&#8221; that is related to ip_conntrack kernel module.</p>
<p>Conntrack table is hash table (hash map) of fixed size (8192 entries by default), which is used for primary lookup. When the slot in the table is found it points to list of conntrack structures, so secondary lookup is done using list traversal. 65536/8192 gives 8 – the average list length. You may want to experiment with this value on heavily loaded systems.</p>
<p>If this error founds into /var/log/messages or dmesg you have to apply following steps to resolve.</p>
<p>Here I have done this to changes and added few settings in kernel also we will do it to set apache MPM and Haproxy tunning with sysctl.conf</p>
<p>Note: I have tried all this workaround and apply on CentOS-5.2, but don&#8217;t worry ip_conntrack module is default in kernel 2.6 +</p>
<p>1) To check ip_contrack is compiled with your kernel</p>
<p>[root@ravi.com ~]#<strong> modinfo ip_conntrack</strong><br />
<em>filename:       /lib/modules/2.6.18-128.el5/kernel/net/ipv4/netfilter/ip_conntrack.ko<br />
license:        GPL<br />
srcversion:     F1390E605BBFB05078B78E8<br />
depends:        nfnetlink<br />
vermagic:       2.6.18-128.el5 SMP mod_unload gcc-4.1<br />
module_sig:     883f350497747c575ed35fe9471dce112565509f4b58f4f3e440c6bcc05c2fba9bbdd224bdeb8209e293da385133a876e44a7b449ba59a882a8282b<br />
</em><br />
2) Probe ip_conntrack kernel module or add it in /etc/modprobe.conf</p>
<p>[root@ravi.com ~]#<strong> modprobe ip_conntrack hashsize=131072</strong></p>
<p>or</p>
<p>open /etc/modprobe.conf and add below lines at the end of file<br />
<strong><br />
options ip_conntrack hashsize=131072</strong></p>
<p>3) before go to apply the 4th step, just check the ip_conntrack setting is into /etc/sysctl.conf</p>
<p><em><strong>grep &#8220;ip_conntrack&#8221; /etc/sysctl.conf</strong></em></p>
<p>if its found then apply 4th step or edit the /etc/sysctl.conf and add the given two lines at the end of file and save it then go for 4th step<br />
(the value is compare to your RAM and set it to below)</p>
<p><em>net.ipv4.ip_conntrack_max = 16777216<br />
net.ipv4.netfilter.ip_conntrack_max = 16777216</em></p>
<p>4) To apply the sysctl parameters run &#8217;sysctl -p&#8217;</p>
<p>[root@ravi.com ~]# <strong>sysctl -p</strong></p>
<p>5) Now check the ip_conntrack is logging the connections and check not dropping any more</p>
<p>[root@ravi.com ~]# <strong>cat /proc/slabinfo | grep conn</strong><br />
<em>ip_conntrack_expect      0      0    136   28    1 : tunables  120   60    8 : slabdata      0      0      0<br />
ip_conntrack      216053 231335    304   13    1 : tunables   54   27    8 : slabdata  17795  17795    216</em></p>
<p>6) Also you can check how much memory utilized by ip_conntrack module per connection.</p>
<p>[root@ravi.com ~]# <strong>grep ip_conntrack /var/log/messages </strong></p>
<p><em>/var/log/messages.2:Jan 14 21:46:04 ravi kernel: ip_conntrack version 2.4 (8192 buckets, 65536 max) &#8211; <strong>304 bytes per conntrack</strong></em></p>
<p><strong>1M connections</strong> would require<strong> 304MB</strong> of kernel memory.</p>
<p>Thanks<br />
Ravi<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/2009/haproxy-load-balancer/" rel="bookmark" title="August 14, 2009">HAProxy Load Balancer</a></li>
<li><a href="http://www.indiangnu.org/2007/load-balancing-shell-script/" rel="bookmark" title="November 28, 2007">Load Balancing &#8211; shell script</a></li>
<li><a href="http://www.indiangnu.org/2007/load-balancing-for-sharing-multiple-internet-connections/" rel="bookmark" title="November 26, 2007">Load Balancing for sharing  multiple internet connections</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-reload-service-by-using-kill-command/" rel="bookmark" title="January 3, 2008">How to reload service by using kill command</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-smarthost-on-linux-using-sendmail/" rel="bookmark" title="August 25, 2008">How to smarthost on linux using sendmail</a></li>
<li><a href="http://www.indiangnu.org/2007/how-to-mount-remote-ssh-filesystem-by-using-sshfs/" rel="bookmark" title="January 25, 2007">How to mount remote ssh filesystem by using sshfs</a></li>
<li><a href="http://www.indiangnu.org/2010/how-to-use-socat-with-haproxy-stat/" rel="bookmark" title="February 25, 2010">How to use socat with haproxy stat</a></li>
</ul>
<p><!-- Similar Posts took 4.066 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/haproxy-apache-dropping-the-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure-add java extension for php on CentOS 5</title>
		<link>http://www.indiangnu.org/2010/how-to-configure-add-java-extension-for-php-on-centos-2/</link>
		<comments>http://www.indiangnu.org/2010/how-to-configure-add-java-extension-for-php-on-centos-2/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 12:52:12 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP & Java Script]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>
		<category><![CDATA[UNIX/Linux]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=850</guid>
		<description><![CDATA[Here I have used php version 5.2.11 and to jdk-6u18-linux-x64.bin 
( from given JAVA download link)
[root@ravi.com ~]# yum  -y install httpd php php-devel php-gd php-cli php-xml php-ldap php-common php-pear php-pdo
Install java jdk and set env in ~/.bashrc also run this on CLI to verify before next step.
export JAVA_HOME=//usr/java/jdk1.6.0_18
export PATH=/usr/java/jdk1.6.0_18/bin:$PATH
[root@ravi.com ~]# echo $JAVA_HOME
Now set the dynamic [...]]]></description>
			<content:encoded><![CDATA[<p>Here I have used <a href="http://php.net" target="_blank">php</a> version 5.2.11 and to<a href="http://cds-esd.sun.com/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin?AuthParam=1264140824_723b2ca773378d9cf200980b1ffcf799&amp;TicketId=nod1AFsTRXF9leApkk%2BZWJiRcw%3D%3D&amp;GroupName=CDS&amp;FilePath=/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin&amp;File=jdk-6u18-linux-x64.bin" target="_blank"> jdk-6u18-linux-x64.bin </a></p>
<p>( from given <a title="JAVA" href="http://cds-esd.sun.com/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin?AuthParam=1264140824_723b2ca773378d9cf200980b1ffcf799&amp;TicketId=nod1AFsTRXF9leApkk%2BZWJiRcw%3D%3D&amp;GroupName=CDS&amp;FilePath=/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin&amp;File=jdk-6u18-linux-x64.bin" target="_blank">JAVA</a> download link<a title="JAVA" href="http://cds-esd.sun.com/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin?AuthParam=1264140824_723b2ca773378d9cf200980b1ffcf799&amp;TicketId=nod1AFsTRXF9leApkk%2BZWJiRcw%3D%3D&amp;GroupName=CDS&amp;FilePath=/ESD6/JSCDL/jdk/6u18-b07/jdk-6u18-linux-x64.bin&amp;File=jdk-6u18-linux-x64.bin" target="_blank"></a>)</p>
<p>[root@ravi.com ~]# yum  -y install httpd php php-devel php-gd php-cli php-xml php-ldap php-common php-pear php-pdo</p>
<p>Install java jdk and set env in ~/.bashrc also run this on CLI to verify before next step.</p>
<p><em>export JAVA_HOME=//usr/java/jdk1.6.0_18<br />
export PATH=/usr/java/jdk1.6.0_18/bin:$PATH</em></p>
<p>[root@ravi.com ~]# echo $JAVA_HOME</p>
<p>Now set the dynamic linker library path into <em>/etc/ld.so.conf </em></p>
<p>/usr/java/jdk1.6.0_18/jre/lib/amd64<br />
/usr/java/jdk1.6.0_18/jre/lib/amd64/server</p>
<p>[root@ravi.com ~]# ldconfig</p>
<p>Now download php-java-bridge source rpm</p>
<p>[root@ravi.com ~]# wget ftp://195.220.108.108/linux/sourceforge/p/project/ph/php-java-bridge/OldFiles/php-java-bridge-4.1.8-1.src.rpm</p>
<p>unpack the php-java-bridge rpm</p>
<p>[root@ravi.com ~]# rpm2cpio php-java-bridge-4.1.8-1.src.rpm | cpio -ivd<br />
php-java-bridge.spec<br />
php-java-bridge_4.1.8.tar.gz<br />
16155 blocks</p>
<p>untar the php-java-bridge and configure the module</p>
<p>[root@ravi.com ~]# tar xzf php-java-bridge_4.1.8.tar.gz &amp;&amp; cd php-java-bridge-4.1.8</p>
<p>[root@ravi.com ~]# phpize</p>
<p>[root@ravi.com ~]# ./configure &#8211;with-java=$JAVA_HOME  &amp;&amp;  make &amp;&amp;  make install</p>
<p>[root@ravi.com ~]# echo &#8220;extension=java.so&#8221; &gt; /etc/php.d/java.ini</p>
<p>open the php.ini and edit the at the end of file<br />
<em><br />
[java]<br />
java.class.path=/usr/lib64/php/modules/<br />
java.library=/usr/java/jdk1.6.0_18/jre/lib/amd64/server/libjvm.so</em></p>
<p>Now restart apache<br />
[root@ravi.com ~]# /etc/init.d/httpd restart</p>
<p>[root@ravi.com ~]# php -i | grep java<br />
<em>/etc/php.d/java.ini,<br />
java<br />
java support =&gt; Enabled<br />
java bridge =&gt; 4.1.8<br />
java.java_home =&gt;<br />
java.java =&gt; java<br />
java.log_file =&gt; &lt;stderr&gt;<br />
java.log_level =&gt; no value (use back-end&#8217;s default level)<br />
java.security_policy =&gt; Off<br />
java command =&gt;  LD_LIBRARY_PATH=/usr/lib64/php/modules:/usr/lib/10.2.0.3/client64/lib java -Djava.library.path=/usr/lib64/php/modules -Djava.class.path=/usr/lib64/php/modules/JavaBridge.jar -Djava.awt.headless=true -Dphp.java.bridge.base=/usr/lib64/php/modules php.java.bridge.Standalone LOCAL:9267 1<br />
java status =&gt; running<br />
java server =&gt; 9267<br />
PATH =&gt; /usr/java/jdk1.6.0_18/bin:/usr/java/jdk1.6.0_18/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin<br />
JAVA_HOME =&gt; /usr/java/jdk1.6.0_18<br />
_SERVER["PATH"] =&gt; /usr/java/jdk1.6.0_18/bin:/usr/java/jdk1.6.0_18/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin<br />
_SERVER["JAVA_HOME"] =&gt; /usr/java/jdk1.6.0_18<br />
_ENV["PATH"] =&gt; /usr/java/jdk1.6.0_18/bin:/usr/java/jdk1.6.0_18/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin<br />
_ENV["JAVA_HOME"] =&gt; /usr/java/jdk1.6.0_18<br />
</em></p>
<p>Test your code in test.php and run to check<br />
<em>&lt;?php<br />
// get instance of Java class java.lang.System in PHP<br />
$system = new Java(&#8216;java.lang.System&#8217;); // demonstrate property access<br />
print &#8216;Java version=&#8217;.$system-&gt;getProperty(&#8216;java.version&#8217;).&#8217; &#8216;;<br />
print &#8216;Java vendor=&#8217; .$system-&gt;getProperty(&#8216;java.vendor&#8217;).&#8217; &#8216;;<br />
print &#8216;OS=&#8217;.$system-&gt;getProperty(&#8216;os.name&#8217;).&#8217; &#8216;.<br />
$system-&gt;getProperty(&#8216;os.version&#8217;).&#8217; on &#8216;.<br />
$system-&gt;getProperty(&#8216;os.arch&#8217;).&#8217; &#8216;; // java.util.Date example<br />
$formatter = new Java(&#8216;java.text.SimpleDateFormat&#8217;,<br />
&#8220;EEEE, MMMM dd, yyyy &#8216;at&#8217; h:mm:ss a zzzz&#8221;); print $formatter-&gt;format(new Java(&#8216;java.util.Date&#8217;));<br />
?&gt;</em></p>
<p>[root@ravi.com ~]# php test.php<br />
<em>Java version=1.6.0_18 Java vendor=Sun Microsystems Inc. OS=Linux 2.6.18-53.el5xen on amd64 Friday, January 22, 2010 at 4:44:48 AM Pacific Standard Time</em><br />
Thanks</p>
<p>Ravi<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/2008/php-java-bridge-compilationinstalltion-and-configuration/" rel="bookmark" title="January 4, 2008">PHP-Java Bridge  &#8211; compilation, installtion and configuration</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-install-tomcat-on-linux/" rel="bookmark" title="July 8, 2008">How to install Tomcat on Linux</a></li>
<li><a href="http://www.indiangnu.org/2009/open-source-and-extract-transform-load-etl/" rel="bookmark" title="October 21, 2009">Open Source and Extract, Transform &#038; Load (ETL)</a></li>
<li><a href="http://www.indiangnu.org/2008/a-glance-into-ruby-on-rails/" rel="bookmark" title="January 29, 2008">A Glance into Ruby on Rails</a></li>
<li><a href="http://www.indiangnu.org/2007/how-to-mount-remote-ssh-filesystem-by-using-sshfs/" rel="bookmark" title="January 25, 2007">How to mount remote ssh filesystem by using sshfs</a></li>
<li><a href="http://www.indiangnu.org/2007/rync-client-script/" rel="bookmark" title="December 18, 2007">Rsync Client script</a></li>
<li><a href="http://www.indiangnu.org/2010/good-practices-for-apache-php/" rel="bookmark" title="February 19, 2010">Good practices for apache &#038; php</a></li>
</ul>
<p><!-- Similar Posts took 4.580 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-configure-add-java-extension-for-php-on-centos-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PDO_OCI extension for php5</title>
		<link>http://www.indiangnu.org/2010/how-to-install-pdo_oci-extension-for-php-5/</link>
		<comments>http://www.indiangnu.org/2010/how-to-install-pdo_oci-extension-for-php-5/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 04:32:16 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP & Java Script]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=844</guid>
		<description><![CDATA[To enable pdo_oci module you may need to install oracle client and oci8 module is require. I have installed oracle 10g client here.
[root@ravi.com ~]# export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client64/ ; export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client64/
[root@ravi.com ~]# cd /tmp
[root@ravi.com tmp]# pecl download pdo_oci
[root@ravi.com tmp]# tar xvzf PDO_OCI-1.0.tar.gz
[root@ravi.com tmp]# cd PDO_OCI-1.0 &#38;&#38; phpize
[root@ravi.com tmp]# ./configure
[root@ravi.com PDO_OCI-1.0]# make
/bin/sh /tmp/PDO_OCI-1.0/libtool &#8211;mode=compile gcc -I/usr/include/php/ext -I. -I/tmp/PDO_OCI-1.0 [...]]]></description>
			<content:encoded><![CDATA[<p>To enable pdo_oci module you may need to install oracle client and oci8 module is require. I have installed oracle 10g client here.</p>
<p>[root@ravi.com ~]# export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client64/ ; export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client64/<br />
[root@ravi.com ~]# cd /tmp<br />
[root@ravi.com tmp]# pecl download pdo_oci<br />
[root@ravi.com tmp]# tar xvzf PDO_OCI-1.0.tar.gz<br />
[root@ravi.com tmp]# cd PDO_OCI-1.0 &amp;&amp; phpize<br />
[root@ravi.com tmp]# ./configure<br />
[root@ravi.com PDO_OCI-1.0]# make<br />
/bin/sh /tmp/PDO_OCI-1.0/libtool &#8211;mode=compile gcc -I/usr/include/php/ext -I. -I/tmp/PDO_OCI-1.0 -DPHP_ATOM_INC -I/tmp/PDO_OCI-1.0/include -I/tmp/PDO_OCI-1.0/main -I/tmp/PDO_OCI-1.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /tmp/PDO_OCI-1.0/pdo_oci.c -o pdo_oci.lo<br />
mkdir .libs<br />
gcc -I/usr/include/php/ext -I. -I/tmp/PDO_OCI-1.0 -DPHP_ATOM_INC -I/tmp/PDO_OCI-1.0/include -I/tmp/PDO_OCI-1.0/main -I/tmp/PDO_OCI-1.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/PDO_OCI-1.0/pdo_oci.c  -fPIC -DPIC -o .libs/pdo_oci.o<br />
In file included from /tmp/PDO_OCI-1.0/pdo_oci.c:31:<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:21:17: error: oci.h: No such file or directory<br />
In file included from /tmp/PDO_OCI-1.0/pdo_oci.c:31:<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:26: error: expected specifier-qualifier-list before &#8217;sb4&#8242;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:32: error: expected specifier-qualifier-list before &#8216;OCIServer&#8217;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:48: error: expected specifier-qualifier-list before &#8216;OCIDefine&#8217;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:62: error: expected specifier-qualifier-list before &#8216;OCIStmt&#8217;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:73: error: expected specifier-qualifier-list before &#8216;OCIBind&#8217;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:85: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;PDO_OCI_INIT_MODE&#8217;<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:87: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;*&#8217; token<br />
/tmp/PDO_OCI-1.0/php_pdo_oci_int.h:89: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;_oci_error&#8217;<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:71: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;PDO_OCI_INIT_MODE&#8217;<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:87: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;*&#8217; token<br />
/tmp/PDO_OCI-1.0/pdo_oci.c: In function &#8216;zm_startup_pdo_oci&#8217;:<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:96: error: &#8216;pdo_oci_Env&#8217; undeclared (first use in this function)<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:96: error: (Each undeclared identifier is reported only once<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:96: error: for each function it appears in.)<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:96: error: &#8216;PDO_OCI_INIT_MODE&#8217; undeclared (first use in this function)<br />
<strong>/tmp/PDO_OCI-1.0/pdo_oci.c: In function &#8216;zm_shutdown_pdo_oci&#8217;:<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:111: error: &#8216;dvoid&#8217; undeclared (first use in this function)<br />
/tmp/PDO_OCI-1.0/pdo_oci.c:111: error: expected expression before &#8216;)&#8217; token<br />
make: *** [pdo_oci.lo] Error 1</strong></p>
<p>Is this the error that pdo does not connect to oci library and its find these into include subfolder, so you may need to copy all the files into include folder.</p>
<p>[root@ravi.com PDO_OCI-1.0]# cp -f /usr/include/oracle/10.2.0.3/client64/* /tmp/PDO_OCI-1.0/include/</p>
<p>Now run make &amp; make install to compile and install the module.</p>
<p>[root@ravi.com PDO_OCI-1.0]# make &amp;&amp; make install</p>
<p>enable the pdo_oci extension with php.</p>
<p>[root@ravi.com PDO_OCI-1.0]# echo &#8220;extension=pdo_oci.so&#8221; &gt; /etc/php.d/pdo_oci.ini</p>
<p>[root@ravi.com PDO_OCI-1.0]# php -m | grep pdo_oci</p>
<p>To work pdo_oci properly you have to restart apache.</p>
<p>Thanks</p>
<p>Ravi<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/zh-hans/2010/how-to-install-pdo_oci-extension-for-php5/" rel="bookmark" title="January 19, 2010">How to install PDO_OCI extension for php5</a></li>
<li><a href="http://www.indiangnu.org/2007/php-oracle-connectivity/" rel="bookmark" title="April 11, 2007">PHP &#8211; Oracle Connectivity</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-convert-nero-image-to-iso-image-and-extract-iso-image/" rel="bookmark" title="November 26, 2008">How to convert nero image to iso image and extract iso image</a></li>
<li><a href="http://www.indiangnu.org/2008/start-stop-oracle-service/" rel="bookmark" title="January 2, 2008">Start &#038; stop oracle service</a></li>
<li><a href="http://www.indiangnu.org/2008/oracle-db-102g-installation-on-ubuntu-linux/" rel="bookmark" title="October 28, 2008">Oracle DB 10.2g installation on Ubuntu Linux &#8211; part 1</a></li>
<li><a href="http://www.indiangnu.org/2009/multi-user-conferencing-mu-conference-for-jabber-jabberd2/" rel="bookmark" title="October 15, 2009">Multi User Conferencing (MU-Conference) for Jabber (Jabberd2)</a></li>
<li><a href="http://www.indiangnu.org/2007/oracle-application-express/" rel="bookmark" title="March 8, 2007">ORACLE Application Express</a></li>
</ul>
<p><!-- Similar Posts took 4.664 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-install-pdo_oci-extension-for-php-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install &amp; configure VNC server on CentOS</title>
		<link>http://www.indiangnu.org/2010/how-to-install-configure-vnc-server-on-centos/</link>
		<comments>http://www.indiangnu.org/2010/how-to-install-configure-vnc-server-on-centos/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:29:28 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Linux Networking]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=835</guid>
		<description><![CDATA[How to install VNCSERVER on CentOS
yum groupinstall &#8220;GNOME Desktop Environment&#8221;
yum install xterm vnc-server vnc
remove the existing file &#38; edit with &#8216;/etc/sysconfig/vncservers&#8216; and put the following lines in it
VNCSERVERS=&#8221;2:root&#8221;
VNCSERVERARGS[2]=&#8221;-geometry 800&#215;600 -nolisten tcp -nohttpd -localhost&#8221;
set the vnc password to open the vnc for user root (you have to login as a root)
vncpasswd
set the vnc password to open [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How to install VNCSERVER on CentOS</strong></p>
<p>yum groupinstall &#8220;GNOME Desktop Environment&#8221;<br />
<em>yum install xterm vnc-server vnc</em></p>
<p>remove the existing file &amp; edit with &#8216;<em>/etc/sysconfig/vncservers</em>&#8216; and put the following lines in it</p>
<p>VNCSERVERS=&#8221;2:root&#8221;<br />
VNCSERVERARGS[2]=&#8221;-geometry 800&#215;600 -nolisten tcp -nohttpd -localhost&#8221;</p>
<p>set the vnc password to open the vnc for user root (you have to login as a root)<br />
<em>vncpasswd</em></p>
<p>set the vnc password to open the vnc for user (you have to login as a normal user that way it will create the file xstartup in $home/.vnc)<br />
<em>vncpasswd</em></p>
<p>Now start the vncserver as root user<br />
<em>/etc/init.d/vncserver start</em></p>
<p>Now kill the vncserver proocesses using &#8216;ps aux | grep vnc | xargs kill -9&#8242;</p>
<p>and start vnc server by following command<br />
<em>vncserver</em></p>
<p>check the given path to open the vnc display as given in example<br />
New &#8216;appserver.ravi.com:3 (root)&#8217; desktop is appserver.ravi.com:3</p>
<p>before open the vncviewer remove the file &#8216;/tmp/.X1-lock&#8217;</p>
<p>Now open the vnc display you will get the default &#8216;xterm&#8217; open on it.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/ru/2010/%d0%ba%d0%b0%d0%ba-%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%b8%d1%82%d1%8c-%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b8%d1%82%d1%8c-vnc-server-%d0%bd%d0%b0-centos/" rel="bookmark" title="January 15, 2010">Как установить &#038; настроить VNC Server на CentOS</a></li>
<li><a href="http://www.indiangnu.org/2008/ssh-to-run-command-on-a-remote-machine/" rel="bookmark" title="January 20, 2008">SSH to Run Command on a Remote Machine..</a></li>
<li><a href="http://www.indiangnu.org/2008/is-2008-going-to-be-the-year-of-linux/" rel="bookmark" title="January 9, 2008">Is 2008 going to be the year of Linux?</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-wordpress-on-ubuntu-gusty-710/" rel="bookmark" title="June 26, 2008">How to install wordpress on Ubuntu Gusty 7.10</a></li>
<li><a href="http://www.indiangnu.org/2009/subversion-how-to-configure-with-apache-webdav-or-svnserve/" rel="bookmark" title="February 7, 2009">Subversion &#8211; How to configure with Apache WebDAV or svnserve</a></li>
<li><a href="http://www.indiangnu.org/2008/create-users-and-change-passwords-with-a-bash-script/" rel="bookmark" title="January 11, 2008">Create Users And Change Passwords With A Bash Script</a></li>
<li><a href="http://www.indiangnu.org/2008/installing-zabbix-server-and-agent-on-ubuntu-gusty710/" rel="bookmark" title="June 25, 2008">Installing Zabbix (Server and Agent) On Ubuntu Gusty7.10</a></li>
</ul>
<p><!-- Similar Posts took 4.695 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-install-configure-vnc-server-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install GeoIP and mod_geoip2 on centos for apache</title>
		<link>http://www.indiangnu.org/2010/how-to-install-geoip-and-mod_geoip2-on-centos-for-apache-2/</link>
		<comments>http://www.indiangnu.org/2010/how-to-install-geoip-and-mod_geoip2-on-centos-for-apache-2/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 13:35:35 +0000</pubDate>
		<dc:creator>Ravi Bhure</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Redhat & Fedora]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=833</guid>
		<description><![CDATA[How to install GeoIP and mod_geoip2 on centos for apache
1) yum install GeoIP GeoIP-devel GeoIP-data zlib-devel
2) mkdir /usr/local/share/GeoIP
3) Download the latest Country and City database files from maxmind
cd /usr/local/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoLiteCity.dat.gz
4) yum install httpd-devel apr-devel
5) wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/
6) tar xvzf mod_geoip2_1.2.5.tar.gz &#38;&#38; cd mod_geoip2_1.2.5
7) apxs -i -a -L/usr/lib64 -I/usr/include -lGeoIP -c mod_geoip.c
 Enabling mod-geoip
Nothing’s [...]]]></description>
			<content:encoded><![CDATA[<p>How to install GeoIP and mod_geoip2 on centos for apache</p>
<p>1) yum install GeoIP GeoIP-devel GeoIP-data zlib-devel</p>
<p>2) mkdir /usr/local/share/GeoIP</p>
<p>3) Download the latest Country and City database files from maxmind</p>
<p>cd /usr/local/share/GeoIP<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz<br />
gunzip GeoIP.dat.gz<br />
gunzip GeoLiteCity.dat.gz</p>
<p>4) yum install httpd-devel apr-devel</p>
<p>5) wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/</p>
<p>6) tar xvzf mod_geoip2_1.2.5.tar.gz &amp;&amp; cd mod_geoip2_1.2.5</p>
<p>7) apxs -i -a -L/usr/lib64 -I/usr/include -lGeoIP -c mod_geoip.c</p>
<p><img src="../wp-includes/images/smilies/icon_cool.gif" alt="8)" /> Enabling mod-geoip<br />
Nothing’s going to work unless mod-geoip is enabled in your apache configuration. You’ll need the following lines in your httpd.conf file (located on CentOS systems at /etc/httpd/conf/httpd.conf)</p>
<p>&lt;IfModule mod_geoip.c&gt;<br />
GeoIPEnable On<br />
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat Standard<br />
GeoIPDBFile /usr/local/share/GeoIP/GeoLiteCity.dat Standard<br />
&lt;/IfModule&gt;</p>
<p>9) Restart Apache so your changes will take effect by entering the following command.</p>
<p>#/etc/init.d/httpd restart</p>
<p>10) /usr/local/bin/geoipupdate<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/zh-hans/2010/how-to-install-geoip-and-mod_geoip2-on-centos-for-apache/" rel="bookmark" title="January 11, 2010">How to install GeoIP and mod_geoip2 on centos for apache</a></li>
<li><a href="http://www.indiangnu.org/2009/how-to-build-rpm-of-php-for-apache-with-mpm-worker/" rel="bookmark" title="September 14, 2009">How to build RPM of PHP for apache with mpm-worker</a></li>
<li><a href="http://www.indiangnu.org/2009/how-to-build-rpm-for-http-with-mpm-worker-on-x86_64/" rel="bookmark" title="September 14, 2009">How to build rpm for http with mpm worker (on x86_64)</a></li>
<li><a href="http://www.indiangnu.org/2010/how-to-configure-add-java-extension-for-php-on-centos-2/" rel="bookmark" title="January 22, 2010">How to configure-add java extension for php on CentOS 5</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-wordpress-on-ubuntu-gusty-710/" rel="bookmark" title="June 26, 2008">How to install wordpress on Ubuntu Gusty 7.10</a></li>
<li><a href="http://www.indiangnu.org/2008/how-to-reload-service-by-using-kill-command/" rel="bookmark" title="January 3, 2008">How to reload service by using kill command</a></li>
<li><a href="http://www.indiangnu.org/2007/http-and-https-with-apache-server/" rel="bookmark" title="December 1, 2007">HTTP and  HTTPS with Apache server</a></li>
</ul>
<p><!-- Similar Posts took 4.602 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/how-to-install-geoip-and-mod_geoip2-on-centos-for-apache-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Happy New Year 2010!</title>
		<link>http://www.indiangnu.org/2010/happy-new-year-2010-2/</link>
		<comments>http://www.indiangnu.org/2010/happy-new-year-2010-2/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 08:37:31 +0000</pubDate>
		<dc:creator>Arun Bagul</dc:creator>
				<category><![CDATA[General information]]></category>
		<category><![CDATA[INDIA]]></category>
		<category><![CDATA[IndianGNU]]></category>
		<category><![CDATA[openLSM]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=826</guid>
		<description><![CDATA[Dear All,
We wish you Happy  new year  2010 to all of you!


Regards,
IndianGNU.org &#38; openlsmSimilar Posts:

Happy New Year 2010!
Happy New Year 2008!!
Wish you Happy New Year 2007!!
openLSM + Cherokee
Does your past impact your future?
IndianGNU.org &#8211; my first anniversary!!
openlsm-0.99 released


]]></description>
			<content:encoded><![CDATA[<p>Dear All,</p>
<p>We wish you Happy  new year  2010 to all of you!</p>
<p><a href="http://www.indiangnu.org/"><img class="aligncenter" title="Happy New Year 2010" src="http://www.indiangnu.org/wp-content/uploads/2010/happy_new_year_2010.png" alt="" width="382" height="327" /></a></p>
<p><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br />
Regards,</p>
<p><a href="http://www.indiangnu.org" target="_blank">IndianGNU.org</a> &amp; <a href="http://openlsm.sourceforge.net/" target="_blank">openlsm</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/zh-hans/2010/happy-new-year-2010/" rel="bookmark" title="January 1, 2010">Happy New Year 2010!</a></li>
<li><a href="http://www.indiangnu.org/2008/happy-new-year-2008/" rel="bookmark" title="January 1, 2008">Happy New Year 2008!!</a></li>
<li><a href="http://www.indiangnu.org/2007/wish-you-happy-new-year-2007/" rel="bookmark" title="January 1, 2007">Wish you Happy New Year 2007!!</a></li>
<li><a href="http://www.indiangnu.org/2009/openlsm-cherokee/" rel="bookmark" title="June 9, 2009">openLSM + Cherokee</a></li>
<li><a href="http://www.indiangnu.org/2008/does-your-past-impact-your-future/" rel="bookmark" title="January 3, 2008">Does your past impact your future?</a></li>
<li><a href="http://www.indiangnu.org/2007/indiangnu-my-first-anniversary/" rel="bookmark" title="November 6, 2007">IndianGNU.org &#8211; my first anniversary!!</a></li>
<li><a href="http://www.indiangnu.org/2009/openlsm-099-released/" rel="bookmark" title="June 13, 2009">openlsm-0.99 released</a></li>
</ul>
<p><!-- Similar Posts took 4.414 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2010/happy-new-year-2010-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BASH Scripting ~ learning by examples</title>
		<link>http://www.indiangnu.org/2009/bash-scripting-learning-by-examples/</link>
		<comments>http://www.indiangnu.org/2009/bash-scripting-learning-by-examples/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:46:00 +0000</pubDate>
		<dc:creator>Arun Bagul</dc:creator>
				<category><![CDATA[Linux commands]]></category>
		<category><![CDATA[Shell scripting]]></category>

		<guid isPermaLink="false">http://www.indiangnu.org/?p=816</guid>
		<description><![CDATA[Introduction ~ 
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
Program (1) ~ array.sh
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
#!/bin/bash
echo &#8220;==============&#8221;
declare -a myarr[0]=&#8221;Arun&#8221;
declare -a  myarr1
myarr1=(arun bagul bangalore mumbai raju santhosh)
myarr[1]=&#8221;Bagul&#8221;
echo &#8220;my name is ${myarr[0]}  ${myarr[1]}&#8221;
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;
echo &#8220;${myarr1[*]}&#8221;
echo ${myarr1[2]}
echo ${myarr1[@]}
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;
echo &#8220;Total no of elements in array &#8211; ${#myarr1[*]}&#8221;
echo &#8220;Total no of elements in array &#8211; ${#myarr1[@]}&#8221;
echo &#8220;Size of word &#8216;${myarr1[2]}&#8217; is &#8211; ${#myarr1[2]}&#8221;
echo ${#myarr1[1]}
echo ${#myarr1[0]}
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;
#how to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction ~ </strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Program (1) ~ array.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash<br />
echo &#8220;==============&#8221;<br />
declare -a myarr[0]=&#8221;Arun&#8221;<br />
declare -a  myarr1<br />
myarr1=(arun bagul bangalore mumbai raju santhosh)<br />
myarr[1]=&#8221;Bagul&#8221;</p>
<p>echo &#8220;my name is ${myarr[0]}  ${myarr[1]}&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br />
echo &#8220;${myarr1[*]}&#8221;<br />
echo ${myarr1[2]}<br />
echo ${myarr1[@]}<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br />
echo &#8220;Total no of elements in array &#8211; ${#myarr1[*]}&#8221;<br />
echo &#8220;Total no of elements in array &#8211; ${#myarr1[@]}&#8221;<br />
echo &#8220;Size of word &#8216;${myarr1[2]}&#8217; is &#8211; ${#myarr1[2]}&#8221;<br />
echo ${#myarr1[1]}<br />
echo ${#myarr1[0]}</p>
<p>echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;</p>
<p>#how to delete element in array<br />
unset myarr[1]<br />
echo &#8220;myarr is &#8211; ${myarr[*]}&#8221;</p>
<p>#how to assign element in array<br />
myarr[1]=&#8221;- System Engineer!&#8221;<br />
echo &#8220;myarr is &#8211; ${myarr[*]}&#8221;</p>
<p>echo ${myarr}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Program (2) ~ command_line_arguments.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>echo &#8220;Script/command name =&gt; $0&#8243;<br />
echo &#8220;arg1 =&gt; $1&#8243;<br />
echo &#8220;arg2 =&gt; $2&#8243;<br />
echo &#8220;arg3 =&gt; $3&#8243;<br />
echo &#8220;Total No of argument = $#&#8221;</p>
<p>echo &#8220;Script PID is =&gt; $$&#8221;<br />
echo &#8220;Status of previous command &#8211; $?&#8221;</p>
<p>name=$myname<br />
echo &#8220;Name &#8211; $name&#8221;</p>
<p>read n</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong> Program (3) ~ default_value.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#!/bin/bash</p>
<p>#start=&#8217;123&#8242;<br />
#start=${1:-$start}</p>
<p>start=${1:-&#8217;123&#8242;}</p>
<p>echo &#8220;Value of &#8217;start&#8217; variable is ==&gt; $start&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong> Program (4) ~ echo_example.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>name=&#8221;Arun&#8221;</p>
<p>echo -e &#8220;My Name is $name_arun  and \n&#8221;<br />
echo -e &#8220;My Name is ${name}_arun  and \n&#8221;</p>
<p>echo -e &#8216;My Name is $name  and \n&#8217;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Program (5) ~ elif.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#! /bin/bash</p>
<p>if [ $1 -eq $2 ];then<br />
echo &#8220;good&#8221;<br />
elif [ $2 -eq $3 ];then<br />
echo &#8220;Fine&#8221;<br />
elif [ $1 -eq $3 ];then<br />
echo &#8220;OK&#8221;<br />
else<br />
echo &#8220;NO&#8221;<br />
fi</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong> Program (6) ~ for_loop_example-1.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>i=1<br />
while [ $i -le 512 ]<br />
do<br />
temp=$i<br />
echo &#8220;What is =&gt; $i | $temp&#8221;<br />
i=$(expr $i + 32)<br />
for (( j=$temp; $j&lt;=$i; j++ ))<br />
do<br />
echo -n &#8221; $j&#8221;<br />
done<br />
done</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> Program (7) ~ for_loop_example-2.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash<br />
#for val in $(ls -1 /tmp)<br />
sum=0<br />
#for val in {1..5}<br />
#for val in {$1..$2}<br />
for((val=$1;$val&lt;=$2;val++))<br />
do<br />
#echo &#8220;$val&#8221;<br />
sum=$(expr $sum +  $val )<br />
#sum=`expr $sum +  $val`<br />
done</p>
<p>echo &#8220;$0 # Sum of $1 to $2 =&gt; $sum&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Program (8) ~ for_loop_example-3.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>for i in {1..9}<br />
do<br />
echo $i<br />
done</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Program (9) ~ function.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash</p>
<p>function my_function()<br />
{<br />
name=&#8221;Arun Bagul&#8221;<br />
echo &#8220;&#8216;my_function&#8217; body ~ $name&#8221;<br />
return 1;<br />
}<br />
##########</p>
<p>myfunc()<br />
{<br />
echo &#8220;Another way of defining the function&#8221;<br />
}</p>
<p>##########################</p>
<p>echo &#8220;Starting function program&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;</p>
<p>#calling function here<br />
my_function<br />
##<br />
myfunc</p>
<p>echo -e &#8220;\n end of program&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Program (10) ~ how_to_pass_argument_to_function.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>function my_function()<br />
{<br />
echo &#8220;Total number of argument ~ $#&#8221;<br />
echo &#8220;Arg1 =&gt; $1&#8243;<br />
echo &#8220;Arg2 =&gt; $2&#8243;<br />
echo &#8220;Arg3 =&gt; $3&#8243;<br />
return 0;<br />
}<br />
##########</p>
<p>echo &#8220;Starting function program&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;</p>
<p>#calling function here<br />
my_function arun bagul 1234</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>Program (11) ~ how_to_take_hidden_input.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#!/bin/bash</p>
<p>echo -n &#8220;Enter User Name :&#8221;<br />
read  username<br />
echo -n &#8220;Enter Password :&#8221;<br />
read -s mypwd</p>
<p>echo -e &#8220;\nI am  $username and my password is &#8211; $mypwd&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong> Program (12) ~ how_to_take_input_from_user.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash</p>
<p>echo -ne &#8220;Enter the Name:- &#8221;<br />
read name<br />
echo -n -e &#8220;Enter the Number:- &#8221;<br />
read num</p>
<p>echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;</p>
<p>add=$(expr $num + 10)</p>
<p>echo  &#8220;Name is ~ $name&#8221;<br />
echo &#8220;Number is ~ $add&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Program (13) ~ ifthen.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash</p>
<p>if [ "arun" == "arun" ];then<br />
echo &#8220;true!&#8221;<br />
else<br />
echo &#8220;false&#8221;<br />
fi</p>
<p>echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;</p>
<p>if [ 2 == 2 ];then<br />
echo &#8220;true!&#8221;<br />
else<br />
echo &#8220;false&#8221;<br />
fi</p>
<p>echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;</p>
<p>if [ "arun" = "arun" ];then<br />
echo &#8220;true!&#8221;<br />
else<br />
echo &#8220;false&#8221;<br />
fi</p>
<p>echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;</p>
<p>if [ 2 -eq  2 ];then<br />
echo &#8220;true!&#8221;<br />
else<br />
echo &#8220;false&#8221;<br />
fi</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Program (14) ~ non-interactive.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/usr/bin/expect -f<br />
spawn ssh  arun@192.168.0.1<br />
expect &#8220;password:&#8221;<br />
sleep 1<br />
send &#8220;pwd\r&#8221;<br />
interact</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong> Program (15) ~ read_file_line_by_line.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#!/bin/bash</p>
<p>file_name=&#8221;/etc/hosts&#8221;</p>
<p>while read myvar<br />
do<br />
echo &#8220;Line =&gt; $myvar&#8221;<br />
done  &lt; $file_name</p>
<p>echo &#8220;#################################################&#8221;</p>
<p>for myvar1 in $(cat $file_name)<br />
do<br />
echo &#8220;Line =&gt; $myvar1&#8243;<br />
done</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Program (16) ~ reverse-number.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>declare -a date_array<br />
num=$1<br />
i=$(expr $(echo $num | wc -c) &#8211; 1 )</p>
<p>while [ $num -gt 10 ]<br />
do<br />
temp=$( expr $num % 10 )<br />
num=$( expr $num / 10);<br />
echo &#8220;Digit($i) =&gt; $temp&#8221;<br />
date_array[$i]=&#8221;${temp}&#8221;<br />
i=$(expr $i &#8211; 1)<br />
done<br />
echo &#8220;Digit($i) =&gt; $num&#8221;<br />
date_array[$i]=&#8221;${num}&#8221;</p>
<p>echo ${date_array[*]}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> Program (17) ~ string-operation.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#! /bin/bash</p>
<p>echo &#8220;Arun Bagul:-&#8221;<br />
string=&#8221;/root/arun/bagul/image.gif&#8221;<br />
echo &#8220;string=&gt; $string&#8221;<br />
echo &#8220;String=&gt; ${string##/*/}&#8221;<br />
echo &#8220;String=&gt; ${string#/*/}&#8221;</p>
<p>echo &#8220;String=&gt; ${string%.*}&#8221;<br />
echo &#8220;String=&gt; ${string%%.*}&#8221;<br />
#str=&#8221;/home/y/conf/arunbagul/daily_market_0.conf&#8221;<br />
str=&#8221;${str##/*conf/}&#8221;<br />
echo &#8220;String=&gt; ${str%/*}&#8221;</p>
<p>#done</p>
<p>mystr=&#8221;keyword_summary_exact_arunsb&#8221;<br />
echo $mystr<br />
echo ${mystr%_*}</p>
<p>echo &#8220;$*&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Program (18) ~ switch.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#!/bin/bash</p>
<p>echo &#8221; Switch program | arg1 =&gt; $1&#8243;<br />
echo &#8221; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;<br />
case $1 in</p>
<p>123)<br />
echo &#8220;Case is 123&#8243;<br />
;;</p>
<p>arun)<br />
echo &#8220;Case is &#8216;arun&#8217;&#8221;<br />
;;</p>
<p>pri*)</p>
<p>echo &#8220;Case is &#8216;pri*&#8217;&#8221;<br />
;;</p>
<p>*)<br />
echo &#8221; * Usage: $0 &#8221;<br />
echo &#8221;   Default case (nothing is matched)&#8221;<br />
exit 0;<br />
;;<br />
esac</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> Program (19) ~ while_loop_example-1.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>#!/bin/bash</p>
<p>mywait=wait</p>
<p>while [ "${mywait}" = "wait" ]<br />
do<br />
echo &#8220;arun&#8221;<br />
done</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>Program (20) ~ while_loop_example-2.sh</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>#! /bin/bash</p>
<p>## on command  line -&gt;  i=0 &amp;&amp; while  [ $i -le 10 ] ; do echo $i; i=$(expr $i + 1); done</p>
<p>i=0<br />
while [ $i -le 10 ]<br />
do<br />
echo $i<br />
i=$(expr $i + 1)<br />
done</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>* Please download PDF file <a title="http://www.slideshare.net/arunbagul/bash-learning-by-examples/" href="http://www.slideshare.net/arunbagul/bash-learning-by-examples/" target="_blank">http://www.slideshare.net/arunbagul/bash-learning-by-examples/</a></p>
<p>Regards,<br />
Arun<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.indiangnu.org/ru/2009/bash-scripting-%d0%be%d0%b1%d1%83%d1%87%d0%b5%d0%bd%d0%b8%d0%b5-%d0%bd%d0%b0-%d0%bf%d1%80%d0%b8%d0%bc%d0%b5%d1%80%d0%b0%d1%85/" rel="bookmark" title="December 31, 2009">Bash Scripting ~ обучение на примерах</a></li>
<li><a href="http://www.indiangnu.org/th/2009/bash-scripting-%e0%b9%80%e0%b8%a3%e0%b8%b5%e0%b8%a2%e0%b8%99-%e0%b8%a3%e0%b8%b9%e0%b9%89-%e0%b8%88%e0%b8%b2%e0%b8%81-%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b8%ad%e0%b8%a2%e0%b9%88%e0%b8%b2%e0%b8%87/" rel="bookmark" title="December 31, 2009">Bash Scripting ~ เรียน รู้ จาก ตัวอย่าง</a></li>
<li><a href="http://www.indiangnu.org/nl/2009/bash-scripting-leren-door-voorbeelden/" rel="bookmark" title="December 31, 2009">BASH Scripting ~ leren door voorbeelden</a></li>
<li><a href="http://www.indiangnu.org/it/2009/bash-scripting-apprendimento-da-esempi/" rel="bookmark" title="December 31, 2009">Bash Scripting ~ apprendimento da esempi</a></li>
<li><a href="http://www.indiangnu.org/id/2009/bash-scripting-belajar-dengan-contoh/" rel="bookmark" title="December 31, 2009">BASH Scripting ~ belajar dengan contoh</a></li>
<li><a href="http://www.indiangnu.org/pt-br/2009/bash-scripting-aprendizagem-por-exemplos/" rel="bookmark" title="December 31, 2009">BASH Scripting ~ aprendizagem por exemplos</a></li>
<li><a href="http://www.indiangnu.org/es/2009/bash-scripting-aprendizaje-por-medio-de-ejemplos/" rel="bookmark" title="December 31, 2009">Bash Scripting ~ aprendizaje por medio de ejemplos</a></li>
</ul>
<p><!-- Similar Posts took 5.896 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indiangnu.org/2009/bash-scripting-learning-by-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
