<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The JavaDude Weblog</title>
	<atom:link href="http://javadude.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://javadude.wordpress.com</link>
	<description>Jabbering about Java Development and whatever comes along. &#124; Android &#124; Glassfish &#124; Netbeans &#124;  JEE6 &#124; Groovy and Grails &#124; PostgreSQL &#124; Drools &#124; ZK &#124; D3.js &#124; Amazon AWS &#124; Ubuntu &#124;</description>
	<lastBuildDate>Wed, 22 May 2013 19:44:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='javadude.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The JavaDude Weblog</title>
		<link>http://javadude.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://javadude.wordpress.com/osd.xml" title="The JavaDude Weblog" />
	<atom:link rel='hub' href='http://javadude.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Glassfish Tuning and Thread Dumps</title>
		<link>http://javadude.wordpress.com/2013/04/10/glassfish-tuning-and-thread-dumps/</link>
		<comments>http://javadude.wordpress.com/2013/04/10/glassfish-tuning-and-thread-dumps/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 02:46:07 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2546</guid>
		<description><![CDATA[Once you get into a production like stage with more data volume, more users, etc. you will find yourself pretty fast in the situation where Glassfish gets some hickups or slowness. An expected situation if you did not change the &#8230; <a href="http://javadude.wordpress.com/2013/04/10/glassfish-tuning-and-thread-dumps/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2546&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Once you get into a production like stage with more data volume, more users, etc. you will find yourself pretty fast in the situation where Glassfish gets some hickups or slowness. An expected situation if you did not change the default parameters  out of the box which are chosen to make Glassfish to run even on a small box.</p>
<p>We ran into some kind of concurrency problems with JDBC pools and thread where Glassfish appeared to be hanging. One approach is to create thread dumps for the JVM.<br />
With Glassfish we have a few options:</p>
<ol>
<li><strong>jstack</strong><br />
Run <em><strong>jps</strong></em> which returns you the list of applications running a JVM, choose the PID and execute<em><strong><br />
jstack &lt;PID&gt;</strong></em> or <em><strong>jstack -F &lt;PID&gt; &gt; td.log</strong></em></li>
<li><strong>asadmin</strong><br />
Go the Glassfish_HOME/bin folder and execute<br />
<em><strong><code>./asadmin --user admin generate-jvm-report --type=thread &gt; threaddump.txt</code></strong></em></li>
<li>kill -3 &lt;PID&gt;<br />
Supposed to create a dump in the default log folder of Glassfish. Doesnt work for me.</li>
</ol>
<p>With the (or better more than 1) file at hand you can evaluate them by hand or use some of the tools around. I am still struggling to make the tool analyzing my dumps. They simply open the files like a editor.</p>
<div id="attachment_2547" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/04/td.jpeg"><img class="size-full wp-image-2547" alt="tda tool" src="http://javadude.files.wordpress.com/2013/04/td.jpeg?w=908"   /></a><p class="wp-caption-text">tda tool</p></div>
<p><strong>Some References</strong></p>
<ul>
<li><a href="http://yusuke.homeip.net/samurai/en/index.html" target="_blank">Samurai Analyzer</a></li>
<li><a href="http://java.net/projects/tda" target="_blank">TDA</a></li>
<li><a href="https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c" target="_blank">IBM dev community tool</a></li>
<li><a href="http://planet.jboss.org/post/simple_tools_to_analyze_thread_dumps" rel="nofollow">http://planet.jboss.org/post/simple_tools_to_analyze_thread_dumps</a></li>
<li><a href="https://sites.google.com/site/threaddumps/java-thread-dumps" rel="nofollow">https://sites.google.com/site/threaddumps/java-thread-dumps</a></li>
<li><a href="http://architects.dzone.com/articles/how-analyze-java-thread-dumps" rel="nofollow">http://architects.dzone.com/articles/how-analyze-java-thread-dumps</a></li>
<li><a href="http://www.javacodegeeks.com/2012/03/jvm-how-to-analyze-thread-dump.html" rel="nofollow">http://www.javacodegeeks.com/2012/03/jvm-how-to-analyze-thread-dump.html</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2546&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/04/10/glassfish-tuning-and-thread-dumps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/04/td.jpeg" medium="image">
			<media:title type="html">tda tool</media:title>
		</media:content>
	</item>
		<item>
		<title>Enforce password for Ubuntu user on EC2 instances</title>
		<link>http://javadude.wordpress.com/2013/03/31/enforce-password-for-ubuntu-user-on-ec2-instances/</link>
		<comments>http://javadude.wordpress.com/2013/03/31/enforce-password-for-ubuntu-user-on-ec2-instances/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 09:56:20 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2541</guid>
		<description><![CDATA[Using linux (Ubuntu) instances on Amazon EC2 is a quite safe thing to do, at least measured by the security provided by the platform (security groups, ACL, physical security,..). I recommend reading their security site here. At the end of &#8230; <a href="http://javadude.wordpress.com/2013/03/31/enforce-password-for-ubuntu-user-on-ec2-instances/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2541&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">Using linux (Ubuntu) instances on Amazon EC2 is a quite safe thing to do, at least measured by the security provided by the platform (security groups, ACL, physical security,..). I recommend reading their <a href="https://aws.amazon.com/security/" target="_blank">security site here</a>. At the end of the day the server is only as secure as you configure it, if you choose to open all ports running services with their default configurations and password settings, Amazon can&#8217;t help you.</p>
<p>When connecting to a Ubuntu server with ssh you need to provide the keyfile (somekeyfile.pem) that you can download when creating the key pair.</p>
<div id="attachment_2542" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/keyfile.png"><img class="size-full wp-image-2542" alt="Key file" src="http://javadude.files.wordpress.com/2013/03/keyfile.png?w=908"   /></a><p class="wp-caption-text">Key file</p></div>
<p>This 2048 bit key is required to login as regular ubuntu user. What I dislike is the fact that this user can sudo all, so once someone manage to get into you user account, he has root access too. I recommend to set a password for the <em>ubuntu</em> user and change the sudoers configuration.</p>
<p>Change the password for user <em>ubuntu</em></p>
<p>Open the sudoers include file</p>
<pre><strong>sudo vi /etc/suderos.d/90-cloudimg-ubuntu</strong> or <em><strong>sudo vi /etc/sudoers</strong></em></pre>
<p>change last line from</p>
<pre>ubuntu  ALL=(ALL) NOPASSWD:ALL</pre>
<p>to</p>
<pre>ubuntu ALL=(ALL) ALL</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2541/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2541&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/03/31/enforce-password-for-ubuntu-user-on-ec2-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/keyfile.png" medium="image">
			<media:title type="html">Key file</media:title>
		</media:content>
	</item>
		<item>
		<title>Monitoring Glassfish V3.1.2 Options</title>
		<link>http://javadude.wordpress.com/2013/03/26/monitoring-glassfish-v3-1-2-options/</link>
		<comments>http://javadude.wordpress.com/2013/03/26/monitoring-glassfish-v3-1-2-options/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 03:31:20 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[glassfish]]></category>
		<category><![CDATA[asadmin]]></category>
		<category><![CDATA[java management extensions]]></category>
		<category><![CDATA[jconsole]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[restful]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2525</guid>
		<description><![CDATA[There are 2 crucial phases you want to look under the hood of your running Glassfish or inside the JVM underneath: Performance Tuning and Health Monitoring during production. With JMX (Java Management Extensions, Wikipedia) at hand, there are a few &#8230; <a href="http://javadude.wordpress.com/2013/03/26/monitoring-glassfish-v3-1-2-options/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2525&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>There are 2 crucial phases you want to look under the hood of your running Glassfish or inside the JVM underneath: Performance Tuning and Health Monitoring during production.</p>
<p>With JMX (Java Management Extensions, <a href="http://en.wikipedia.org/wiki/Java_Management_Extensions" target="_blank">Wikipedia</a>) at hand, there are a few options to choose from.</p>
<h2>JConsonsole</h2>
<p>The graphical monitoring tool is great for local deployment, it allows you to connect to a JVM on the same host or a remote host. It creates line graphs for your for all relevant from the moment you connect, it is perfect to observe a server while you do some testing or other actions, though it does not record any values while you are not connected. I have a hard time to get it running on a remote server and I do not favour the &#8216;open&#8217; approach (see <a title="Remote Glassfish V3.1 and the mystical JMX settings" href="http://javadude.wordpress.com/2011/11/18/remote-glassfish-v3-1-and-the-mystical-jmx-settings/" target="_blank">previous blog entry</a>) which allows anyone to access the JVM with the disabled authentication settings. I also had situations where the JVM was frozen and it was no longer possible to access the JVM for monitoring, here I would rather have snapshots before the problem started together with server.log.</p>
<div id="attachment_2527" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130326001.jpeg"><img class="size-full wp-image-2527" alt="JConsole" src="http://javadude.files.wordpress.com/2013/03/svh20130326001.jpeg?w=908"   /></a><p class="wp-caption-text">JConsole</p></div>
<h2>Glassfish Rest Interface</h2>
<p>Note: You need to enable the areas you want to monitor with the admin console (or the asadmin command line) because per default all are OFF.<span id="more-2525"></span></p>
<div id="attachment_2530" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130326002.jpeg"><img class="size-full wp-image-2530" alt="Glassfish Monitoring Settings" src="http://javadude.files.wordpress.com/2013/03/svh20130326002.jpeg?w=908"   /></a><p class="wp-caption-text">Glassfish Monitoring Settings</p></div>
<p>Then you access the monitoring values from the browser, curl or another application (authorization required!) through the URI, like <em><a href="https://localhost:4848/monitoring/domain/server/jvm/memory" rel="nofollow">https://localhost:4848/monitoring/domain/server/jvm/memory</a></em><br />
This also very useful to explore the available values for the asadmin approach (next option)</p>
<div id="attachment_2531" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130326003.jpeg"><img class="size-full wp-image-2531" alt="Restful through browser" src="http://javadude.files.wordpress.com/2013/03/svh20130326003.jpeg?w=908"   /></a><p class="wp-caption-text">Restful through browser</p></div>
<div id="attachment_2532" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130326004.jpeg"><img class="size-full wp-image-2532" alt="Restful through browser" src="http://javadude.files.wordpress.com/2013/03/svh20130326004.jpeg?w=908"   /></a><p class="wp-caption-text">Restful through browser</p></div>
<h2>asadmin commandline</h2>
<p>You can access all these telemetry stuff also through the asadmin command line ($GLASSFISH_HOME/bin), this comes handy for administrator who want to run cronjobs or bash scripts to take snapshots.</p>
<div id="attachment_2535" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130326005.jpeg"><img class="size-full wp-image-2535" alt="asadmin" src="http://javadude.files.wordpress.com/2013/03/svh20130326005.jpeg?w=908"   /></a><p class="wp-caption-text">asadmin</p></div>
<p><strong><em>./asadmin &#8211;user myadminuser &#8211;passwordfile /opt/passwordfile.txt get &#8211;monitor server.jvm.thread-system.*</em></strong><br />
Note: you need to pass admin user and password, the passwordfile contains the password in clear text:<br />
<em>AS_ADMIN_PASSWORD=mysupersecretpassword</em></p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
glassfish@ip-10-10-10-10:/opt/app-server/bin# ./asadmin --user admin --passwordfile ~/pwd.txt get --monitor server.jvm.memory.*
server.jvm.memory.committedheapsize-count-count = 3914924032
server.jvm.memory.committedheapsize-count-description = Amount of memory in bytes that is committed for the Java virtual machine to use
server.jvm.memory.committedheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.committedheapsize-count-name = CommittedHeapSize
server.jvm.memory.committedheapsize-count-starttime = 1364197189330
server.jvm.memory.committedheapsize-count-unit = bytes
server.jvm.memory.committednonheapsize-count-count = 259194880
server.jvm.memory.committednonheapsize-count-description = Amount of memory in bytes that is committed for the Java virtual machine to use
server.jvm.memory.committednonheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.committednonheapsize-count-name = CommittedNonHeapSize
server.jvm.memory.committednonheapsize-count-starttime = 1364197189330
server.jvm.memory.committednonheapsize-count-unit = bytes
server.jvm.memory.dotted-name = server.jvm.memory
server.jvm.memory.initheapsize-count-count = 4244635648
server.jvm.memory.initheapsize-count-description = Amount of memory in bytes that the Java virtual machine initially requests from the operating system for memory management
server.jvm.memory.initheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.initheapsize-count-name = InitialHeapSize
server.jvm.memory.initheapsize-count-starttime = 1364197189330
server.jvm.memory.initheapsize-count-unit = bytes
server.jvm.memory.initnonheapsize-count-count = 24313856
server.jvm.memory.initnonheapsize-count-description = Amount of memory in bytes that the Java virtual machine initially requests from the operating system for memory management
server.jvm.memory.initnonheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.initnonheapsize-count-name = InitialNonHeapSize
server.jvm.memory.initnonheapsize-count-starttime = 1364197189330
server.jvm.memory.initnonheapsize-count-unit = bytes
server.jvm.memory.maxheapsize-count-count = 3914924032
server.jvm.memory.maxheapsize-count-description = Maximum amount of memory in bytes that can be used for memory management
server.jvm.memory.maxheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.maxheapsize-count-name = MaxHeapSize
server.jvm.memory.maxheapsize-count-starttime = 1364197189330
server.jvm.memory.maxheapsize-count-unit = bytes
server.jvm.memory.maxnonheapsize-count-count = 587202560
server.jvm.memory.maxnonheapsize-count-description = Maximum amount of memory in bytes that can be used for memory management
server.jvm.memory.maxnonheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.maxnonheapsize-count-name = MaxNonHeapSize
server.jvm.memory.maxnonheapsize-count-starttime = 1364197189330
server.jvm.memory.maxnonheapsize-count-unit = bytes
server.jvm.memory.objectpendingfinalizationcount-count-count = 0
server.jvm.memory.objectpendingfinalizationcount-count-description = Approximate number of objects for which finalization is pending
server.jvm.memory.objectpendingfinalizationcount-count-lastsampletime = 1364268183797
server.jvm.memory.objectpendingfinalizationcount-count-name = ObjectsPendingFinalization
server.jvm.memory.objectpendingfinalizationcount-count-starttime = 1364197189330
server.jvm.memory.objectpendingfinalizationcount-count-unit = count
server.jvm.memory.usedheapsize-count-count = 1841024784
server.jvm.memory.usedheapsize-count-description = Amount of used memory in bytes
server.jvm.memory.usedheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.usedheapsize-count-name = UsedHeapSize
server.jvm.memory.usedheapsize-count-starttime = 1364197189330
server.jvm.memory.usedheapsize-count-unit = bytes
server.jvm.memory.usednonheapsize-count-count = 236054792
server.jvm.memory.usednonheapsize-count-description = Amount of used memory in bytes
server.jvm.memory.usednonheapsize-count-lastsampletime = 1364268183797
server.jvm.memory.usednonheapsize-count-name = UsedNonHeapSize
server.jvm.memory.usednonheapsize-count-starttime = 1364197189330
server.jvm.memory.usednonheapsize-count-unit = bytes

Command get executed successfully.

</pre>
<p>You can use wildcards, but be aware, <strong>server.*</strong> can create easily 50.000 + lines, even <strong>server.jvm.*</strong> 5.000 + lines.<br />
Only one parameter can be passed.<br />
An option is to snapshot this by a cronjob into a datetime stamped file every 1 or 5 minutes.</p>
<h2>Further Options</h2>
<ul>
<li>Implement your own monitoring as part of your deployment, make sure your persist into a database or logfiles, so the information is accessible even the JVM is down.<br />
Pro: You can implement to whatever extend you want.<br />
Con: Learning curve for JMX.</p>
<p><a href="http://weblogs.java.net/blog/kalali/archive/2010/04/06/manage-administrate-and-monitor-glassfish-v3-java-code-using-amx-jmx" rel="nofollow">http://weblogs.java.net/blog/kalali/archive/2010/04/06/manage-administrate-and-monitor-glassfish-v3-java-code-using-amx-jmx</a></p>
<p><a href="http://docs.oracle.com/cd/E19575-01/821-0031/gcgvu/index.html" rel="nofollow">http://docs.oracle.com/cd/E19575-01/821-0031/gcgvu/index.html</a></li>
<li>Use an existing solution that can be deployed into the application server<br />
The only application I could find is LightFish by Adam Bien</p>
<p><a href="http://lightfish.adam-bien.com/" rel="nofollow">http://lightfish.adam-bien.com/</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2525/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2525&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/03/26/monitoring-glassfish-v3-1-2-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130326001.jpeg" medium="image">
			<media:title type="html">JConsole</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130326002.jpeg" medium="image">
			<media:title type="html">Glassfish Monitoring Settings</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130326003.jpeg" medium="image">
			<media:title type="html">Restful through browser</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130326004.jpeg" medium="image">
			<media:title type="html">Restful through browser</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130326005.jpeg" medium="image">
			<media:title type="html">asadmin</media:title>
		</media:content>
	</item>
		<item>
		<title>Glassfish and https running secure applications</title>
		<link>http://javadude.wordpress.com/2013/03/25/glassfish-and-https-running-secure-applications/</link>
		<comments>http://javadude.wordpress.com/2013/03/25/glassfish-and-https-running-secure-applications/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 04:54:18 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[glassfish]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[default ports]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2519</guid>
		<description><![CDATA[By default Glassfish listens to http on port 8080 and https on port 8181. It is better to listen to the default ports 80 for http and 443 for https, usually you dont want the user to enter port numbers &#8230; <a href="http://javadude.wordpress.com/2013/03/25/glassfish-and-https-running-secure-applications/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2519&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>By default Glassfish listens to http on port 8080 and https on port 8181.<br />
It is better to listen to the default ports<strong> 80 for http</strong> and <strong>443 for https</strong>, usually you dont want the user to enter port numbers as part of the URL.</p>
<p>Even the Glassfish Admin Console allows to change the ports (Configurations/Server Config/Network Config/Network Listener), certain server OS such as Ubuntu do not allow non-root users (you should run Glassfish as separate user !) to ports below <strong>1024</strong>. We can achieve this by port rerouting with the iptables command (under Ubuntu)</p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8181
iptables-save -c &gt; /etc/iptables.rules
iptables-restore &lt; /etc/iptables.rules

vi /etc/network/if-pre-up.d/iptablesload
#!/bin/sh
iptables-restore &lt; /etc/iptables.rules
exit 0
</pre>
<p>Additionally you can get a proper SSL certificate to stop annoying the user with a no proper certificate warning. See <a title="Glassfish V3.1.2 and SSL" href="http://javadude.wordpress.com/2013/03/22/glassfish-v3-1-2-and-ssl/">previous tutorial here</a>.<br />
<div id="attachment_2520" class="wp-caption alignnone" style="width: 212px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130325001.jpeg"><img class="size-full wp-image-2520" alt="SSL Error" src="http://javadude.files.wordpress.com/2013/03/svh20130325001.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Error (Chrome)</p></div></p>
<p>If you operate an enterprise application with a known URL to the users, unlike a regular website where the portal should be reached with regular http, I would completely disable regular http.</p>
<div id="attachment_2521" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130325002.jpeg"><img class="size-full wp-image-2521" alt="Disable http" src="http://javadude.files.wordpress.com/2013/03/svh20130325002.jpeg?w=908"   /></a><p class="wp-caption-text">Disable http</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2519/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2519&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/03/25/glassfish-and-https-running-secure-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130325001.jpeg" medium="image">
			<media:title type="html">SSL Error</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130325002.jpeg" medium="image">
			<media:title type="html">Disable http</media:title>
		</media:content>
	</item>
		<item>
		<title>Glassfish V3.1.2 and SSL</title>
		<link>http://javadude.wordpress.com/2013/03/22/glassfish-v3-1-2-and-ssl/</link>
		<comments>http://javadude.wordpress.com/2013/03/22/glassfish-v3-1-2-and-ssl/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 09:26:53 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[glassfish]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2483</guid>
		<description><![CDATA[After almost 3 years (see previous post) I revisit the topic this time using the latest version og Glassfish 3.1.2 and GoDaddy as certificate provider. I created a certificate for a sub-domain (sub.whateverdomain.com) this time and make use of the &#8230; <a href="http://javadude.wordpress.com/2013/03/22/glassfish-v3-1-2-and-ssl/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2483&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After almost 3 years (<a title="Getting started with Glassfish V3 and SSL" href="http://javadude.wordpress.com/2010/04/06/getting-started-with-glassfish-v3-and-ssl/" target="_blank">see previous post</a>) I revisit the topic this time using the latest version og <strong>Glassfish 3.1.2</strong> and <strong>GoDaddy</strong> as certificate provider. I created a certificate for a sub-domain (<strong><em>sub.whateverdomain.com</em></strong>) this time and make use of the extremly <a href="http://www.godaddy.com/ssl/ssl-certificates.aspx" target="_blank">cheap 5.99 U$/year offer</a> (no wildcard included)</p>
<p>Let me summarize the key steps here:<span id="more-2483"></span></p>
<ul>
<li>Get yourself a GoDaddy account</li>
<li>Order a standard SSL
<div id="attachment_2485" class="wp-caption alignnone" style="width: 356px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_12.jpeg"><img class="size-full wp-image-2485 " alt="Standard SSL" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_12.jpeg?w=908"   /></a><p class="wp-caption-text">Standard SSL</p></div>
<p>&nbsp;</li>
<li>After payment you get 1 credit to use. Before we create the certificate we need to create a certificate request with the keytools for our glassfish domain</li>
<li>Change domain masterpassword (not the admin password)<br />
The default password is &#8216;changeit&#8217;, better change that with<strong><em> /bin$ ./asadmin change-masterpassword yourdomain</em></strong></li>
<li>Go to you domain config folder<strong><em> ~/glassfish/domains/yourdomain/config$</em> </strong></li>
<li>We will use the default keystore file in the config folder <em><strong>keystore.jks</strong></em><strong> </strong></li>
<li>Optional: List the existing certifcates, there should be 2.<br />
<em><strong>keytool -list -keystore keystore.jks</strong></em> or <em><strong>keytool -list -v -keystore keystore.jks</strong></em> (more info)<br />
You should get something like this</p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
Keystore type: JKS
Keystore provider: SUN

Your keystore contains 2 entries

glassfish-instance, Mar 28, 2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): AA:AA:AA:AA:AA:AA:BD:9D:85:5B:CF:AA:AA:86:BA:49:50:AA:AA:AA
s1as, Mar 28, 2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): 95:B4:E4:55:7F:F6:AA:AA:AA:AA:3D:65:21:D1:1B:AA:AA:AA:AA:AA
</pre>
</li>
<li>Create a key<br />
<em><strong>keytool -genkey -keysize 2048 -genkey -alias sub.whateverdomain.com -keyalg RSA  -keystore keystore.jks</strong></em><br />
This differs from the previous command, you dont use the -dname option any longer, but the keytool will ask interactivelyImportant: It asks for your last and first name, this is the CN tag. You MUST use the domain name you register for (sub.whateverdomain.com). The alias I would choose the same.</p>
<p><div id="attachment_2517" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_16.jpeg"><img class="size-full wp-image-2517" alt="keytool" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_16.jpeg?w=908"   /></a><p class="wp-caption-text">keytool</p></div></li>
<li>Create a certificate request file<br />
<em><strong>keytool -certreq -alias sub.whateverdomain.com -keystore keystore.jks -file whateverdomain.csr</strong></em></li>
<li>Open the file with the editor
<div id="attachment_2508" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_14.jpeg"><img class="size-full wp-image-2508 " alt="Request File" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_14.jpeg?w=908"   /></a><p class="wp-caption-text">Request File</p></div>
<p>&nbsp;</li>
<li>Now we need to go back to GoDaddy to create our certificate with the request string
<div id="attachment_2496" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_1.jpeg"><img class="size-full wp-image-2496 " alt="SSL Setup" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_1.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Setup</p></div>
<div id="attachment_2495" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_2.jpeg"><img class="size-full wp-image-2495" alt="SSL Setup" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_2.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Setup</p></div>
<p>&nbsp;</li>
<li>Enter the request string from the above file
<div id="attachment_2497" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_31.jpeg"><img class="size-full wp-image-2497" alt="SSL Setup" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_31.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Setup</p></div>
<p>&nbsp;</li>
<li>Choose validation method<br />
If you are the contact in the whois record, email verification is the easiest option.</p>
<div id="attachment_2498" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_51.jpeg"><img class="size-full wp-image-2498" alt="SSL Validation" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_51.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Validation</p></div>
<div id="attachment_2499" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_61.jpeg"><img class="size-full wp-image-2499" alt="SSL Admin" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_61.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Admin</p></div>
<p>&nbsp;</li>
<li>Confirm the email
<div id="attachment_2500" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_71.jpeg"><img class="size-full wp-image-2500" alt="Validation" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_71.jpeg?w=908"   /></a><p class="wp-caption-text">Validation</p></div>
<div id="attachment_2501" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_81.jpeg"><img class="size-full wp-image-2501" alt="Validation" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_81.jpeg?w=908"   /></a><p class="wp-caption-text">Validation</p></div>
<p>&nbsp;</li>
<li>Go to the SSL admin page
<div id="attachment_2502" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_91.jpeg"><img class="size-full wp-image-2502" alt="SSL Console" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_91.jpeg?w=908"   /></a><p class="wp-caption-text">SSL Console</p></div>
<p>Download the certificate<br />
Choose &#8216;other&#8217;<br />
<a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_101.jpeg"><img class="alignnone size-full wp-image-2503" alt="Download Certifcate" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_101.jpeg?w=908"   /></a></p>
<p>&nbsp;</li>
<li>Upload the 2 cert files from the zip to the domain config folder<br />
<em>gd_bundle.crt</em><br />
<em>sub.whateverdomain.com.crt</em><br />
and import them<br />
<em><strong>keytool -import -trustcacerts -alias root -file gd_bundle.crt -keystore keystore.jks</strong></em><br />
<strong><em>keytool -import -trustcacerts -alias demo.airtilus.net -file sub.whateverdomain.com.crt</em> -keystore keystore.jks</strong></li>
<li>Go to the Glassfish admin console
<div id="attachment_2509" class="wp-caption alignnone" style="width: 225px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_15.jpeg"><img class="size-full wp-image-2509" alt="Glassfish admin" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_15.jpeg?w=908"   /></a><p class="wp-caption-text">Glassfish admin</p></div>
<p>and adjust nickname (alias, here sub.whateverdomain.com) and the keystore file (here keystore.jks)</p>
<div id="attachment_2504" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_111.jpeg"><img class="size-full wp-image-2504" alt="http listener 2" src="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_111.jpeg?w=908"   /></a><p class="wp-caption-text">http listener 2</p></div>
<p>&nbsp;</li>
<li>Restart is not required but I recommend.</li>
<li>Optionally you can disable the http port 8080.</li>
<li>Open any of your web applications at port 8181<br />
<a href="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg"><img class="alignnone size-full wp-image-2510" alt="SVH20130322002" src="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg?w=908"   /></a></p>
<div id="attachment_2511" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130322001.jpeg"><img class="size-full wp-image-2511" alt="https" src="http://javadude.files.wordpress.com/2013/03/svh20130322001.jpeg?w=908"   /></a><p class="wp-caption-text">https</p></div>
<div id="attachment_2510" class="wp-caption alignnone" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg"><img class="size-full wp-image-2510" alt="https" src="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg?w=908"   /></a><p class="wp-caption-text">https</p></div>
<p>&nbsp;</li>
<li>Voila !</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2483/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2483&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/03/22/glassfish-v3-1-2-and-ssl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_12.jpeg" medium="image">
			<media:title type="html">Standard SSL</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_16.jpeg" medium="image">
			<media:title type="html">keytool</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_14.jpeg" medium="image">
			<media:title type="html">Request File</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_1.jpeg" medium="image">
			<media:title type="html">SSL Setup</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_2.jpeg" medium="image">
			<media:title type="html">SSL Setup</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_31.jpeg" medium="image">
			<media:title type="html">SSL Setup</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_51.jpeg" medium="image">
			<media:title type="html">SSL Validation</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_61.jpeg" medium="image">
			<media:title type="html">SSL Admin</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_71.jpeg" medium="image">
			<media:title type="html">Validation</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_81.jpeg" medium="image">
			<media:title type="html">Validation</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_91.jpeg" medium="image">
			<media:title type="html">SSL Console</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_101.jpeg" medium="image">
			<media:title type="html">Download Certifcate</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_15.jpeg" medium="image">
			<media:title type="html">Glassfish admin</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/glassfish_ssl_111.jpeg" medium="image">
			<media:title type="html">http listener 2</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg" medium="image">
			<media:title type="html">SVH20130322002</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130322001.jpeg" medium="image">
			<media:title type="html">https</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/svh20130322002.jpeg" medium="image">
			<media:title type="html">https</media:title>
		</media:content>
	</item>
		<item>
		<title>Copy AMI between regions</title>
		<link>http://javadude.wordpress.com/2013/03/19/copy-ami-between-regions/</link>
		<comments>http://javadude.wordpress.com/2013/03/19/copy-ami-between-regions/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 05:11:31 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ebs]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[region]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2480</guid>
		<description><![CDATA[Finally this feature is available and easy as the click of a button. While it was previously almost impossible and last year through snapshots only you can select any AMI and copy to another region. It makes my life much &#8230; <a href="http://javadude.wordpress.com/2013/03/19/copy-ami-between-regions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2480&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">Finally this feature is available and easy as the click of a button. While it was previously almost impossible and last year <a title="Copy EC2 instance to another region" href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/" target="_blank">through snapshots only</a> you can select any AMI and copy to another region. It makes my life much easier and I stop maintaining reference images for every region but can make use of one image only ! More <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html" target="_blank">info here</a>.</p>
<div id="attachment_2481" class="wp-caption alignleft" style="width: 450px"><a href="http://javadude.files.wordpress.com/2013/03/amitransfer.jpeg"><img class="size-full wp-image-2481" alt="AMI Transferral" src="http://javadude.files.wordpress.com/2013/03/amitransfer.jpeg?w=908"   /></a><p class="wp-caption-text">AMI Transferral</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2480/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2480&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/03/19/copy-ami-between-regions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/03/amitransfer.jpeg" medium="image">
			<media:title type="html">AMI Transferral</media:title>
		</media:content>
	</item>
		<item>
		<title>d3.js &#8211; Available Books</title>
		<link>http://javadude.wordpress.com/2013/02/23/d3-js-available-books/</link>
		<comments>http://javadude.wordpress.com/2013/02/23/d3-js-available-books/#comments</comments>
		<pubDate>Sat, 23 Feb 2013 11:11:17 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[bookshelf]]></category>
		<category><![CDATA[d3.js]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2471</guid>
		<description><![CDATA[D3 is my favourite visualization platform, though the learning curve is steeper because it is about selections, data mapping and transformation close to the DOM. D3 does not come with pre-defined visualizations like bar and piecharts. The website comes with &#8230; <a href="http://javadude.wordpress.com/2013/02/23/d3-js-available-books/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2471&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;"><a href="http://d3js.org/" target="_blank">D3</a> is my favourite visualization platform, though the learning curve is steeper because it is about selections, data mapping and transformation close to the DOM. D3 does not come with pre-defined visualizations like bar and piecharts. The website comes with lots of samples and tutorials are available as well. If you take the time to walk through them and experiment by yourself you will learn most. Still I enjoy reading books about technical topics with an end to end walk-through.</p>
<p style="text-align:justify;">Currently there are 2 books about D3 both from O&#8217;Reilly and both have a similar introductory focus.</p>
<p style="text-align:justify;"><strong>Getting Started with D3</strong></p>
<p style="text-align:justify;"><a href="http://shop.oreilly.com/product/0636920025429.do"><img class="alignleft size-full wp-image-2473" alt="d3a" src="http://javadude.files.wordpress.com/2013/02/d3a.gif?w=908"   /></a> <em>June 2012, 12.99 U$ (ebook)</em></p>
<p style="text-align:justify;">The books does what its title promises, getting you started, It jumps right into D3 with sample applications and code. What I really like is the fact the author connects the visualizations to real life data (New York&#8217;s MTA transportation data) which makes the whole book more entertaining and tangible. It also provides a chapter about transition and interaction, even about layouts which make more exciting visualizations, like those we all know from the D3 websites sample page. Though it does not go into advanced details. At this reasonable price I would recommend the title.</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><strong>Interactive Data Visualization for the Web</strong></p>
<p style="text-align:justify;"><a href="http://shop.oreilly.com/product/0636920026938.do"><img class="alignleft size-full wp-image-2472" alt="d3b" src="http://javadude.files.wordpress.com/2013/02/d3b.gif?w=908"   /></a></p>
<p style="text-align:justify;"><em>November 2012, 23.99 US (ebook)</em></p>
<p style="text-align:justify;">This book is a bit more comprehensive than the first one, it starts with some more basic underlying technologies and provides the reader with an introduction to HTML, DOM, CSS and Javascripts. The chapters covering D3 are written lengthier providing slightly more details. It runs along the sample around a bar-charts and scatter-plots which turns dull after a while.  The early release I have seems to be incomplete, so I dont want to give a final verdict.</p>
<p style="text-align:justify;">
<p style="text-align:justify;">With D3 obviously getting more popular we will certainly see more books, hopefully covering advanced features and more visualization centric. I was asked if I like to write one but my D3 knowledge is way not comprehensive enough, I wish Mike Bostock would write one.</p>
<p style="text-align:justify;"><span style="text-decoration:underline;">Post number 300 ! Thanks to the up to 1000 visitors a day.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2471&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2013/02/23/d3-js-available-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/02/d3a.gif" medium="image">
			<media:title type="html">d3a</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2013/02/d3b.gif" medium="image">
			<media:title type="html">d3b</media:title>
		</media:content>
	</item>
		<item>
		<title>Copy EC2 instance to another region</title>
		<link>http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/</link>
		<comments>http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 05:51:49 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ami]]></category>
		<category><![CDATA[availability]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[region]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[volume]]></category>
		<category><![CDATA[zone]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2454</guid>
		<description><![CDATA[Is it finally possible ? While the AMI import tool is long awaited for but only available for Windows, it is rather a big hazzle to transfer manually (see this) any other OS ( my last attempt in 2010). Today &#8230; <a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2454&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">Is it finally possible ? While the <a href="http://aws.amazon.com/ec2/vmimport/" target="_blank">AMI import tool</a> is long awaited for but only available for Windows, it is rather a big hazzle to transfer manually (<a href="http://blog.ibd.com/scalable-deployment/copy-an-ebs-ami-image-to-another-amazon-ec2-region/" target="_blank">see this</a>) any other OS ( <a href="http://javadude.wordpress.com/2010/10/27/creating-an-ubuntu-10-04-ami-using-a-local-vmware/" target="_blank">my last attempt in 2010</a>).</p>
<p style="text-align:justify;">Today <a href="http://aws.typepad.com/aws/2012/12/ebs-snapshot-copy.html" target="_blank">Amazon announced</a> the <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html" target="_blank">EBS Snapshot Copy Feature</a> (across regions). The intention is certainly to allow easy migration of data to another region, as you can copy the snapshot, create a volume and attach it to an instance. I was curious to try if I can migrate my Ubuntu instance to another region and it worked. You can use both command-line as well the AWS web admin.</p>
<ul>
<li><strong>Create a snapshot of a volume in your source region</strong>
<p><div id="attachment_2455" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219001/" rel="attachment wp-att-2455"><img class="size-medium wp-image-2455" alt="Create Snapshot" src="http://javadude.files.wordpress.com/2012/12/svh20121219001.jpeg?w=300&#038;h=150" width="300" height="150" /></a><p class="wp-caption-text">Create Snapshot</p></div></li>
<li><strong><span id="more-2454"></span>Copy Snapshot</strong><br />
Beware of the transfer charges (this is considered regular IN/OUT traffic!)</p>
<div id="attachment_2456" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219002/" rel="attachment wp-att-2456"><img class="size-medium wp-image-2456" alt="Copy Snapshot" src="http://javadude.files.wordpress.com/2012/12/svh20121219002.jpeg?w=300&#038;h=156" width="300" height="156" /></a><p class="wp-caption-text">Copy Snapshot</p></div>
<div id="attachment_2458" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219003/" rel="attachment wp-att-2458"><img class="size-medium wp-image-2458" alt="Copy Snapshot" src="http://javadude.files.wordpress.com/2012/12/svh20121219003.jpeg?w=300&#038;h=102" width="300" height="102" /></a><p class="wp-caption-text">Copy Snapshot</p></div>
<p>&nbsp;</li>
<li>Change to<strong> target region</strong></li>
<li><strong>Create an instance</strong> of the same type as your source (not really important to be same sizing) with some local AMI</li>
<li><strong>Stop the new instance</strong></li>
<li><strong>Detach</strong> the volume automatically created
<p><div id="attachment_2460" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219005/" rel="attachment wp-att-2460"><img class="size-medium wp-image-2460" alt="Detach Volume" src="http://javadude.files.wordpress.com/2012/12/svh20121219005.jpeg?w=300&#038;h=193" width="300" height="193" /></a><p class="wp-caption-text">Detach Volume</p></div></li>
<li><strong>Create a volume</strong> from the copied snapshot<br />
Make sure it is in the same availability zone !</p>
<p><div id="attachment_2461" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219004/" rel="attachment wp-att-2461"><img class="size-medium wp-image-2461" alt="Create Volume" src="http://javadude.files.wordpress.com/2012/12/svh201212190041.jpeg?w=300&#038;h=133" width="300" height="133" /></a><p class="wp-caption-text">Create Volume</p></div></li>
<li><strong>Attach it to the new instance as /dev/sda1</strong>
<div id="attachment_2462" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219006/" rel="attachment wp-att-2462"><img class="size-medium wp-image-2462" alt="Attach Volume" src="http://javadude.files.wordpress.com/2012/12/svh20121219006.jpeg?w=300&#038;h=109" width="300" height="109" /></a><p class="wp-caption-text">Attach Volume</p></div>
<p><div id="attachment_2463" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219007/" rel="attachment wp-att-2463"><img class="size-medium wp-image-2463" alt="Attach Volume" src="http://javadude.files.wordpress.com/2012/12/svh20121219007.jpeg?w=300&#038;h=165" width="300" height="165" /></a><p class="wp-caption-text">Attach Volume</p></div></li>
<li>Start instance et Voila !
<p><div id="attachment_2465" class="wp-caption alignnone" style="width: 272px"><a href="http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/svh20121219008/" rel="attachment wp-att-2465"><img class="size-medium wp-image-2465" alt="Server Log" src="http://javadude.files.wordpress.com/2012/12/svh20121219008.jpeg?w=262&#038;h=300" width="262" height="300" /></a><p class="wp-caption-text">Server Log</p></div></li>
</ul>
<p>I am not sure if there are any side-effects or if it work with other OS but my Ubuntu server boots as expected and works fine. Great !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2454/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2454/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2454&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2012/12/19/copy-ec2-instance-to-another-region/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219001.jpeg?w=300" medium="image">
			<media:title type="html">Create Snapshot</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219002.jpeg?w=300" medium="image">
			<media:title type="html">Copy Snapshot</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219003.jpeg?w=300" medium="image">
			<media:title type="html">Copy Snapshot</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219005.jpeg?w=300" medium="image">
			<media:title type="html">Detach Volume</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh201212190041.jpeg?w=300" medium="image">
			<media:title type="html">Create Volume</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219006.jpeg?w=300" medium="image">
			<media:title type="html">Attach Volume</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219007.jpeg?w=300" medium="image">
			<media:title type="html">Attach Volume</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121219008.jpeg?w=262" medium="image">
			<media:title type="html">Server Log</media:title>
		</media:content>
	</item>
		<item>
		<title>Running Ubuntu 12.04 Desktop on EC2</title>
		<link>http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/</link>
		<comments>http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 08:48:56 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[12.04]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[nx]]></category>
		<category><![CDATA[precise pangolin]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2421</guid>
		<description><![CDATA[To say it upfront: Usually there is no need to run an Ubuntu server with a desktop in the cloud. Whatever you do on the desktop you can do in a terminal too (assuming you dont want to use GIMP &#8230; <a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2421&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">To say it upfront: Usually there is no need to run an Ubuntu server with a desktop in the cloud. Whatever you do on the desktop you can do in a terminal too (assuming you dont want to use GIMP in the cloud). Here a little summary to get you started with a Precise Pangolin desktop running in the cloud.</p>
<p style="text-align:justify;"><strong>Security</strong>: We will not use VNC, but NX. VNC is not secure (though can be tunnelled through SSH) and it works by sending compressed bitmaps of the screen, which is slower and less accurate than a NX server (X Server calls, Unix/Linux only)</p>
<p><strong>Requirements</strong>: Amazon AWS account</p>
<p><strong>Step-by-Step</strong></p>
<ul>
<li>Log into your AWS account</li>
<li>Optional: <strong>Create a security group</strong> with port 22 inbound only
<div id="attachment_2422" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205003/" rel="attachment wp-att-2422"><img class="size-medium wp-image-2422" alt="Security Group" src="http://javadude.files.wordpress.com/2012/12/svh20121205003.jpeg?w=300&#038;h=189" height="189" width="300" /></a><p class="wp-caption-text">Security Group</p></div>
<div id="attachment_2426" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205004/" rel="attachment wp-att-2426"><img class="size-medium wp-image-2426" alt="Port 22 only" src="http://javadude.files.wordpress.com/2012/12/svh20121205004.jpeg?w=300&#038;h=161" height="161" width="300" /></a><p class="wp-caption-text">Port 22 only</p></div>
<p><span id="more-2421"></span></li>
<li>Optional: Create a new key pair and download it
<p><div id="attachment_2428" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205005/" rel="attachment wp-att-2428"><img class="size-medium wp-image-2428" alt="Keypair" src="http://javadude.files.wordpress.com/2012/12/svh20121205005.jpeg?w=300&#038;h=258" height="258" width="300" /></a><p class="wp-caption-text">Keypair</p></div></li>
<li>Find an AMI for your region (EBS recommended) at <a href="http://cloud-images.ubuntu.com/desktop/precise/current/" rel="nofollow">http://cloud-images.ubuntu.com/desktop/precise/current/</a><br />
I select an EBS 64 bit version for Singapore datacentre (ami-4695d614)</p>
<p><div id="attachment_2429" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205006/" rel="attachment wp-att-2429"><img class="size-medium wp-image-2429" alt="Ubuntu AMI" src="http://javadude.files.wordpress.com/2012/12/svh20121205006.jpeg?w=300&#038;h=213" height="213" width="300" /></a><p class="wp-caption-text">Ubuntu AMI</p></div></li>
<li><strong>Create an instance</strong><br />
Using the AMI we looked up and the security group and key pair we created. I recommend to choose a type at least m1.small, the micro instance not sufficient memory to run GNOME and other applications.</p>
<div id="attachment_2433" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205008/" rel="attachment wp-att-2433"><img class="size-medium wp-image-2433" alt="New instance" src="http://javadude.files.wordpress.com/2012/12/svh20121205008.jpeg?w=300&#038;h=150" height="150" width="300" /></a><p class="wp-caption-text">New instance</p></div>
<div id="attachment_2432" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205009/" rel="attachment wp-att-2432"><img class="size-medium wp-image-2432" alt="Instance Type" src="http://javadude.files.wordpress.com/2012/12/svh20121205009.jpeg?w=300&#038;h=115" height="115" width="300" /></a><p class="wp-caption-text">Instance Type</p></div>
<div id="attachment_2431" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205010/" rel="attachment wp-att-2431"><img class="size-medium wp-image-2431" alt="Key Pair" src="http://javadude.files.wordpress.com/2012/12/svh20121205010.jpeg?w=300&#038;h=104" height="104" width="300" /></a><p class="wp-caption-text">Key Pair</p></div>
<p><div id="attachment_2430" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121205011/" rel="attachment wp-att-2430"><img class="size-medium wp-image-2430" alt="Security Group" src="http://javadude.files.wordpress.com/2012/12/svh20121205011.jpeg?w=300&#038;h=146" height="146" width="300" /></a><p class="wp-caption-text">Security Group</p></div></li>
<li>When instance is running <strong>connect with SSH</strong><br />
eg. <em>ssh -i desktopserver.pem ubuntu@ec2-xx-yy-zz.ap-southeast-1.compute.amazonaws.com</em><br />
(Dont forget to set the pem file permission to 400 !)<br />
I recommend to use an elastic IP and a dyndns entry if you want to use the instance long term.</p>
<div id="attachment_2438" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206001/" rel="attachment wp-att-2438"><img class="size-medium wp-image-2438" alt="Running Instances" src="http://javadude.files.wordpress.com/2012/12/svh20121206001.jpeg?w=300&#038;h=54" height="54" width="300" /></a><p class="wp-caption-text">Running Instances</p></div>
<p><div id="attachment_2439" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206002/" rel="attachment wp-att-2439"><img class="size-medium wp-image-2439" alt="SSH session" src="http://javadude.files.wordpress.com/2012/12/svh20121206002.jpeg?w=300&#038;h=186" height="186" width="300" /></a><p class="wp-caption-text">SSH session</p></div></li>
<li>Change to root user and<strong> install this package (NX server)</strong>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
sudo -i
add-apt-repository ppa:freenx-team
apt-get update
aptitude install -y freenx
</pre>
<p>The desktop package is already installed in this AMI, otherwise</p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y ubuntu-desktop
</pre>
<p>Download the install script from <a href="https://launchpad.net/freenx-server" rel="nofollow">https://launchpad.net/freenx-server</a> with</p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
cd /var/lib/nxserver
wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
gunzip *gz
tar -xvf *tar
</pre>
<p>Execute the script, I recommend to create a private key (not to share the key with the whole planet, even claimed to be secure)<br />
<em>./nxsetup &#8211;install</em></p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
root@ip-10-00-2-00:/var/lib/nxserver# ./nxsetup --install
------&gt; It is recommended that you use the NoMachine key for
easier setup. If you answer &quot;y&quot;, FreeNX creates a custom
KeyPair and expects you to setup your clients manually.
&quot;N&quot; is default and uses the NoMachine key for installation.

Do you want to use your own custom KeyPair? [y/N] y
Setting up /etc/nxserver ...done
Generating public/private dsa key pair.
Your identification has been saved in /etc/nxserver/users.id_dsa.
Your public key has been saved in /etc/nxserver/users.id_dsa.pub.
The key fingerprint is:
9b:0c:11:64:00:00:00:00:00:00:13:43:3a:61:fc:1b root@ip-10-148-2-238
The key's randomart image is:
+--[ DSA 1024]----+
|   . +=+         |
|    +.*.         |
|      =o o       |
|       .+        |
|                 |
|                 |
+-----------------+
Setting up /var/lib/nxserver/db ...done
Setting up /var/log/nxserver.log ...done
Adding user &quot;nx&quot; to group &quot;utmp&quot; ...done
Setting up known_hosts and authorized_keys2 ...Unique key generated; your users must install

/var/lib/nxserver/home/.ssh/client.id_dsa.key

on their computers.
done
Setting up permissions ...done
Setting up cups nxipp backend ...cp: `/usr/lib/cups/backend/ipp' and `/usr/lib/cups/backend/ipp' are the same file
</pre>
</li>
<li>Copy the created<strong> key file</strong> to your local desktop<br />
<em>cat /var/lib/nxserver/home/.ssh/client.id_dsa.key</em> 
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
root@ip-10-00-2-00:/var/lib/nxserver# cat /var/lib/nxserver/home/.ssh/client.id_dsa.key
-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQClwGVwNjZophIgelkOtUIcZsuzvvmHEkGql27ctHj21/sb33BG
ECHMJ/pwKkRlS4Xq9f9PvXj3QVW8yGOImM6oHHgKQze49JmSYDGfZ6o8UkNNQniL
....
W6SJuJK2yX1OHZAY1AtRpaPkQcl3EtZqSdYzPf83Zz26zsbJ63QgFuhns/UahId2
...
S2VvyiMh6rbJ0yoBwFxqi6Qc/NmgvIVT/6U6NTuMdLNMeE73EmvimwIVAJJVPYog
c839CAl7vfZgpdZOSzZf
-----END DSA PRIVATE KEY-----
</pre>
</li>
<li>Important: NX cant handle the<strong> Gnome 3D desktop</strong>, you need to update with this, otherwise you get a <strong><em>Failed to load session “gnome-fallback&#8221;</em></strong><em><br />
</em>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
echo -e &quot;\nCOMMAND_START_GNOME='gnome-session --session=ubuntu-2d'&quot;|sudo tee -a /etc/nxserver/node.conf
</pre>
</li>
<li>All Ubuntu AMI come with the user ubuntu and disabled password login, we need to change this:
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
vi  /etc/ssh/sshd_config

Change to yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes

and restart
/etc/init.d/ssh restart

set password
passwd ubuntu
</pre>
</li>
<li><strong>Download and install a NX client</strong> from <a href="http://www.nomachine.com/download.php" target="_blank">www.nomachine.com</a>
<div id="attachment_2441" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206003/" rel="attachment wp-att-2441"><img class="size-medium wp-image-2441" alt="NX Client" src="http://javadude.files.wordpress.com/2012/12/svh20121206003.jpeg?w=300&#038;h=275" height="275" width="300" /></a><p class="wp-caption-text">NX Client</p></div>
<p>&nbsp;</li>
<li><strong>Run and Configure the client</strong>
<div id="attachment_2442" class="wp-caption alignnone" style="width: 260px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206004/" rel="attachment wp-att-2442"><img class="size-medium wp-image-2442" alt="NX Client Config" src="http://javadude.files.wordpress.com/2012/12/svh20121206004.jpeg?w=250&#038;h=300" height="300" width="250" /></a><p class="wp-caption-text">NX Client Config</p></div>
<div id="attachment_2443" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206005/" rel="attachment wp-att-2443"><img class="size-medium wp-image-2443" alt="Key" src="http://javadude.files.wordpress.com/2012/12/svh20121206005.jpeg?w=300&#038;h=297" height="297" width="300" /></a><p class="wp-caption-text">Key</p></div>
<p>&nbsp;</li>
<li><strong>Connect to the instance</strong> <em>et Voila</em> !
<div id="attachment_2444" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206006/" rel="attachment wp-att-2444"><img class="size-medium wp-image-2444" alt="Connecting" src="http://javadude.files.wordpress.com/2012/12/svh20121206006.jpeg?w=300&#038;h=136" height="136" width="300" /></a><p class="wp-caption-text">Connecting</p></div>
<p><div id="attachment_2445" class="wp-caption alignnone" style="width: 310px"><a href="http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/svh20121206008/" rel="attachment wp-att-2445"><img class="size-medium wp-image-2445" alt="Desktop Session" src="http://javadude.files.wordpress.com/2012/12/svh20121206008.jpeg?w=300&#038;h=199" height="199" width="300" /></a><p class="wp-caption-text">Desktop Session</p></div></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2421&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2012/12/05/running-ubuntu-12-04-desktop-on-ec2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205003.jpeg?w=300" medium="image">
			<media:title type="html">Security Group</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205004.jpeg?w=300" medium="image">
			<media:title type="html">Port 22 only</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205005.jpeg?w=300" medium="image">
			<media:title type="html">Keypair</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205006.jpeg?w=300" medium="image">
			<media:title type="html">Ubuntu AMI</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205008.jpeg?w=300" medium="image">
			<media:title type="html">New instance</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205009.jpeg?w=300" medium="image">
			<media:title type="html">Instance Type</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205010.jpeg?w=300" medium="image">
			<media:title type="html">Key Pair</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205011.jpeg?w=300" medium="image">
			<media:title type="html">Security Group</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206001.jpeg?w=300" medium="image">
			<media:title type="html">Running Instances</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206002.jpeg?w=300" medium="image">
			<media:title type="html">SSH session</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206003.jpeg?w=300" medium="image">
			<media:title type="html">NX Client</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206004.jpeg?w=250" medium="image">
			<media:title type="html">NX Client Config</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206005.jpeg?w=300" medium="image">
			<media:title type="html">Key</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206006.jpeg?w=300" medium="image">
			<media:title type="html">Connecting</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121206008.jpeg?w=300" medium="image">
			<media:title type="html">Desktop Session</media:title>
		</media:content>
	</item>
		<item>
		<title>Running EC2 spot instances</title>
		<link>http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/</link>
		<comments>http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 03:55:48 +0000</pubDate>
		<dc:creator>devdude</dc:creator>
				<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[bidding]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[save money]]></category>
		<category><![CDATA[singapore]]></category>
		<category><![CDATA[spot instance]]></category>

		<guid isPermaLink="false">http://javadude.wordpress.com/?p=2410</guid>
		<description><![CDATA[or &#8216; Save ultimately more money with AWS&#8217; I use EC2 instances for test, development, demo and also for deployment to production. Amazon offers different types of instances, ranging from a micro instance (613 MB Ram and 2 CPU units) &#8230; <a href="http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2410&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>or <strong>&#8216; Save ultimately more money with AWS&#8217;</strong></p>
<p style="text-align:justify;">I use EC2 instances for test, development, demo and also for deployment to production. Amazon offers different types of instances, ranging from a micro instance (613 MB Ram and 2 CPU units) to a full fledge Cluster Compute Quadruple Extra Large Instance (60GB RAM and 33 CPU units). Of course a different price and paid per hour usage, available anytime.</p>
<p>All on demand Linux instances (Singapore):</p>
<ul>
<li>Micro instance: <strong>U$ 0.02</strong> per hour</li>
<li>Medium instance: <strong>U$ 0.34</strong> per hour</li>
<li>High Mem/CPU instance: <strong>U$ 2.024</strong> per hour</li>
</ul>
<p>On top of this there are 3 <strong>different categories</strong> of instances (in contractual terms)</p>
<p>Some price comparison for a <em>m1.Large</em> instance we use for testing (7,5GB RAM and 4 CPU units)</p>
<ul>
<li>On Demand (any time without any contractual obligations, we are using them currently)<br />
<strong>$0.340 per Hour</strong> &gt; 1 month U$ 244.80 (fulltime 24h)</li>
<li><strong>Reserved Instance</strong> (1 year term, one time payment U$ 276.00)<br />
<strong>U$ 0.196 per Hour</strong> &gt; 1 month U$ 141.12 (3 months: U$ 699.36 vs on-demand U$ 734.40, 12 months: U$ 1969.44 vs. on-demand U$ 2937.60 = ~30% savings )</li>
<li><strong>Spot Instance</strong> (depends on availability, you bid on a price range, if price exceeds your limit your instance shuts down)<br />
<strong>U$ 0.04 per Hour</strong> (as of December 5th 2012) &gt; 1 month U$ 28.80</li>
</ul>
<p>The spot instance, almost at 10% of the on-demand price, is extremely attractive and I am using it as test server.<br />
Not suitable for production or demo purpose though.</p>
<p>The reserved instance starts to break even after 3 months full-time usage !</p>
<p>In order not to pay for instances running idle (at night, weekend) they auto-shutdown and the user can start them in a self provision fashion (for test, demo or training).</p>
<p>Interesting enough, the price fluctuation is very different in the AWS regions. Lets look at a m1.large instance type in the <strong>Ireleand</strong>  versus <strong>Singapore </strong>datacentre.</p>
<div>
<div id="attachment_2413" class="wp-caption alignnone" style="width: 810px"><a href="http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/svh20121205001/" rel="attachment wp-att-2413"><img class="size-full wp-image-2413" alt="AWS Ireland" src="http://javadude.files.wordpress.com/2012/12/svh20121205001.jpeg?w=908"   /></a><p class="wp-caption-text">AWS Ireland</p></div>
<p>&nbsp;</p>
<div id="attachment_2416" class="wp-caption alignnone" style="width: 810px"><a href="http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/svh20121205002/" rel="attachment wp-att-2416"><img class="size-full wp-image-2416" alt="AWS Singapore" src="http://javadude.files.wordpress.com/2012/12/svh20121205002.jpeg?w=908"   /></a><p class="wp-caption-text">AWS Singapore</p></div>
</div>
<p>Obviously Singapore customers are not into this bidding concept, it remains permanently at 4cts while for Ireland the price jumps up to several Dollars !</p>
<p>More information at:</p>
<ul>
<li><a href="http://javadude.wordpress.com/2012/10/16/ec2-server-on-demand-without-elastic-ip/" target="_blank">http://javadude.wordpress.com/2012/10/16/ec2-server-on-demand-without-elastic-ip/</a></li>
<li><a href="http://javadude.wordpress.com/2012/06/04/running-ftp-server-on-ec2-on-demand/" target="_blank">http://javadude.wordpress.com/2012/06/04/running-ftp-server-on-ec2-on-demand/</a></li>
<li><a href="http://aws.amazon.com/pricing/ec2/" target="_blank">http://aws.amazon.com/pricing/ec2/</a></li>
<li><a href="http://aws.amazon.com/ec2/instance-types/" target="_blank">http://aws.amazon.com/ec2/instance-types/</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javadude.wordpress.com/2410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javadude.wordpress.com/2410/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javadude.wordpress.com&#038;blog=3891833&#038;post=2410&#038;subd=javadude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javadude.wordpress.com/2012/12/05/running-ec2-spot-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c590146f757718a268c168a7eee0f53f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devdude</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205001.jpeg" medium="image">
			<media:title type="html">AWS Ireland</media:title>
		</media:content>

		<media:content url="http://javadude.files.wordpress.com/2012/12/svh20121205002.jpeg" medium="image">
			<media:title type="html">AWS Singapore</media:title>
		</media:content>
	</item>
	</channel>
</rss>
