<?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>Techcrony.in</title>
	<atom:link href="http://www.techcrony.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techcrony.info</link>
	<description>Your Technical Buddy</description>
	<lastBuildDate>Thu, 26 Jan 2012 17:52:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>UNIX: How to Automate SSH Login</title>
		<link>http://www.techcrony.info/2012/01/26/nitingautam/unix-how-to-automate-ssh-login/</link>
		<comments>http://www.techcrony.info/2012/01/26/nitingautam/unix-how-to-automate-ssh-login/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 17:46:19 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=183</guid>
		<description><![CDATA[Yesterday, I was working on some shell script piece for my project and I came across a situation where I have to copy some files from one server to another using &#8216;scp&#8217; command and also some time have to execute &#8230; <a href="http://www.techcrony.info/2012/01/26/nitingautam/unix-how-to-automate-ssh-login/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Yesterday, I was working on some shell script piece for my project and I came across a situation where I have to copy some files from one server to another using &#8216;scp&#8217; command and also some time have to execute some command on other server.  One requirement was we don&#8217;t need to pass the password of functional id inside the script. </span></p>
<p><span style="font-size: small; font-family: arial,helvetica,sans-serif;">User should be able to login to other server without password using command  &#8220;ssh -l username remotehost&#8221;</span>.</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">For this I used SSH public key based authentication as below:-</span></p>
<p><span id="more-183"></span></p>
<p>For this to work you need a file named id_dsa.pub in your ~/.ssh Directory. If it’s not there, simply create it with below command:</p>
<blockquote>
<p>ssh-keygen -t dsa</p>
</blockquote>
<p>above command will create below directory with public and private keys:</p>
<blockquote>
<p>.ssh/id_dsa<br />.ssh/id_dsa.pub</p>
</blockquote>
<p>now copy<strong> id_dsa.pub</strong> file to remote server .ssh/ directory as &#8220;<strong>authorized_keys2</strong>&#8221; with whom you would like to do an automated login.</p>
<p> After that try below command from source server, no need for password</p>
<pre>ssh -l username remotehost</pre>
<p><span style="font-size: x-small; font-family: arial,helvetica,sans-serif;"> For more details can view <a title="link" href="http://pkeck.myweb.uga.edu/ssh/" target="_blank">link</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2012/01/26/nitingautam/unix-how-to-automate-ssh-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.io.NotSerializableException</title>
		<link>http://www.techcrony.info/2012/01/17/admin/java-io-notserializableexception/</link>
		<comments>http://www.techcrony.info/2012/01/17/admin/java-io-notserializableexception/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 05:23:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Troubleshoot]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=179</guid>
		<description><![CDATA[I was getting this error today during writing a program java.io.NotSerializableException: com.xxxx.xxx.xxx.thunderhead.Project    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)    at java.util.ArrayList.writeObject(ArrayList.java:570) &#160; Later I realized that I forget to implement Serializable interface in my bean. That fixed issue.]]></description>
			<content:encoded><![CDATA[<p>I was getting this error today during writing a program</p>
<blockquote>
<p>java.io.NotSerializableException: com.xxxx.xxx.xxx.thunderhead.Project<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)<br />    at java.util.ArrayList.writeObject(ArrayList.java:570)</p>
</blockquote>
<p>&nbsp;</p>
<p><span id="more-179"></span></p>
<p>Later I realized that I forget to implement Serializable interface in my bean. That fixed issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2012/01/17/admin/java-io-notserializableexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDING</title>
		<link>http://www.techcrony.info/2011/12/15/admin/java-security-nosuchalgorithmexception-cannot-find-any-provider-supporting-rsanoneoaeppadding/</link>
		<comments>http://www.techcrony.info/2011/12/15/admin/java-security-nosuchalgorithmexception-cannot-find-any-provider-supporting-rsanoneoaeppadding/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 07:04:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=176</guid>
		<description><![CDATA[Got below error during web service request:- java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDINGat javax.crypto.Cipher.getInstance(DashoA12275)at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:703)at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:145)at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:114) This appears to BouncyCastle is missing from class path.  Or Bouncycastle jar may still in the classpath &#8211; but it&#8217;s not picked &#8230; <a href="http://www.techcrony.info/2011/12/15/admin/java-security-nosuchalgorithmexception-cannot-find-any-provider-supporting-rsanoneoaeppadding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Got below error during web service request:-</span></p>
<blockquote>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: x-small;">java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDING</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: x-small;">at javax.crypto.Cipher.getInstance(DashoA12275)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: x-small;">at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:703)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: x-small;">at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:145)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: x-small;">at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:114)</span></p>
</blockquote>
<p><span id="more-176"></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">This appears to BouncyCastle is missing from class path.  Or Bouncycastle jar may still in the classpath &#8211; but it&#8217;s not picked as a crypto provider.</span></p>
<p><strong><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Try below solution:</span></strong></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Download the Bouncycastle jar corresponding to your JDK from <a href="http://www.bouncycastle.org/latest_releases.html">here</a> and copy it to [JAVA_HOME]\jre\lib\ext\</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Set following in [JAVA_HOME]\jre\lib\security\java.security under;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">#</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;"># List of providers and their preference orders (see above):</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">#</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">security.provider.X=org.bouncycastle.jce.provider.BouncyCastleProvider</span>OR</p>
<p>In code add Bouncycastle as a provider.</p>
<blockquote>
<p>import java.security.Security;  <br />import org.bouncycastle.jce.provider.BouncyCastleProvider;  <br />  <br />Security.addProvider(new BouncyCastleProvider());</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/12/15/admin/java-security-nosuchalgorithmexception-cannot-find-any-provider-supporting-rsanoneoaeppadding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.security.InvalidKeyException: Illegal key size or default parameters</title>
		<link>http://www.techcrony.info/2011/12/15/nitingautam/java-security-invalidkeyexception-illegal-key-size-or-default-parameters/</link>
		<comments>http://www.techcrony.info/2011/12/15/nitingautam/java-security-invalidkeyexception-illegal-key-size-or-default-parameters/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 06:54:14 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[Axis2]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rampart]]></category>
		<category><![CDATA[InvalidKeyException]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rampart]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=171</guid>
		<description><![CDATA[I was working on webservice call where my code was breaking in RAD during decrypting the password of keystore. I encountered below error: Caused by: java.security.InvalidKeyException: Illegal key size or default parameters    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]  &#8230; <a href="http://www.techcrony.info/2011/12/15/nitingautam/java-security-invalidkeyexception-illegal-key-size-or-default-parameters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">I was working on webservice call where my code was breaking in RAD during decrypting the password of keystore. I encountered below error:</span></p>
<blockquote>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><code>Caused by: java.security.InvalidKeyException: Illegal key size or default parameters<br />    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]<br />    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]<br />    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]<br />    at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]<br />    at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]<br /></code><br /></span></p>
</blockquote>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><span id="more-171"></span>There are key size restrictions with the default crypto files local_policy.jar and US_export_policy.jar comes with JDK &#8211; which limits it to 128.</span> <span style="font-family: arial,helvetica,sans-serif; font-size: small;">If your security policy using a key size larger than this &#8211; then the above exception is thrown. </span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">For example &#8211; if your security policy specifies the algorithmic suite as Basic256 &#8211; then the key size to be used is 256.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">For the solution of above issue, you need to patch your JDK with Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. </span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">For JDK1.5 <a href="http://java.sun.com/javase/downloads/index_jdk5.jsp">visit</a>, download the crypto files and copy the two jar files from the extracted jce directory (local_policy.jar and US_export_policy.jar) to $JAVA_HOME/jre/lib/security.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">For JDK1.6 <a href="http://java.sun.com/javase/downloads/index.jsp">visit</a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">If your IDE using it&#8217;s own specific JDK then patch that as well with these files to resolve the issue.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/12/15/nitingautam/java-security-invalidkeyexception-illegal-key-size-or-default-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caused by: java.security.UnrecoverableKeyException: Cannot recover key</title>
		<link>http://www.techcrony.info/2011/12/12/nitingautam/caused-by-java-security-unrecoverablekeyexception-cannot-recover-key/</link>
		<comments>http://www.techcrony.info/2011/12/12/nitingautam/caused-by-java-security-unrecoverablekeyexception-cannot-recover-key/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 03:05:08 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[Axis2]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rampart]]></category>
		<category><![CDATA[axis2]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rampart]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=163</guid>
		<description><![CDATA[During deployment of my code on server I faced below issue signature issue: org.apache.axis2.AxisFault: Error in signature with X509Token    at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)    at org.apache.axis2.engine.Phase.invoke(Phase.java:318)    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) Caused by: org.apache.rampart.RampartException: Error in signature with X509Token   &#8230; <a href="http://www.techcrony.info/2011/12/12/nitingautam/caused-by-java-security-unrecoverablekeyexception-cannot-recover-key/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During deployment of my code on server I faced below issue signature issue:</p>
<blockquote>
<p><span style="font-size: x-small;">org.apache.axis2.AxisFault: <strong>Error in signature with X509Token</strong></span><br /><span style="font-size: x-small;">    at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.engine.Phase.invoke(Phase.java:318)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)</span><br /><span style="font-size: x-small;">    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)</span><br /><span style="font-size: x-small;"> Caused by: org.apache.rampart.RampartException: Error in signature with X509Token</span><br /><span style="font-size: x-small;">    at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:746)</span><br /><span style="font-size: x-small;">    at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:419)</span><br /><span style="font-size: x-small;">    at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95)</span><br /><span style="font-size: x-small;">    at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)</span><br /><span style="font-size: x-small;">    at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)</span><br /><span style="font-size: x-small;">    &#8230; 102 more</span></p>
<p><span style="font-size: x-small;">Caused by: org.apache.ws.security.WSSecurityException: Signature creation failed; nested exception is: </span><br /><span style="font-size: x-small;">    java.security.UnrecoverableKeyException: Cannot recover key</span><br /><span style="font-size: x-small;">    at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:721)</span><br /><span style="font-size: x-small;">    at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:737)</span><br /><span style="font-size: x-small;">    &#8230; 106 more</span><br /><strong><span style="font-size: x-small;">Caused by: java.security.UnrecoverableKeyException: Cannot recover key</span></strong><br /><span style="font-size: x-small;">    at sun.security.provider.KeyProtector.recover(KeyProtector.java:311)</span><br /><span style="font-size: x-small;">    at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:121)</span><br /><span style="font-size: x-small;">    at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:38)</span><br /><span style="font-size: x-small;">    at java.security.KeyStore.getKey(KeyStore.java:763)</span><br /><span style="font-size: x-small;">    at org.apache.ws.security.components.crypto.CryptoBase.getPrivateKey(CryptoBase.java:216)</span><br /><span style="font-size: x-small;">    at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:713)</span><br /><span style="font-size: x-small;">    &#8230; 107 more</span></p>
</blockquote>
<p><span id="more-163"></span>Above issue is caused by CallbackHandler, because Incorrect password is provided for the private key. Correct the password you are good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/12/12/nitingautam/caused-by-java-security-unrecoverablekeyexception-cannot-recover-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.lang.IllegalStateException: Cannot map handler [controller] to URL path : There is already handler</title>
		<link>http://www.techcrony.info/2011/09/26/admin/java-lang-illegalstateexception-cannot-map-handler-to-url-path/</link>
		<comments>http://www.techcrony.info/2011/09/26/admin/java-lang-illegalstateexception-cannot-map-handler-to-url-path/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 01:33:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[handler mapping]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=153</guid>
		<description><![CDATA[I am using Spring 3.0 for my new application&#8230;I am not very familiar with annotation but learning them they are cool.  Today I faced &#8220;Cannot Map Handler [XXX] to URL Path&#8221; error, while running my page. Later debug I found &#8230; <a href="http://www.techcrony.info/2011/09/26/admin/java-lang-illegalstateexception-cannot-map-handler-to-url-path/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am using Spring 3.0 for my new application&#8230;I am not very familiar with annotation but learning them they are cool.  Today I faced &#8220;Cannot Map Handler [XXX] to URL Path&#8221; error, while running my page.</p>
<p>Later debug I found that I duplicated the Controller definition stuff inside XXX-Servlet.xml as below.<span id="more-153"></span></p>
<pre><code>&lt;context:component-scan base-package="org.me.spring.web" /&gt;</code></pre>
<p>and</p>
<pre><code>&lt;bean  class="org.me.spring.web.SampleController" &gt;</code></pre>
<p>The first line will auto-discover and register a <span style="text-decoration: underline;">SampleController</span> for you. By explicitly declaring another one, you get a duplicate, and the url-mapping will clash.</p>
<p>You need to either remove the &lt;context:component-scan&gt;, or remove the explicit bean definitions for the controller and the DAO. If you do the latter, then you&#8217;ll need to use <span style="text-decoration: underline;">autowiring</span> to inject their dependencies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/09/26/admin/java-lang-illegalstateexception-cannot-map-handler-to-url-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Count lines of multiple similar files in unix</title>
		<link>http://www.techcrony.info/2011/09/08/nitingautam/count-lines-of-multiple-similar-files-in-unix/</link>
		<comments>http://www.techcrony.info/2011/09/08/nitingautam/count-lines-of-multiple-similar-files-in-unix/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 08:30:10 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[blank line count]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=145</guid>
		<description><![CDATA[In continuation to my earlier post regarding concatenation similar files into one. I am writing this post to demonstrate counting lines of similar kind of files in a given directory and sub-directory. Below command will find all the logs with &#8230; <a href="http://www.techcrony.info/2011/09/08/nitingautam/count-lines-of-multiple-similar-files-in-unix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In continuation to my earlier post regarding <a href="http://www.techcrony.info/2011/09/08/nitingautam/concatenate-merge-join-multiple-text-files-in-windows/">concatenation similar files</a> into one. I am writing this post to demonstrate counting lines of similar kind of files in a given directory and sub-directory.</p>
<p>Below command will find all the logs with given name pattern inside the directory including sub directories and then WC will count it&#8217;s lines and display on screen in total.</p>
<blockquote>
<p><span id="more-145"></span> wc -l `find . -name usage*.log`</p>
</blockquote>
<p><span style="text-decoration: underline;">Sample output of command</span></p>
<p>     4 ./2011-08-08/usage.log<br />     5 ./2011-08-09/usage.log<br />     5 ./2011-08-10/usage.log<br />     4 ./2011-08-11/usage.log<br />     2 ./2011-08-12/usage.log<br />     4 ./2011-08-13/usage.log<br />   24 total</p>
<p>Below command will not count the blank lines.</p>
<blockquote>
<p>grep -cv &#8216;^\s*$&#8217; `find . -name &#8220;usag*.log&#8221;`</p>
</blockquote>
<p>Sample Output, see below blank lines are not counted.</p>
<p>./2011-08-08/usage.log:3<br />./2011-08-09/usage.log:4<br />./2011-08-10/usage.log:4<br />./2011-08-11/usage.log:3<br />./2011-08-12/usage.log:1<br />./2011-08-13/usage.log:3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/09/08/nitingautam/count-lines-of-multiple-similar-files-in-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concatenate/merge/join Multiple Text Files in Windows</title>
		<link>http://www.techcrony.info/2011/09/08/nitingautam/concatenate-merge-join-multiple-text-files-in-windows/</link>
		<comments>http://www.techcrony.info/2011/09/08/nitingautam/concatenate-merge-join-multiple-text-files-in-windows/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 04:40:36 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[merge text files]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=138</guid>
		<description><![CDATA[Last night I got many log files from 8 different servers, all the servers have date wise log files. I separated out similar logs and kept in a folder, now as per requirement team needs the one type of log &#8230; <a href="http://www.techcrony.info/2011/09/08/nitingautam/concatenate-merge-join-multiple-text-files-in-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last night I got many log files from 8 different servers, all the servers have date wise log files. I separated out similar logs and kept in a folder, now as per requirement team needs the one type of log in consolidated manner means &#8220;USAGE.log&#8221; of all days and servers in one USAGE-Consildated.log file.</p>
<p>I was searching for some utility on Google but not get any. Later I thought about DOS Batch command to do the same but a simple copy command did it for me.</p>
<blockquote>
<p><span id="more-138"></span>Copy /a *.log USAGE-Consildated.log</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/09/08/nitingautam/concatenate-merge-join-multiple-text-files-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use of String variable in Java Switch Statement</title>
		<link>http://www.techcrony.info/2011/08/30/nitingautam/use-of-string-variable-in-java-switch-statement/</link>
		<comments>http://www.techcrony.info/2011/08/30/nitingautam/use-of-string-variable-in-java-switch-statement/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 13:52:45 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[switch java statement]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=131</guid>
		<description><![CDATA[There is no way to perform a true switch on a String in Java. With the arrival of JDK 5.0 and its implementation of enum, a reasonably close approximation of this can be done using the following code. Create an enum &#8230; <a href="http://www.techcrony.info/2011/08/30/nitingautam/use-of-string-variable-in-java-switch-statement/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif;">There is no way to perform a true <strong>switch on a String</strong> in Java. With the arrival of JDK 5.0 and its implementation of <code>enum</code>, a reasonably close approximation of this can be done using the following code. </span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">Create an enum :</span></p>
<blockquote>
<p> <code>public enum Months{ JAN, FEB, MAR, APRIL;}</code></p>
</blockquote>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif;"><span id="more-131"></span>Given this enum, the following switch statement could be used: </span></p>
<blockquote>
<p><code>switch (Months.valueOf(str)) <br />{ <br /> case JAN: <br /> case FEB: <br /> // processing <br /> break; <br /> default: <br /> // processing ... <br />}</code></p>
<p>Enum.valueOf() <strong>matches the given String to the actual enum name</strong> using the same basic hashcode() matching technique that earlier proposals have suggested; but with this , all of that machinery is generated by the compiler and Enum implementation. The set of possible String values is also maintained in a more structured way when held in an enum.</p>
</blockquote>
<p>Of course, the above suffers from the serious drawback that Enum.valueof() can throw an unchecked IllegalArgumentException or NullPointerException. The only real way to get around this issue is to create a new static method that absorbs these Exceptions and instead returns some default value:</p>
<p>&nbsp;</p>
<blockquote>
<p><code>public enum Months {<br /> JAN, FEB, MAR, APR, JUN, JUL, AUG, SEP, OCT, NOV,DEC,NOVALUE; <br /> public static Months toDay(String str) <br /> { <br />   try { return valueOf(str); } catch (Exception ex) { return NOVALUE; } <br /> }<br /> }</code></p>
<p><span style="font-family: arial,helvetica,sans-serif;">Then the <code>switch</code> can be written to include a <code>default</code> clause that handles unexpected String values: </span></p>
<p><code>switch (Months.toDay(str)) {<br /> case JAN: <br /> case FEB: <br /> case MAR: <br /> // etc ... <br /> default: <br /> // any non-Day value <br />}</code></p>
</blockquote>
<p><span style="font-family: arial,helvetica,sans-serif;"><br /></span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/08/30/nitingautam/use-of-string-variable-in-java-switch-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uncaught exception: [Exception&#8230; &#8220;Not enough arguments&#8221;  (NS_ERROR_XPC_NOT_ENOUGH_ARGS)</title>
		<link>http://www.techcrony.info/2011/08/05/nitingautam/uncaught-exception-exception-not-enough-arguments-ns_error_xpc_not_enough_args/</link>
		<comments>http://www.techcrony.info/2011/08/05/nitingautam/uncaught-exception-exception-not-enough-arguments-ns_error_xpc_not_enough_args/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 15:50:33 +0000</pubDate>
		<dc:creator>nitingautam</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.techcrony.info/?p=123</guid>
		<description><![CDATA[I was testing my web application on FireFox5 , I faced &#8220;not enough arguments&#8221; issue. During investigation what I found is while opening the page we are hitting actual issues inside ‘addEventListener’ function. I searched web around behavior of ‘addEventListener’ &#8230; <a href="http://www.techcrony.info/2011/08/05/nitingautam/uncaught-exception-exception-not-enough-arguments-ns_error_xpc_not_enough_args/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was testing my web application on FireFox5 , I faced &#8220;not enough arguments&#8221; issue. During investigation what I found is while opening the page we are hitting actual issues inside ‘addEventListener’ function. I searched web around behavior of ‘addEventListener’ in firefox and found that it expect third argument as well so I replaced below code locally and it worked for me =)</p>
<blockquote>
<p>addEventListener(&#8220;load&#8221;, function(event) {<br />      _init();<br />);</p>
<p>with<span id="more-123"></span></p>
<p>addEventListener(&#8220;load&#8221;, function(event) {<br />      _init();<br />},false);</p>
<p>&nbsp;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.techcrony.info/2011/08/05/nitingautam/uncaught-exception-exception-not-enough-arguments-ns_error_xpc_not_enough_args/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

