<?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>Narnio&#187; Internet</title>
	<atom:link href="http://www.narnio.com/category/internet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.narnio.com</link>
	<description>A day in the life of a software engineer</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:31:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Complicated password policy failure</title>
		<link>http://www.narnio.com/2011/04/08/complicated-password-policy-failure/</link>
		<comments>http://www.narnio.com/2011/04/08/complicated-password-policy-failure/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 21:31:25 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=555</guid>
		<description><![CDATA[In most bigger companies, and for some commercial websites, you have to create what they like to call a strong password. Normally this will mean your password has to be at least 5 characters long and contain at least one number. Nothing wrong with that, and I can usually make a password that I can [...]]]></description>
			<content:encoded><![CDATA[<p>In most bigger companies, and for some commercial websites, you have to create what they like to call a strong password. Normally this will mean your password has to be at least 5 characters long and contain at least one number. Nothing wrong with that, and I can usually make a password that I can remember.</p>
<p>However lately I believe companies are pushing us to reach new levels of our brain or something. I&#8217;ve been seeing more policies where you have to have numbers, letters, special characters and capitalized letters in it. Oh and to top it of it can&#8217;t be a password you had in the past, or a incremental version of that (eg: test1 to test10).</p>
<p>Now lets examine how usefull such a policy is. I used to have pretty strong passwords, hard to guess and difficult to crack. Now that my passwords have to be so complicated I&#8217;m resorting to putting post-its on my screen with the passwords again. Very insecure and very easy to hack.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/04/08/complicated-password-policy-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skinable drop down box, first release</title>
		<link>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/</link>
		<comments>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 10:48:10 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=529</guid>
		<description><![CDATA[Just a few days ago I posted that I started working on a better looking drop down box to replace the select element on webpages. Today the first version is released under the GPL license. You can download it by visiting the plugin page under Plugins - Custom Combobox. This first version includes: Custom drop [...]]]></description>
			<content:encoded><![CDATA[<p>Just a few days ago I <a  href="http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/">posted </a>that I started working on a better looking drop down box to replace the select element on webpages. Today the first version is released under the <a  href="http://www.gnu.org/licenses/gpl.html">GPL license</a>. You can download it by visiting the plugin page under <a  href="http://www.narnio.com/plugins/"><strong>Plugins </strong></a>- <a  href="http://www.narnio.com/plugins/custom-combobox/"><strong>Custom Combobox</strong></a>.</p>
<p>This first version includes:</p>
<ol>
<li>Custom drop down arrows for disabled / mouse over and default combobox states</li>
<li>Ability to change the border styles of the drop down part as well as the combobox itself</li>
<li>Supports translating the following elements in comboboxes:
<ol>
<li>select element</li>
<li>ul &amp; ol element</li>
</ol>
</li>
</ol>
<p><strong>Please note: </strong>as this is the first release there may still be some bugs in the code, please feel free to contact me if you find any and I will attempt to solve them as quickly as possible.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Started work on a skinnable drop down box in JQuery.</title>
		<link>http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/</link>
		<comments>http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 22:30:06 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/</guid>
		<description><![CDATA[For my work I recently came across an issue with IE6 and the width of a select. For some reason it does not scale to the width of the content. So I started looking into a custom implementation using JQuery. Unfortunately the work halted when I ran into serious issues with our beloved website full [...]]]></description>
			<content:encoded><![CDATA[<p>For my work I recently came across an issue with IE6 and the width of a select. For some reason it does not scale to the width of the content. So I started looking into a custom implementation using JQuery.</p>
<p>Unfortunately the work halted when I ran into serious issues with our beloved website full with frames. But I am continuing it in my spare time as a research project. So soon more on this adventure.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The failing Blackberry, Apple and X-Box</title>
		<link>http://www.narnio.com/2010/12/23/the-failing-blackberry-apple-and-x-box/</link>
		<comments>http://www.narnio.com/2010/12/23/the-failing-blackberry-apple-and-x-box/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 18:40:50 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=466</guid>
		<description><![CDATA[Normally I don&#8217;t post any youtube movies here, but this one is funny and IT related. Hope you like it as much as I did. It&#8217;s about a Blackberry, Apple and X-Box. http://www.youtube.com/watch?v=kAG39jKi0lI Copyright &#169; 2012 Narnio. This Feed is for personal non-commercial use only. If you are not reading this material in your news [...]]]></description>
			<content:encoded><![CDATA[<p>Normally I don&#8217;t post any youtube movies here, but this one is funny and IT related. Hope you like it as much as I did. It&#8217;s about a Blackberry, Apple and X-Box.</p>
<p style="text-align: center;">
<p><a  href="http://www.youtube.com/watch?v=kAG39jKi0lI">http://www.youtube.com/watch?v=kAG39jKi0lI</a></p>
<p><a  href="http://www.youtube.com/watch?v=kAG39jKi0lI"><img src="http://img.youtube.com/vi/kAG39jKi0lI/default.jpg" width="130" height="97" border=0></a></p></p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/12/23/the-failing-blackberry-apple-and-x-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The HTC Desire indepth</title>
		<link>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/</link>
		<comments>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 16:18:37 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTC Desire]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=432</guid>
		<description><![CDATA[In a previous post I said I recently got a new phone, the HTC Desire. But since I only had it very briefly I felt it wasn&#8217;t the time yet to write about the phone itself. Well know I&#8217;ve been playing with it for more then a week so it&#8217;s time to write some small [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.narnio.com/wp-content/uploads/2010/08/htc-desire-vodafone.jpg" class="thickbox no_icon" rel="gallery-432" title="HTC Desire"><img style="margin-left: 4px; margin-bottom: 2px; border: 1px dashed #000000; float: right;" title="HTC Desire" src="http://www.narnio.com/wp-content/uploads/2010/08/htc-desire-vodafone-e1283010973305.jpg" alt="" width="282" height="478" /></a>In a previous post I said I recently got a new phone, the HTC Desire. But since I only had it very briefly I felt it wasn&#8217;t the time yet to write about the phone itself. Well know I&#8217;ve been playing with it for more then a week so it&#8217;s time to write some small article about it.</p>
<p>So I&#8217;ve been using HTC phones for several years now and so far I&#8217;ve liked every single phone I&#8217;ve had. But the Desire was my switch from Windows Mobile to the Android platform, and I was very worried about the switch to say the least.</p>
<h2>First impression of the Desire</h2>
<p>After switching on the phone for the first time I went through the setup procedure, which is as simple as 1, 2, 3. So thank god for that, it&#8217;s a huge step up from Windows Mobile 5.</p>
<p>I have to give HTC one thing, the phone response very well to any time you touch the screen. It&#8217;s probably the capacitive screen, but its a whole lot better then what I was used to.  Just after first boot you will probably play around a little with the widgets that are included.</p>
<p>As the Sense interface gives you 7 different tabs that you can put widgets on it will take you some time to configure it to your likings. Which is as much a blessing as a curse, especially in when you are just using the phone for the first time. Luckily the phone comes with several presets for the Sense interface.</p>
<p>My biggest concern was migrating all my data from Windows Mobile to the Android platform. And unfortunately my worries where right. So Google step up to the plate and make migrating from different phone platforms easier. It&#8217;s impossible to migrate text messages or call history without doing a lot of manual work.</p>
<h2>The good the bad and the ugly</h2>
<p>So what&#8217;s up with this phone. Is it a good thing to buy or good gift to get <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Well it sorta depends on what you are expecting. If you want a phone that gives you a lot of access to your social networks, then yeah it might be something for you. If you want something that just enables you to call and send text message, then please don&#8217;t waste your money on the Desire.  It&#8217;ll do the job but at a high price.</p>
<p>Having said that here are some of the pro&#8217;s and con&#8217;s of the phone:</p>
<table width="100%">
<thead>
<tr>
<td style="text-align: left;"><strong>Pro&#8217;s</strong></td>
<td style="text-align: left;"><strong>Con&#8217;s</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="50%" valign="top">
<ul>
<li>Very responsive to touch</li>
<li>Well thought out interface</li>
<li>Good build quality</li>
<li>Tons of applications available for Android</li>
<li>Automatic updating over the air</li>
</ul>
</td>
<td width="50%" valign="top">
<ul>
<li>Seems to loose 3G connection randomly, and won&#8217;t reconnect automatically</li>
<li>Very, very expensive at 400+ bucks</li>
<li>Crappy FriendStream widget of HTC</li>
</ul>
</td>
</tr>
</tbody>
</table>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leaving LinkedIn</title>
		<link>http://www.narnio.com/2010/08/20/leaving-linkedin/</link>
		<comments>http://www.narnio.com/2010/08/20/leaving-linkedin/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 20:07:37 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=427</guid>
		<description><![CDATA[Ok so I don&#8217;t know who the was the genious that introduces the captcha on the LinkedIn website, but it makes the damn website completely useless. Every time you login you need to enter an unreadable, completely useless captcha. See the screenshot below for what I mean. Now I know I&#8217;m not an expert on [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so I don&#8217;t know who the was the genious that introduces the captcha on the LinkedIn website, but it makes the damn website completely useless. Every time you login you need to enter an unreadable, completely useless captcha. See the screenshot below for what I mean.</p>
<div id="attachment_428" class="wp-caption aligncenter" style="width: 354px"><a  href="http://www.narnio.com/wp-content/uploads/2010/08/LinkedIn-Captcha.jpg" class="thickbox no_icon" rel="gallery-427" title="LinkedIn-Captcha"><img class="size-medium wp-image-428 " title="LinkedIn-Captcha" src="http://www.narnio.com/wp-content/uploads/2010/08/LinkedIn-Captcha-300x170.jpg" alt="" width="344" height="199" /></a><p class="wp-caption-text">Screenshot of Captcha</p></div>
<p>Now I know I&#8217;m not an expert on the usability side of things, but why do you need to enter a captcha code <strong>after correctly entering both your username and the password</strong>. This sersiously makes me wonder if it would not be better to erase my LinkedIn account. Unfortunately that would require me to login, now if I were only able to read the damn image.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/08/20/leaving-linkedin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling Tomcat using Ant scripting</title>
		<link>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/</link>
		<comments>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/#comments</comments>
		<pubDate>Wed, 26 May 2010 16:31:34 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=404</guid>
		<description><![CDATA[As a Java webdeveloper you are faced with a lot of different aspects of development. One is testing and debugging code, to do this you need an application server like Tomcat. One of the issues I recently encountered was the need to control various Tomcat instances with a single Ant build script. Below are some [...]]]></description>
			<content:encoded><![CDATA[<p>As a Java webdeveloper you are faced with a lot of different aspects of development. One is testing and debugging code, to do this you need an application server like Tomcat. One of the issues I recently encountered was the need to control various <a  href="http://tomcat.apache.org" target="_blank" title="Tomcat Homepage">Tomcat</a> instances with a single <a  href="http://ant.apache.org" target="_blank" title="Ant homepage">Ant</a> build script. Below are some of the solutions I&#8217;ve used to manipulate Tomcat.</p>
<p><b>Note:</b> some parts of this script rely on the <a  href="http://ant-contrib.sourceforge.net/" target="_blank" title="Ant Contrib home page">ant-contrib</a> library. Download this library and include it in the tomcat.xml with the following code:</p>
<pre class="brush: xml">
&lt;taskdef resource=&quot;net/sf/antcontrib/antcontrib.properties&quot;&gt;
 &lt;classpath&gt;
  &lt;pathelement location=&quot;./ant-contrib-1.0b3.jar&quot;/&gt;
 &lt;/classpath&gt;
&lt;/taskdef&gt;
</pre>
<h2>Starting tomcat</h2>
<p>Though starting tomcat may seem easy. You could just use the development IDE (like Netbeans) to start and stop Tomcat, but what this lacks is the ability to control several instances with easy shortcuts. So I defined the following Ant <a  href="http://ant.apache.org/manual/CoreTasks/macrodef.html" target="_blank" title="Macrodef Documentation">macrodef</a> in a file called tomcat.xml:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-start&quot;&gt;
 &lt;sequential&gt;
   &lt;trycatch&gt;
    &lt;try&gt;
      &lt;if&gt;
       &lt;not&gt;&lt;http url=&quot;http://localhost&quot;/&gt;&lt;/not&gt;
       &lt;then&gt;
         &lt;java classname=&quot;org.apache.catalina.startup.Bootstrap&quot;
             fork=&quot;yes&quot;
             dir=&quot;${tomcat.dir}&quot;
             spawn=&quot;true&quot;
             jvm=&quot;${tomcat.java.home}/bin/java&quot;&gt;
          &lt;jvmarg value=&quot;-Dcatalina.home=${tomcat.dir}&quot;/&gt;
          &lt;jvmarg value=&quot;-Dcatalina.base=${tomcat.dir}&quot;/&gt;
          &lt;jvmarg value=&quot;-Djava.io.tmpdir=${tomcat.dir}/temp&quot;/&gt;
          &lt;jvmarg value=&quot;-Djava.endorsed.dirs=${tomcat.dir}/common/endorsed&quot;/&gt;
          &lt;jvmarg value=&quot;-Xdebug&quot;/&gt;
          &lt;jvmarg value=&quot;-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n&quot;/&gt;
          &lt;classpath&gt;
           &lt;pathelement location=&quot;${tomcat.java.home}/lib/tools.jar&quot;/&gt;
           &lt;pathelement location=&quot;${tomcat.dir}/bin/bootstrap.jar&quot;/&gt;
          &lt;/classpath&gt;

          &lt;arg line=&quot;start&quot; /&gt;
         &lt;/java&gt;

         &lt;waitfor maxwait=&quot;10&quot; maxwaitunit=&quot;second&quot; checkevery=&quot;5000&quot;&gt;
          &lt;http url=&quot;http://localhost&quot;/&gt;
         &lt;/waitfor&gt;
         &lt;echo message=&quot;Tomcat started&quot;/&gt;
       &lt;/then&gt;
       &lt;else&gt;
        &lt;echo message=&quot;Tomcat already started...&quot; /&gt;
       &lt;/else&gt;
     &lt;/if&gt;
    &lt;/try&gt;
    &lt;catch&gt;
     &lt;echo message=&quot;Unable to start tomcat&quot;/&gt;
    &lt;/catch&gt;
  &lt;/trycatch&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This macro is really easy. First it starts of by checking if tomcat is not already running (well actually it just checks to see if there is something running on port 80). If nothing is running then tomcat is started using the java defined by the <a  href="http://ant.apache.org/manual/CoreTasks/property.html" title="Property Task documentation" target="_blank">ant property</a> <i>tomcat.java.home</i>. This macro also depends on some other properties that are set by a different macro, which will be a bit further on in the post. Tomcat is started by using the Bootloader class provided by the server, to make sure it loads correctly the <strong>classpath</strong> is set.</p>
<p>The last step in the macro is to wait for tomcat to start, this has to be done since we start tomcat in a seperate java instance (the <i>spawn</i> option).</p>
<h2>Stopping Tomat</h2>
<p>Off course you also want to be able to stop tomcat to load some new data, or an entire web-app. I use the following macro to stop Tomcat:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-stop&quot;&gt;
 &lt;sequential&gt;
  &lt;trycatch&gt;
   &lt;try&gt;
    &lt;java classname=&quot;org.apache.catalina.startup.Bootstrap&quot;
         fork=&quot;yes&quot;
         dir=&quot;${tomcat.dir}&quot;
         spawn=&quot;true&quot;
         jvm=&quot;${java.home}/bin/java&quot;&gt;
     &lt;jvmarg value=&quot;-Dcatalina.home=${tomcat.dir}&quot;/&gt;
     &lt;jvmarg value=&quot;-Dcatalina.base=${tomcat.dir}&quot;/&gt;
     &lt;jvmarg value=&quot;-Djava.io.tmpdir=${tomcat.dir}/temp&quot;/&gt;
     &lt;classpath&gt;
      &lt;pathelement location=&quot;${tomcat.java.home}/lib/tools.jar&quot;/&gt;
      &lt;pathelement location=&quot;${tomcat.dir}/bin/bootstrap.jar&quot;/&gt;
     &lt;/classpath&gt;

     &lt;arg line=&quot;stop&quot; /&gt;
    &lt;/java&gt;

    &lt;kill-java name=&quot;Bootstrap&quot; /&gt;
    &lt;echo message=&quot;Tomcat stopped&quot; /&gt;
   &lt;/try&gt;
   &lt;catch&gt;
    &lt;echo message=&quot;Unable to stop tomcat forcing shutdown.....&quot;/&gt;
    &lt;kill-java name=&quot;Bootstrap&quot; /&gt;
   &lt;/catch&gt;
  &lt;/trycatch&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>Just like with the starting of Tomcat I use the provided Bootloader class to instruct tomcat to stop. Again I use the java that is set in <i>tomcat.java.home</i> as well as some other properties loaded by another macro. Since Tomcat sometimes fails to stop gracefully (due to poorly designed webapps) you also have to kill the Java process of Tomcat. This is done with the call to <b>kill-java</b>.</p>
<h2>Killing any java process</h2>
<p>As you saw in the <b>tomcat-stop</b> macro I used a macro called <i>kill-java</i> to make sure that Tomcat is really killed and no longer running in the background. The macro is as follows:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;kill-java&quot;
          description=&quot;Forcefully stop tomcat....&quot;&gt;
 &lt;attribute name=&quot;name&quot;/&gt;
 &lt;sequential&gt;
  &lt;!-- Execute the jps and check for any Java process with the provided @{name} attribute --&gt;
  &lt;exec executable=&quot;${tomcat.java.home}/bin/jps&quot; output=&quot;pid.out.file&quot; /&gt;
  &lt;!-- Load in the name / pid file and strip all information except the PID --&gt;
  &lt;loadfile srcfile=&quot;pid.out.file&quot; property=&quot;pid.out&quot;&gt;
   &lt;filterchain&gt;
     &lt;linecontains&gt;
      &lt;contains value=&quot;@{name}&quot;/&gt;
     &lt;/linecontains&gt;
    &lt;tokenfilter&gt;
    &lt;deletecharacters chars=&quot;@{name}&quot;/&gt;
    &lt;trim/&gt;
    &lt;ignoreblank/&gt;
    &lt;/tokenfilter&gt;
    &lt;striplinebreaks/&gt;
   &lt;/filterchain&gt;
  &lt;/loadfile&gt;
  &lt;echo message=&quot;Killing java process with pid ${pid.out}&quot;/&gt;
  &lt;!-- Kill the process, warning this only Works on Windows --&gt;
  &lt;exec spawn=&quot;true&quot; executable=&quot;taskkill&quot;&gt;
   &lt;arg line=&quot;/PID ${pid.out}&quot; /&gt;
   &lt;arg line=&quot;/F&quot; /&gt;
  &lt;/exec&gt;
  &lt;delete file=&quot;pid.out.file&quot; /&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This macro is really simple and relies on the jps application provided by Java. This application returns a list of all running processes with name and process id (PID). All we need to do is get the line containing the process name provided and strip everything except the PID.</p>
<p><b>Please note:</b> the task killing the proces is designed for Windows, you could change this with kill in Linux.</p>
<h2>Rounding it up</h2>
<p>Though you now have all you need to manipulate tomcat there is one last macro that we are tegenkant upon. That is the initializer of the various Tomcat properties. I use the following macro:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-init&quot;&gt;
 &lt;attribute name=&quot;from&quot;/&gt;
 &lt;sequential&gt;
  &lt;property name=&quot;tomcat.dir&quot; value=&quot;${tomcat.@{from}.dir}&quot;/&gt;
  &lt;property name=&quot;tomcat.server&quot; value=&quot;${tomcat.@{from}.server}&quot;/&gt;
  &lt;property name=&quot;tomcat.port&quot; value=&quot;${tomcat.@{from}.port}&quot; /&gt;
  &lt;property name=&quot;j2ee.server.type&quot; value=&quot;${tomcat.server}&quot; /&gt;
  &lt;taskdef name=&quot;webapp-stop&quot;
          classname=&quot;org.apache.catalina.ant.StopTask&quot;
          classpath=&quot;${tomcat.dir}/server/lib/catalina-ant.jar&quot;/&gt;
  &lt;taskdef name=&quot;webapp-start&quot;
           classname=&quot;org.apache.catalina.ant.StartTask&quot;
           classpath=&quot;${tomcat.dir}/server/lib/catalina-ant.jar&quot;/&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This little macro will initialize tomcat for a specific environment (for exemple DEV). Of course none of this works without the loading of some preset properties in a property file <i>tomcat.properties</i>. Which contains the following data:</p>
<pre class="brush: php">
tomcat.java.home=C:/jdk1.5.0_22_32b

tomcat.DEV.dir=d:/jakarta/tomcat5.0
tomcat.DEV.server=tomcat55-DEV
tomcat.DEV.port=8000

tomcat.MAIN.dir=d:/jakarta/tomcat5.0-MAIN
tomcat.MAIN.server=tomcat55-MAIN
tomcat.MAIN.port=8000
</pre>
<p>To load the property file just include the following instruction in the build script:</p>
<pre class="brush: xml">
&lt;property file=&quot;./tomcat.properties&quot; /&gt;
</pre>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory issues finally solved</title>
		<link>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/</link>
		<comments>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 11:13:11 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[dovecot]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=394</guid>
		<description><![CDATA[As I posted before in &#8216;Mysterious problems with my VPS&#8217;, I recently got an increasingly unstable VPS system hosting a lot of my and my customers sites. After a lot of digging I initially presumed that Dovecot (the mail server) was responsible for the issues, as you can read in &#8216;Dovecot causing memory issues&#8217;. Last [...]]]></description>
			<content:encoded><![CDATA[<p>As I posted before in <a  title="View the post" href="http://www.narnio.com/2009/10/15/mysterious-problems-with-my-vps/">&#8216;Mysterious problems with my VPS&#8217;</a>, I recently got an increasingly unstable VPS system hosting a lot of my and my customers sites. After a lot of digging I initially presumed that Dovecot (the mail server) was responsible for the issues, as you can read in <a  title="View the post" href="http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/">&#8216;Dovecot causing memory issues&#8217;</a>.</p>
<p>Last week I did a lot of debugging on the Debian server to try and find out what was the issue. And initially it was Dovecots memory usage. After disabling this tool for a couple of days the server was still running fine. However the day after I posted the article on Dovecot the server crashed again. So I had to restart my investigation.</p>
<p>First off I had to had to get a better memory management tool, so I installed <em>Htop</em> on the server <em>(apt-get htop</em>)<em>. </em>This shows the current memory usage of each running application. After installing this I enabled all services and applications again and started running stress tests. And though Dovecot was causing some peeks in memory usage it did not keep the high memory usage after the requests where done.</p>
<p>As it turns out for some reason Apache 2.2 was using a lot of memory during peak loads. But even more frustrating it didn&#8217;t seem to release any memory any more. Which was causing issues for services that only spawn when they are being accessed like Dovecot and Postfix, which explained why both of these services crashed when the server halted.</p>
<p>After tweaking the maximum amount of servers Apache is allowed to start and the maximum amount of client threads to handle the memory usage dropped dramatically. And I am very happy to report that the server has been running again for more then a week, without any glitches.</p>
<p>Still it doesn&#8217;t explain why all of this only happened after updating my server with the latest versions and patches. But I&#8217;m glad it&#8217;s solved for now.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dovecot causing memory issues?</title>
		<link>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/</link>
		<comments>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 18:19:49 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=392</guid>
		<description><![CDATA[In my previous post I mentioned that I had and still am having some serious issues with the stability of the VPS I&#8217;m running all of my websites on. Though I&#8217;m still a long way away from solving the issue, I have figured out that it is very likely caused by an upgrade of Dovecot. [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post I mentioned that I had and still am having some serious issues with the stability of the VPS I&#8217;m running all of my websites on. Though I&#8217;m still a long way away from solving the issue, I have figured out that it is very likely caused by an upgrade of Dovecot.</p>
<p>Why I believe that dovecot is slowely over time eating up memory, well after I disabled it the VPS continued running without any issues. I already knew Apache 2, subversion and MySQL weren&#8217;t causing it. So I only had postfix and dovecot left to test.</p>
<p>What is truly amazing is that the website for Dovecot indicates it is low in memory consumption, hence it has no settings to limit the amount of memory allocated for Dovecot. So I still need to figure that part out, or alternatively change to a different IMAP server.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix, MySQL setup a blackhole</title>
		<link>http://www.narnio.com/2009/03/23/postfix-mysql-setup-a-blackhole/</link>
		<comments>http://www.narnio.com/2009/03/23/postfix-mysql-setup-a-blackhole/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 19:32:08 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=323</guid>
		<description><![CDATA[In previous articles I got into how to setup Postfix and Dovecot using MySQL for management. Well this time round a question rose about creating a blackhole. Which is basically a catch all e-mail address that dumps all mail coming in. Doing this in the MySql setup created before should be relatively easy. First of modify [...]]]></description>
			<content:encoded><![CDATA[<p>In previous articles I got into how to setup Postfix and Dovecot using MySQL for management. Well this time round a question rose about creating a blackhole. Which is basically a catch all e-mail address that dumps all mail coming in.</p>
<p>Doing this in the MySql setup created before should be relatively easy. First of modify the &#8216;<em>/etc/aliasses</em>&#8216; file and add &#8216;<em>devnull: /dev/null</em>&#8216;. This will add a virtual debian user called devnull to the system. Keep in mind this alias is not yet active. To activate it run: <strong>newaliases</strong>. This will compile the file and load it into the memory.</p>
<p>Now open either PostfixAdmin or MySql and add an alias from &#8216;@domain.com&#8217; to &#8216;devnull&#8217;. Which will catch all e-mail sent to domain.com and store it into the file belonging to user devnull, which in our case is the blackhole <img src='http://www.narnio.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Please be carefull, as all mail sent to the domain will be dropped unless either an alias or a mailbox is defined for the domain.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/03/23/postfix-mysql-setup-a-blackhole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

