<?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>ITQuery.com</title>
	<atom:link href="http://itquery.com/forum/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://itquery.com/forum</link>
	<description>ITQuery- Knowledge Base</description>
	<lastBuildDate>Wed, 16 May 2012 06:49:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Error during apache httpd starup</title>
		<link>http://itquery.com/forum/?p=169</link>
		<comments>http://itquery.com/forum/?p=169#comments</comments>
		<pubDate>Wed, 16 May 2012 06:45:50 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[passphrase]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=169</guid>
		<description><![CDATA[1. &#8220;[error] Init: SSLPassPhraseDialog builtin is not supported on Win32&#8243; Reason - Apache has been installed on windows and unable to start because HTTPS  configuration. Solution - a. Remove/comment SSLPassPhrase context fromssl.conf or httpd.conf b. Make a copy of the &#8230; <a href="http://itquery.com/forum/?p=169">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>1. &#8220;[error] Init: SSLPassPhraseDialog builtin is not supported on Win32&#8243;</strong></span></p>
<p><strong>Reason -</strong> Apache has been installed on windows and unable to start because HTTPS  configuration.</p>
<p><strong>Solution -</strong></p>
<ul>
<li>a. Remove/comment SSLPassPhrase context fromssl.conf or httpd.conf</li>
<li>b. Make a copy of the private key and call it &#8220;server.key.org&#8221;</li>
<li>c. Use the OpenSSL command to remove the passphrase such as;</li>
</ul>
<p><em><strong># openssl rsa -in server.key.org -out server.key</strong></em></p>
<p>server.key will be your new private key with the passphrase removed.</p>
<p>Restart apache httpd service.</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=169</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 Easy step for password less Self Signed Certificate</title>
		<link>http://itquery.com/forum/?p=167</link>
		<comments>http://itquery.com/forum/?p=167#comments</comments>
		<pubDate>Thu, 15 Mar 2012 09:25:07 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Easy step password less Self Signed Certificate]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=167</guid>
		<description><![CDATA[4 Easy step for password less Self Signed Certificate #openssl genrsa -des3 -out server.passwd.key 1024 #openssl rsa -in server.passwd.key -out server.key #openssl req -new -key server.key -out server.csr #openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt]]></description>
			<content:encoded><![CDATA[<p>4 Easy step for password less Self Signed Certificate</p>
<p>#openssl genrsa -des3 -out server.passwd.key 1024</p>
<p>#openssl rsa -in server.passwd.key -out server.key</p>
<p>#openssl req -new -key server.key -out server.csr</p>
<p>#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=167</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging exception stacktrace</title>
		<link>http://itquery.com/forum/?p=161</link>
		<comments>http://itquery.com/forum/?p=161#comments</comments>
		<pubDate>Mon, 16 Jan 2012 12:03:57 +0000</pubDate>
		<dc:creator>arindham</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=161</guid>
		<description><![CDATA[Logging standard message is simple Following are the different ways to log messages using Log4J Log.debug (&#8220;Debug Message&#8221;); Log.info (&#8220;Info Message&#8221;); Log.warn (&#8220;Warning Message&#8221;); Log.error (&#8220;Error Message&#8221;); But sometime we need to log exception along with stacktrace, for that we &#8230; <a href="http://itquery.com/forum/?p=161">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Logging standard message is simple</p>
<p>Following are the different ways to log messages using Log4J</p>
<ul>
<li>Log.debug (&#8220;Debug Message&#8221;);</li>
<li>Log.info (&#8220;Info Message&#8221;);</li>
<li>Log.warn (&#8220;Warning Message&#8221;);</li>
<li>Log.error (&#8220;Error Message&#8221;);</li>
</ul>
<p>But sometime we need to log exception along with stacktrace, for that we need to use</p>
<p>LOG.log(Level.ERROR, exception.getMessage(), exception);</p>
<p>No special configuration required for this behaviour.</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=161</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a self signed dummy SSL certificate in APACHE</title>
		<link>http://itquery.com/forum/?p=15</link>
		<comments>http://itquery.com/forum/?p=15#comments</comments>
		<pubDate>Thu, 29 Dec 2011 16:56:39 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Dummy Certificate]]></category>
		<category><![CDATA[Self Signed Certificate]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=15</guid>
		<description><![CDATA[* Generating a Private Key and CSR We assume you have openssl module/package installed on your system or server . The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be &#8230; <a href="http://itquery.com/forum/?p=15">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>* Generating a Private Key and CSR</h3>
<p>We assume you have openssl module/package installed on your system or server .<br />
The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self-signed certificates which can be used for testing purposes or internal usage. The utility used to do all of these tasks is known simply as <span class="code">openssl</span>. It should be installed in the <span class="code">/usr/local/ssl/bin</span> directory. You may want to add this directory to your <span class="code">PATH</span>, or copy or link the openssl utility to a directory that is already in your <span class="code">PATH</span> so that you do not have to type the full path to the executable. The examples below will assume that <span class="code">openssl</span> is in a location that is accessible to you without using the full path to the command.</p>
<p>The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text. We will use several files as random seed enhancers which will help to make the key more secure. Text files that have been compressed with a utility such as <span class="code">gzip</span> are good choices. The key is generated using the following command, where <span class="code">file1:file2:etc</span> represents the random compressed files.</p>
<p><em><strong><span class="code"> $ openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024 </span></strong></em></p>
<p>The command will prompt you for a pass-phrase and then store the key in the file <span class="code">server.key</span>. <span class="red">It is critical that the pass-phrase be secure and not forgotten.</span> If either the key is lost, or the pass-phrase is forgotten, <strong>the certificate will be useless!</strong> It cannot be stressed enough how important the private key is to the certificate. If the private key and pass-phrase are compromised, the certificate will have to be revoked, costing you the price of the certificate all over again if you have paid an authority for the certificate. It may be a wise idea to back this file up to secure media, such as tape or diskette.</p>
<p>One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file <strong>only be readable by the root user!</strong> If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:</p>
<p><em><strong><span class="code"> $ openssl rsa -in server.key -out server.pem </span></strong></em></p>
<p>Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as <a href="http://www.thawte.com/">Thawte</a> or <a href="http://www.verisign.com/">Verisign</a> who will verify the identity of the requestor and issue a signed certificate. The second option is to self-sign the CSR, which will be demonstrated in the next section.</p>
<p>During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for &#8220;<span class="code">Common Name (e.g., YOUR name)</span>&#8220;. It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be <span class="code">https://www.server.com</span>, then enter <span class="code">www.server.com</span> at this prompt. The command to generate the CSR is as follows:</p>
<p><em><strong><span class="code"> $ openssl req -new -key server.key -out server.csr </span></strong></em></p>
<p>A sample CSR generation session is shown below, with sample responses shown in bold:</p>
<p><span class="code"> $ openssl req -new -key server.key -out server.csr<br />
Using configuration from /usr/local/ssl/openssl.cnf<br />
Enter PEM pass phrase:<strong>Enter pass phrase here</strong> </span></p>
<p><span class="code"> You are about to be asked to enter information that will be incorporated into your certificate request. </span></p>
<p><span class="code"> What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank. </span></p>
<p><span class="code"> For some fields there will be a default value, If you enter &#8216;.&#8217;, the field will be left blank. </span></p>
<p><span class="code">&#8212;&#8211;</span></p>
<p><span class="code"> Country Name (2 letter code) [AU]:<strong>IN</strong><br />
State or Province Name (full name) [Some-State]:<strong>Maharshtra</strong><br />
Locality Name (eg, city) []:<strong>Mumbai</strong><br />
Organization Name (eg, company) [Internet Widgits Pty Ltd]:<strong>ITQuery Tech</strong><br />
Organizational Unit Name (eg, section) []:<strong> Web<br />
</strong></span></p>
<p>Common Name (eg, YOUR name) []:<strong>www.itquery.com</strong><br />
Email Address []:<strong>webmaster@itquery.com</strong></p>
<p>Please enter the following &#8216;extra&#8217; attributes to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:</p>
<h3>Generating a Self-Signed Certificate</h3>
<p>At this point you will need to generate a self-signed certificate because you either don&#8217;t plan on having your certificate signed by a CA, or you wish to test your new SSL implementation while the CA is signing your certificate. In my experience dealing with Thawte, it can take up to a week or more before receiving your signed certificate. The time it takes to receive the certificate will vary based on how quickly they receive your required documentation. This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.</p>
<p>To generate a temporary certificate which is good for 60 days, issue the following command:</p>
<p><strong><em><span class="code"> $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt </span></em></strong></p>
<p>Try following these steps incase if you do not want to ssl certificate with passphrase, since it ask everytime you restart your apache service. Ensure that you have correct certificate name with your apache config.</p>
<p><strong><em>$openssl rsa -in server.key -out server.key.nopass</em></strong></p>
<h3>Installing the Private Key and Certificate</h3>
<p>When Apache with mod_ssl is installed, it creates several directories in the Apache config directory. The location of this directory will differ depending on how Apache was compiled. If using my instructions on compiling Apache, the config directory is <span class="code">/usr/local/apache/etc</span>. The directories mod_ssl creates include <span class="code">ssl.crt</span>, <span class="code">ssl.csr</span>, and <span class="code">ssl.key</span>. These are good locations to store server certificates, CSRs, and private keys, respectively. If there will be multiple SSL enabled hosts on one server, it may be good practice to name the files with the fully qualified domain name of the SSL enabled host.</p>
<p>When adding SSL enabled virtualhosts to the web server, I prefer to keep all of the SSL virtualhosts in a separate file. This insures that all SSL hosts can be easily found in one location and helps to keep the <span class="code">httpd.conf</span> file from growing too large. The SSL virtualhosts will be kept in a file called <span class="code">ssl.conf</span>. In order for Apache to recognize and parse this file, it must be included in the <span class="code">httpd.conf</span> file with the following directive:</p>
<p><em><strong><span class="code"> Include /usr/local/apache/etc/ssl.conf </span></strong></em></p>
<h3>Configuring SSL Enabled Virtual Hosts</h3>
<p>Extensive examples of SSL configurations for a virtualhost are included as part of the <span class="code">/usr/local/apache/etc/httpd.conf.default</span> file installed with mod_ssl. Please refer to this file and to the mod_ssl documentation for more detailed information on configuration options. A basic SSL enabled virtualhost will appear as follows in the ssl.conf file:</p>
<p><em><strong><span class="code"> # SSL Virtual Hosts<br />
</span></strong></em><br />
<em><strong> ServerAdmin webmaster@domain.com</strong></em><br />
<em><strong> DocumentRoot /usr/local/apache/share/htdocs</strong></em><br />
<em><strong> ServerName www.domain.com</strong></em><br />
<em><strong> ScriptAlias /cgi-bin/ /usr/local/apache/share/htdocs/cgi-bin/</strong></em><br />
<em><strong> SSLEngine on</strong></em><br />
<em><strong> SSLCertificateFile /usr/local/apache/etc/ssl.crt/server.crt</strong></em><br />
<em><strong> SSLCertificateKeyFile /usr/local/apache/etc/ssl.key/server.pem</strong></em><br />
<em><strong> SetEnvIf User-Agent &#8220;.*MSIE.*&#8221; nokeepalive ssl-unclean-shutdown</strong></em><br />
<em><strong> CustomLog /usr/local/apache/var/log/ssl_request_log \&#8221;%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \&#8221;%r\&#8221; %b&#8221;</strong></em></p>
<p>&nbsp;</p>
<p>This will create an SSL virtualhost named www.domain.com, which is accessed via port 443 (the standard port for https) on the default IP address of the web server. It is possible to add as many additional virtualhosts as there are IP addresses that the web server listens to. Simply add additional virtualhost blocks <strong>inside</strong> of the and tags. Due to the nature of the SSL encryption of the HTTP traffic, <strong>it is NOT possible to have name-based (HTTP1.1) SSL virtual hosts.</strong> To create a new SSL virtualhost on a different IP address, simply replace <span class="code">_default_</span> with the IP address of the virtualhost.</p>
<p>Restart apache to load the new changed configuration file.</p>
<p>&#8211; Test the configuration file (httpd.conf).<br />
<em><strong># apachectl configtest</strong></em></p>
<p>&#8211; Restart the apache<br />
<em><strong># apachectl restart </strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Tomcat and Apache HTTP web server integration (mod_jk vs mod_proxy)</title>
		<link>http://itquery.com/forum/?p=142</link>
		<comments>http://itquery.com/forum/?p=142#comments</comments>
		<pubDate>Fri, 07 Oct 2011 09:24:13 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[apache http server]]></category>
		<category><![CDATA[apache tomcat]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[mod_proxy]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=142</guid>
		<description><![CDATA[Apache Tomcat and Apache HTTP web server integration - 1. I would advice to use Apache http web server module “mod_jk” instead of “mod_proxy” because of following reasons - &#160; It has greater control to manage the request/response internally between &#8230; <a href="http://itquery.com/forum/?p=142">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>Apache Tomcat and Apache HTTP web server integration -</h1>
<p><em>1. I would advice to use Apache http web server module “mod_jk” instead of “mod_proxy” because of following reasons -</em></p>
<p>&nbsp;</p>
<ul>
<li><em>It has greater control to manage the request/response internally between Apache’s http and tomcat server.</em></li>
<li><em>This will enable to have internal software load balancing with greater control options, if required.</em></li>
<li><em>It is more secure then mod_proxy.</em></li>
<li><em>Detailed log mechanism to figure out any communication errors.</em></li>
<li><em>Greater control over option what you want to server from which server internally (ie. static content from http server and java content from tomcat)</em></li>
<li><em>Support for large AJP packet sizes (“mod_proxy_ajp” does not support large 8K+ packet sizes).</em></li>
<li><em>Advanced node failure detection (if load balancer mechanism used).</em></li>
</ul>
<p><em><strong>* Only biggest advantage of using mod_proxy* module is easy and short configuration in Apache conf file to achieve integration.</strong></em></p>
<p><em>2. SSL certificate should be installed on Apache’s http server instead of tomcat.</em><br />
<em> 3. Tomcat should be running on separate port other than standard http and https port.</em><br />
<em> 4. Apache’s http webserver should be running on standard http and https ports. It is easy feasible to secure Apache’s http server instead of tomcat server, since tomcat is not a full featured web server.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on Ant script</title>
		<link>http://itquery.com/forum/?p=134</link>
		<comments>http://itquery.com/forum/?p=134#comments</comments>
		<pubDate>Tue, 27 Sep 2011 10:35:24 +0000</pubDate>
		<dc:creator>arindham</dc:creator>
				<category><![CDATA[ANT]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=134</guid>
		<description><![CDATA[Tokenizer user input ANT can be used as great tool for tokenizing user input during application builiding process. This script will take a string from user input and tokenize in multiple string. Limitation : Currently this script tokenize single seperator &#8230; <a href="http://itquery.com/forum/?p=134">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Tokenizer user input<br />
</strong></p>
<p>ANT can be used as great tool for tokenizing user input during application builiding process. This script will take a string from user input and tokenize in multiple string.</p>
<p>Limitation : Currently this script tokenize single seperator only.</p>
<p>Example</p>
<p>split:<br />
[input] Enter site name<br />
www.google.com<br />
[input] Enter seperator<br />
\.<br />
[echo] www<br />
[echo] google<br />
[echo] com</p>
<p>The script is as follows :</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;project name=&#8221;Split input parameter&#8221; basedir=&#8221;.&#8221; default=&#8221;split&#8221;&gt;</p>
<p>&lt;taskdef resource=&#8221;net/sf/antcontrib/antlib.xml&#8221;&gt;<br />
&lt;classpath&gt;<br />
&lt;pathelement location=&#8221;${basedir}/lib/ant-contrib-1.0b3.jar&#8221;/&gt;<br />
&lt;/classpath&gt;<br />
&lt;/taskdef&gt;</p>
<p>&lt;scriptdef name=&#8221;split&#8221; language=&#8221;javascript&#8221;&gt;<br />
&lt;attribute name=&#8221;value&#8221;/&gt;<br />
&lt;attribute name=&#8221;sep&#8221;/&gt;<br />
&lt;attribute name=&#8221;prefix&#8221;/&gt;<br />
&lt;![CDATA[<br />
values = attributes.get("value").split(attributes.get("sep"));<br />
str = "";<br />
for(i=0; i&lt;values.length; i++) {<br />
str = str + "," + values[i];<br />
}<br />
str = str.substring(str.indexOf(&#8220;,&#8221;) + 1, str.length);<br />
project.setNewProperty(attributes.get(&#8220;prefix&#8221;),    str);<br />
]]&gt;<br />
&lt;/scriptdef&gt;</p>
<p>&lt;target name=&#8221;split&#8221; description=&#8221;Tokenised input parameter&#8221;&gt;<br />
&lt;input message=&#8221;Enter site name&#8221; addproperty=&#8221;site&#8221;/&gt;<br />
&lt;input message=&#8221;Enter seperator&#8221; addproperty=&#8221;seperator&#8221;/&gt;<br />
&lt;split value=&#8221;${site}&#8221; sep=&#8221;${seperator}&#8221; prefix=&#8221;value&#8221;/&gt;<br />
&lt;property name=&#8221;list&#8221; value=&#8221;${value}&#8221;/&gt;<br />
&lt;for list=&#8221;${list}&#8221; param=&#8221;letter&#8221;&gt;<br />
&lt;sequential&gt;<br />
&lt;echo message=&#8221;@{letter}&#8221;/&gt;<br />
&lt;/sequential&gt;<br />
&lt;/for&gt;<br />
&lt;/target&gt;<br />
&lt;/project&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=134</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add user or linux/unix user creation</title>
		<link>http://itquery.com/forum/?p=131</link>
		<comments>http://itquery.com/forum/?p=131#comments</comments>
		<pubDate>Thu, 11 Aug 2011 20:31:06 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=131</guid>
		<description><![CDATA[Add user or linux/unix user creation #adduser &#60;User_Name&#62; This will create a user with default home directory settings defined on system ie. Home directory path(when user log into system will see this directory) will  be  /home/User_Name If you want to &#8230; <a href="http://itquery.com/forum/?p=131">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Add user or linux/unix user creation</h2>
<p><em><strong>#adduser &lt;User_Name&gt;</strong></em><br />
This will create a user with default home directory settings defined on system</p>
<p>ie. Home directory path(when user log into system will see this directory) will  be  <em>/home/User_Name</em></p>
<p>If you want to add custom path for user&#8217;s home directory</p>
<p><em><strong>#adduser &lt;User_Name&gt; -d /opt/User_Name</strong></em><br />
Here you are assigning home directory with option <em>-d</em></p>
<p>If you want to add custom home directory path and add user into an existing group.</p>
<p><em><strong>#adduser &lt;User_Name&gt; -d /opt/User_Name -g Group_Name</strong></em></p>
<p>Adding a parameter -g will assign this new user under given existing group along with custom home directory path.</p>
<p>Force user to change password on their first successful login</p>
<p><em><strong>#chage -d 0 User_Name</strong></em></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL query output in CSV format (MySQL)</title>
		<link>http://itquery.com/forum/?p=99</link>
		<comments>http://itquery.com/forum/?p=99#comments</comments>
		<pubDate>Fri, 24 Jun 2011 10:09:05 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[mysql database query output in csv format]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=99</guid>
		<description><![CDATA[SQL query output in CSV format (MySQL). You can have your SQL Query saved as a file &#8220;QUERY.sql&#8221; SELECT FIELD1, FIELD2, FIELD3 &#8230; from TABLEName WHERE COLUMNName = &#8216;$VALUE&#8217; INTO OUTFILE &#8216;/tmp/DataFile_output.csv&#8217; FIELDS TERMINATED BY &#8216;,&#8217; ENCLOSED BY &#8216;&#8221;&#8216; LINES &#8230; <a href="http://itquery.com/forum/?p=99">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2><strong>SQL query output in CSV format (MySQL).</strong></h2>
<p>You can have your SQL Query saved as a file &#8220;QUERY.sql&#8221;</p>
<p><em>SELECT FIELD1, FIELD2,</em><em> FIELD3</em><em> &#8230; from TABLEName</em><br />
<em>WHERE COLUMNName = &#8216;$VALUE&#8217;</em><br />
<em>INTO OUTFILE &#8216;/tmp/DataFile_output.csv&#8217;</em><br />
<em>FIELDS TERMINATED BY &#8216;,&#8217;</em><br />
<em>ENCLOSED BY &#8216;&#8221;&#8216;</em><br />
<em>LINES TERMINATED BY &#8216;\n&#8217;</em></p>
<p>Now run this query</p>
<h3><em>$mysql -uuser_name -ppassword databasename &lt; /path/to/sqlfile/QUERY.sql</em></h3>
<p>Even this this can be schedule in cron for cronjob routine.</p>
<p>Cheers!</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">FIELDS TERMINATED BY &#8216;,&#8217;<br />
ENCLOSED BY &#8216;&#8221;&#8216;<br />
LINES TERMINATED BY &#8216;\n&#8217;</div>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=99</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP Script to transfer only changed files</title>
		<link>http://itquery.com/forum/?p=91</link>
		<comments>http://itquery.com/forum/?p=91#comments</comments>
		<pubDate>Wed, 15 Jun 2011 08:52:57 +0000</pubDate>
		<dc:creator>itquery</dc:creator>
				<category><![CDATA[Shell script]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[ftp host alive check]]></category>
		<category><![CDATA[ftp shell script]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=91</guid>
		<description><![CDATA[FTP Script to transfer only changed files using FTP protocol Save below script as &#8220;Ftpenv.sh&#8221; #!/bin/sh ############################################################ # File:         Ftpenv.sh # Description:  Setup Environment Variables for FTP task by itquery ############################################################ REMOTE_FTP_SERVER=192.168.0.1   # Server where to put the Incremental Load &#8230; <a href="http://itquery.com/forum/?p=91">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>FTP Script to transfer only changed files using FTP protocol</strong></p>
<p>Save below script as &#8220;Ftpenv.sh&#8221;</p>
<p>#!/bin/sh<br />
############################################################<br />
# File:         Ftpenv.sh<br />
# Description:  Setup Environment Variables for FTP task by itquery<br />
############################################################</p>
<p>REMOTE_FTP_SERVER=192.168.0.1   # Server where to put the Incremental Load files<br />
REMOTE_FTP_USER=ftpuser                # User to login at REMOTE_FTP_USER<br />
REMOTE_FTP_PASSWORD=ftppassword #Passwd for FTP usr at REMOTE_FTP_USR<br />
REMOTE_FTP_DIR=/opt/remoteftparea   # Directory where to put the files<br />
SOURCE_DIR=/opt/localftparea                   # Directory from where file is FTP&#8217;d</p>
<p>TIMESTAMP=`date +%d%m%Y`<br />
LOGFILE=/opt/FTP_$TIMESTAMP.log     # Log file</p>
<p>log() { echo &#8220;`date +%H:%M` &#8211; $1&#8243; &gt;&gt; $LOGFILE; }</p>
<p>&nbsp;</p>
<p><strong>Save below script as Ftpscript.sh</strong></p>
<p>#!/bin/sh<br />
################################################################<br />
# File:         Ftpscript.sh<br />
# Description:  Trasfer file if they are changed and are more than 0 byte onto remote area # using FTP protocol task by itquery<br />
################################################################<br />
. `dirname $0`/Ftpenv.sh</p>
<p>log &#8220;$0 &#8211; Start of Execution&#8221;<br />
# Get ready for FTP, from the source directory<br />
cd $SOURCE_DIR<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
# Use additonal USER&#8217;s environment variable of $HOME/.bash_profile file for ftp transfer. ~/.bash_profile</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# Checks if the remote server is responding<br />
/bin/ping &#8220;$REMOTE_FTP_SERVER&#8221; 64 1 &gt;&gt;$LOGFILE<br />
if [ $? -ne 0 ]<br />
then<br />
log &#8221; Server (&#8220;$REMOTE_FTP_SERVER&#8221;) is not responding&#8230;FTP aborted&#8221;<br />
exit 1<br />
fi</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# Transfer only new/files greater than 0 byte files via FTP.<br />
ftp $REMOTE_FTP_SERVER  1&gt;&gt;$LOGFILE &lt;&lt;EOF<br />
cd $REMOTE_FTP_DIR<br />
for FILE in `ls -1  $SOURCE_DIR`<br />
do<br />
FoundFile=`find  $FILE -mtime -2 |wc -l`<br />
if [ "$FoundFile" -gt "0" ]<br />
then<br />
echo &#8220;Transferring $FILE now..&#8221;<br />
put $FILE<br />
else<br />
echo &#8220;Nothing to Trasnsfer&#8221;<br />
fi<br />
done<br />
quit<br />
EOF</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#Archiving the FTP&#8217;d file to a new location $SOURCE_DIR/Done<br />
#mv $SOURCE_DIR/LOG_$TIMESTAMP.DAT.gz $SOURCE_DIR/Done<br />
log &#8220;$0 &#8211; End of Execution&#8221;<br />
exit 0</p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How JQuery&#8217;s .load() works???</title>
		<link>http://itquery.com/forum/?p=78</link>
		<comments>http://itquery.com/forum/?p=78#comments</comments>
		<pubDate>Fri, 27 May 2011 20:39:17 +0000</pubDate>
		<dc:creator>Sushil</dc:creator>
				<category><![CDATA[UI-Development]]></category>
		<category><![CDATA[how jquery's .load() works]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://itquery.com/forum/?p=78</guid>
		<description><![CDATA[Have you ever wondered how JQuery&#8217;s .load() api works? well i did and tried to figure out something similar and this is what i came up with. var loadData = (function () { var _this; return { response: null, url: &#8230; <a href="http://itquery.com/forum/?p=78">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how JQuery&#8217;s .load() api works? well i did and tried to figure out something similar and this is what i came up with.</p>
<pre>var loadData = (function () {
  var _this;

  return {
    response: null,
    url: null,
    writeDataOfId: null,
    data: null,
    writeDataToId: null,
    dummyDiv: null,

    init: function (url, writeDataOfId, writeDataToId) {
      if (!url &amp;&amp; !writeDataOfId &amp;&amp; !writeDataToId) {
        return; // don't do anything if none of the parameters are present
      }
      _this = this;
      this.writeDataToId = document.getElementById(writeDataToId);
      if (!this.writeDataToId) {
        return;
      }
      this.url = url;
      this.writeDataOfId = writeDataOfId;
      this.ajax();
    },
    ajax: function () {
      var xhr = null;
      try {
        xhr = new window.XMLHttpRequest();
      } catch (e) {
        try {
          xhr = new window.ActiveXObject('Microsoft.XMLHTTP');
        } catch (e) {
          throw new Error('Not Supported');
        }
      }
      if (xhr) {
        xhr.open('GET', this.url, false);
        xhr.send(null);
        xhr.onreadystatechange = function () {
          if (xhr.readyState == 4) {
            if (xhr.status == 200) {
              _this.response = xhr.responseText;
              _this.writeData();
            } else {
              throw new Error('Error Occurred!!!');
            }
          }
        };
      }
    },
    writeData: function () {
      var elem;
      if (!this.response) {
        return;
      }
      this.dummyDiv = document.createElement('div'); //dummy div to hold the data so that dom methods can be
                                                     //performed to get the elements.
      this.dummyDiv.innerHTML = this.response;
      elem = this.findElem();
      if (elem) {
        this.writeDataToId.innerHTML = elem.innerHTML;
      } else {
        throw new Error('Error Occurred!!!');
      }
      this.dummyDiv = null; // free the memory after the use of dummyDiv is done.
    },
    findElem: function () {
      var i = 0, allTags = this.dummyDiv.getElementsByTagName('*'), l = allTags.length, elem;
      for (; i &lt; l; i++) {
        elem = allTags[i];
        if (elem.getAttribute('id') === this.writeDataOfId) {
          return elem;
        }
      }
      return null;
    }
  };
}());</pre>
<p>// and in dom ready make a call like this</p>
<pre>loadData.init(&lt;url&gt;, &lt;id u want to get data of&gt;, &lt;id in which you want to write the data&gt;);</pre>
<p>I know this is not so good of a post, but hope this gives you a little bit of idea what i&#8217;m trying to say.</p>
<p>Cheers!!! <img src='http://itquery.com/forum/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itquery.com/forum/?feed=rss2&#038;p=78</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

