tag:blogger.com,1999:blog-25994649250132193012024-03-14T08:45:04.032+06:00Nahid's BlogWriting code for fun and food.Research on security for my soul.nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-2599464925013219301.post-8363839570344318062015-03-15T21:52:00.000+06:002015-03-15T22:01:33.159+06:00Topshelf made easy creating Windows Services<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;"><span style="line-height: 1.38; vertical-align: baseline;">Topshelf</span><span style="line-height: 1.38; vertical-align: baseline;"> is a open </span><a href="https://github.com/Topshelf/Topshelf" style="background-color: transparent; line-height: 1.38; text-decoration: none;"><span style="color: #1155cc; text-decoration: underline; vertical-align: baseline;">source</span></a><span style="line-height: 1.38; vertical-align: baseline;"> library available in</span><a href="https://www.nuget.org/packages/Topshelf/" style="background-color: transparent; line-height: 1.38; text-decoration: none;"><span style="color: #333333; vertical-align: baseline;"> </span><span style="color: #1155cc; text-decoration: underline; vertical-align: baseline;">nuget</span></a><span style="line-height: 1.38; vertical-align: baseline;"> allows you to easily host services on the Window's operating system using .Net</span>. </span></div>
<b id="docs-internal-guid-b03d9e90-1e0f-bb3d-efc2-0814b3328e65" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This is now common that we like to develop self hosted wep api or a rabbitmq consumer or a worker of any backend as console application . <span style="line-height: 22.0799999237061px;">Console application </span>debugging is easy but in production we choose a windows services. Creating and installing windows service using visual studio template was straightforward but debugging experience not good. However debugging a console app is much easier than a service. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">With </span><span style="background-color: white; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Topshelf</span><span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> nice fluent syntax we can make a console app easily to a windows service. Here is sample code snippet from </span><span style="background-color: white; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Topshelf</span><span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><a href="http://docs.topshelf-project.com/en/latest/configuration/quickstart.html" style="text-decoration: none;"><span style="background-color: white; color: #1155cc; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">quickstart</span></a><span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.7999999999999998; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #445588; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TownCrier</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">readonly</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #990000; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TownCrier</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #009999; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1000</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) {</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">AutoReset</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Elapsed</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> += (</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sender</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">eventArgs</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) => </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Console</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WriteLine</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #dd1144; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"It is {0} and all is well"</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DateTime</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #990000; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Start</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() { </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Start</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(); }</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #990000; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stop</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() { </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_timer</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stop</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(); }</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #445588; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Program</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #990000; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Main</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">HostFactory</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Run</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//1</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Service</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TownCrier</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">>(</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">s</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//2</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">s</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ConstructUsing</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">name</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=> </span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TownCrier</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//3</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">s</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WhenStarted</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tc</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tc</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Start</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//4</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">s</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WhenStopped</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tc</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">tc</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stop</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">()); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//5</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> });</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RunAsLocalSystem</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//6</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetDescription</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #dd1144; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Sample Topshelf Host"</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//7</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetDisplayName</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #dd1144; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Stuff"</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//8</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #333333; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetServiceName</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #dd1144; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Stuff"</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//9</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }); </span><span style="background-color: white; color: #999988; font-family: Consolas; font-size: 12px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//10</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #404040; font-family: Consolas; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ten line of simple code </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Then you can install the console directly by itself from command line without any external utility</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="119px;" src="https://lh3.googleusercontent.com/AHxUL26XhLbbbzCiPcYMwlJfwvbKIQG8KkoP0nuQJkbLW_jRul1E_yHG7qQSxOmecCzW3hk5ucbNVSmrH4pYa-L9Ff4_BDNGgAEAU-682NttoXNxIcu_rAFBhUB1Q-S33A8o9w" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">the help also rich and cool </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="119px;" src="https://lh4.googleusercontent.com/DgUfyHHYShsjwr3ZxQiiJgaEdPJpRjSRKIt7L7DEbRdBtwQe9cPPqoQv4KQKRgITPIa6TrAr03YarsVK45quxrtevGMb60DHP0AZogBV6t_W6Pn3f-PKPTr5E6_gJqKgyPq2Zw" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="253px;" src="https://lh6.googleusercontent.com/tBJksitW2L0z2uRsQNuKfkSdO4EnZrhKyDMiBpb6vR8itxMPAWqsiBfcSfKX6kH9F_Vj4sv0AEXkCleRMCDukrHlcGSvRDyqNlpKb9Kvpn2SDeeVHGWDG6s1dY3YsVOBWROnmA" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Found useful ? check more </span><a href="http://docs.topshelf-project.com/en/latest/overview/index.html" style="text-decoration: none;"><span style="background-color: white; color: #1155cc; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">here</span></a><span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. </span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</div>
nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-19900273060221736072015-01-24T18:55:00.001+06:002015-01-24T19:10:20.358+06:00Clustering rabbitmq on windows and linux<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">I’m looking for rabbitmq because of its robustness and its benefit over service bus </span><a href="http://bradleyboveinis.com/2013/03/26/nservicebusmsmq-vs-rabbitmq-multinode-architecture/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">nservicebusmsmq-vs-rabbitmq</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. Suddenly i found one of old college already post a nice </span><a href="http://moimtechview.blogspot.com/2015/01/rabbitmq-high-availability-clusters-on.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">blog</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> about configuring the cluster with ubuntu machine in windows azure so i’m not going to repeat it just some some tips that may save someone time and documented for myself.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b id="docs-internal-guid-28f9b3ee-1c02-ac83-4665-eb29a454fbfa" style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">As a dot net developer and in my case existing hosting are already in windows. So in any case i cannot avoid windows so i decided to Clustering rabbitmq on windows and linux. Here is some first try experience.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">i’m took windows 8 host machine and debian vmware for configure it. Installation is hassle free in windows and debian just follow the </span><a href="http://www.rabbitmq.com/install-windows.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">documentation</span></a></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> I choose windows installer and you also need to download erlang rabbitmq installer bring you erland download page.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="77px;" src="https://lh4.googleusercontent.com/qA6e_sK-dIyieDZ-NnOTlAvunBirZhhA0rqXfdwmas4og1ilIXurvU4BtdC6oPQyZp4y5oLtUsxQW88r_1siksRGHXDBkTItnOUmisPpPv1GpeE7poQwa2YquScZXWWk" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In case of debian i choose to add APT repository source</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="71px;" src="https://lh3.googleusercontent.com/Vooc6s2YeLI3gKWRYyqo0RTMjyXj4LXXhTJvzX4yFHQ3ReNH2CXvtIwMSYpW2cJQ34gWKn5AfSw2uIzWb2c0n3RPfvuywFEl9sTKu4gE1t9ah7DA2W0dNfGmT2Lvur-v" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">here is need to do for quick reference how</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">add</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: black; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">deb http://www.rabbitmq.com/debian/ testing main</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">nano /etc/apt/sources.list</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">optionally add public key</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-key add rabbitmq-signing-key-public.asc</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apt-get update</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-get install rabbitmq-server</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">quick and simple.</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #eeeeee; color: #333333; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">After enabling rabbitmq_management i just ensure everything running properly</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in windows</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cd C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> rabbitmq-plugins enable rabbitmq_management</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debian</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rabbitmq-plugins enable rabbitmq_management</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">I don’t want to start rabbitmq-server manually each time in debian reboot i’m add it to auto start. below is how</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">update-rc.d -f rabbitmq-server remove</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">update-rc.d -f rabbitmq-server defaults</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apt-get install chkconfig [if not installed already ]</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">chkconfig –list</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">chkconfig rabbitmq-server on</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It’s time to configure the cluster.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">First thing first need to sync erlang cookie. Erlang nodes use a cookie to determine whether they are allowed to communicate with each other for two nodes to be able to communicate they must have the same cookie.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> I’m take debian cookie by following command </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cat /var/lib/rabbitmq/.erlang.cookie</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and replace both C:\Windows\.erlang.cookie and C:\Users\<user name>\.erlang.cookie. Remember to remove read only file attribute before modify with a notepad or any other editor open as administrator. Its better make it read only again.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It is known that rabbitmq is give better performance if the queue do not need to persist in disk. A ram disk node is better in case of performance compare to disk node. If your business do need persistency most of the case it is you can have one or more disk node in a cluster and rest of are ram node. Because state is replicated across all nodes. It is sufficient (but not recommended) to have just one disk node within a cluster as per</span><span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><a href="https://www.rabbitmq.com/clustering.html" style="text-decoration: none;"><span style="background-color: white; color: #1155cc; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">documentation</span></a><span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">So i decided to make windows 7 machine ram and debian disk node. Any time you can check the cluster status by following command</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rabbitmqctl cluster_status</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cluster status of node rabbit@debian ...</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[{nodes,[{disc,[rabbit@debian]}]},</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {running_nodes,[rabbit@debian]},</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {cluster_name,<<"rabbit@debian.debian">>},</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {partitions,[]}]</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in the windows you need to modify the hosts</span><span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> file C:\Windows\System32\drivers\etc\hosts</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10.10.52.130 debian</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">then stop all apps in windows by </span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl st</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">op_app</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and join the cluster node by </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl jo</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in_cluster --ram rabbit@debian</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Clustering node rabbit@windows8 with rabbit@debian ...</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Error: {inconsistent_cluster,"OTP version mismatch: local node is 17.4, remote n</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ode R15B01"}</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and the first gotcha </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">this is tell debian machine and windows machine erlang version mitch match. I’m getting more confirm by checking erlang version</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' –noshell</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">R15B01</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ok lets upgrade</span><span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><a href="https://www.erlang-solutions.com/downloads/download-erlang-otp" style="text-decoration: none;"><span style="background-color: white; color: #1155cc; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">erlang</span></a><span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in debian machine</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.1700000286102274; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">deb http://packages.erlang-solutions.com/debian wheezy contrib</span></div>
<div dir="ltr" style="line-height: 1.1700000286102274; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">wget http://packages.erlang-solutions.com/debian/erlang_solutions.asc</span><span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-key add erlang_solutions.asc</span></div>
<div dir="ltr" style="line-height: 1.1700000286102274; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-get update</span><span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #eeeeee; color: #222222; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo apt-get install erlang</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">fortunately after that the both version become same.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl jo</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in_cluster --ram rabbit@debian</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Clustering node rabbit@windows8 with rabbit@debian …</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">also administrative interface confirm that</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="104px;" src="https://lh3.googleusercontent.com/HJnpvaEPbmqB-8rbjLjHPXjK1mMJH-yKfHMlViMDwwWpu2wPqinBWavy610DGWh53jxoMww1W5tWyGIZ07Aam0LrLZC9PaHSs_cNgRzPunZmEhIPqx67UajX-_hrI9l5" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">after start windows 8 rabbitmq service </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl st</span></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: 'Trebuchet MS'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">art_app</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="119px;" src="https://lh6.googleusercontent.com/c0zta9CRYz21LF8DI67EYNTJHMyFkQbpP1180ca9Bw7RMkZcRuUz7jwXzCQ1zfM3fv0sr64IuHoM6iyD4c2QcTHLnviRVG2ribLmuQuOiL2nGAPatvc-2fSrxu8dsz70" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624px;" /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.35; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #eeeeee; color: #333333; font-family: 'Courier New'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">w00t w00t happy holidays...</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
</div>
nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-87472951366837015902014-10-04T16:59:00.005+06:002014-10-04T16:59:59.663+06:00AngullarJS directive to watch window resize <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" trbidi="on">
<span style="font-family: Arial; font-size: 15px; line-height: 1.15; white-space: pre-wrap;">This is very common requirement you need to adjust size of ui element depending on window size as well as you need to adjust them when window size changed.</span><br />
<span style="font-family: Arial; font-size: 15px; line-height: 1.15; white-space: pre-wrap;"><br /></span>
<span style="font-family: Arial; font-size: 15px; line-height: 1.15; white-space: pre-wrap;">Angularjs has a service called $window actually that is old vanila reference to the browser's window object made for testability reason.</span><br />
<span style="font-family: Arial; font-size: 15px; line-height: 1.15; white-space: pre-wrap;"><br /></span>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To having windowHeight windowWidth bindable from UI you need to write a directive example bellow </span></div>
<span style="font-family: Arial; font-size: 15px; line-height: 1.15; white-space: pre-wrap;"><br /></span>
<div autoresize ng-style="{ height:windowHeight }"><b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can also do some inline calculation</span></div>
<br />
<div autoresize ng-style="{ height: (windowHeight-370)<300?300:windowHeight-370 }"><br />
<br />
Here is the directive code<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-1Mi8zhfwVKvPPEyG8NSin4ApNBdQhKZap69-3WPor5Yi_c-u6o1NAVzN5GuJ6xgXVl3yJNq2OotF0BNvPpIUUTVSVdEEFuVpDp4cLraTeWsgo1C8FZroRE_bpQjYfTiDKvl4E8BMpvaz/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"> var app = angular.module('App', []); </pre>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-1Mi8zhfwVKvPPEyG8NSin4ApNBdQhKZap69-3WPor5Yi_c-u6o1NAVzN5GuJ6xgXVl3yJNq2OotF0BNvPpIUUTVSVdEEFuVpDp4cLraTeWsgo1C8FZroRE_bpQjYfTiDKvl4E8BMpvaz/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> app.controller('MainCtrl', function($scope) {});
app.directive('autoresize', function($window) {
return function($scope) {
$scope.initializeWindowSize = function() {
$scope.maxHeight = Math.max(
document.body.scrollHeight, document.documentElement.scrollHeight,
document.body.offsetHeight, document.documentElement.offsetHeight,
document.body.clientHeight, document.documentElement.clientHeight,
window.innerHeight
);
$scope.windowHeight = $window.innerHeight;
return $scope.windowWidth = $window.innerWidth;
};
$scope.initializeWindowSize();
$scope.$watch('__height', function(newHeight, oldHeight) {
$scope.initializeWindowSize();
});
return angular.element($window).bind('resize', function() {
$scope.initializeWindowSize();
return $scope.$apply();
});
};
});
</code></pre>
<br />
After adding this directive autoresize as attribute from anywhere windowHeight and windowWidth is bindable.<br />
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> window.maxHeight: {{maxHeight}} </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> window.windowHeight: {{windowHeight}} </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> window.windowWidth: {{windowWidth}}</span></div>
<span id="docs-internal-guid-9459e1a2-daaf-c1ca-0db0-dcf14d92215a"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></span></div>
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="font-family: Arial; font-size: 15px; line-height: 17.25px; white-space: pre-wrap;">windowHeight variable store the viewport height and </span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; font-family: arial; font-size: 12px; line-height: 20px;">maxHeight </span><span style="font-family: Arial; font-size: 15px; line-height: 17.25px; white-space: pre-wrap;">variable </span><span style="font-family: Arial;"><span style="font-size: 15px; line-height: 17.25px; white-space: pre-wrap;">store the height of actual height the document take sometime need for some UI tricks.</span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; line-height: 17.25px; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Arial;"><span style="font-size: 15px; line-height: 17.25px; white-space: pre-wrap;">Here is the demo in <a href="http://plnkr.co/edit/WF3Kl7?p=preview" target="_blank">Plunker</a><br /> </span></span></div>
nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-32712253785575015932014-08-18T06:33:00.000+06:002014-08-18T13:02:54.913+06:00What’s happening inside a developer cave?<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">“Developer cave” i’m derive the concept from “</span><a href="http://en.wikipedia.org/wiki/Man_cave" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">man cave</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">” but i mean mental cave rather physical one. If you are a developer like me you may spend more than 12 hours a day just front of computer and after press CTRL+L you just lock your pc and entering your cave. Just away from pc your mind doesn't stop thinking about what you was doing… most probably when you are traveling to home you start touching your mobile phone. If you are a team lead or project manager you may review </span><a href="https://play.google.com/store/apps/details?id=com.trello&hl=en" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">trello</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> or </span><a href="https://play.google.com/store/apps/details?id=eu.wtfsoft.android.jira&hl=en" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">jira</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> client. If you are tired enough to close your eye you may start thinking the pending decisions or problem you are stuck on. </span></div>
<b id="docs-internal-guid-752ca516-e67e-655c-2fdc-663e1bfcd614" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you still continue reading i’m now talking about my cave most probably you will find some similarity. As i’m working in a firm mostly all software build on Microsoft .net technology my mind is a bit bias on it. To ride of </span><a href="http://en.wikipedia.org/wiki/List_of_cognitive_biases" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">cognitive biases</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and to be rational i always depends on some YouTube channels[</span><span style="color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"><a href="https://www.youtube.com/channel/UCFLCAm7HCyw6DEY9jvOMTvA" style="text-decoration: none;">1</a>,</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">] and some course on psychology classes in </span><a href="https://www.coursera.org/" style="line-height: 1.15; text-decoration: none;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">coursera</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">. One of my favorite course in psychology is .</span><a href="https://www.coursera.org/course/behavioralecon" style="line-height: 1.15; text-decoration: none;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"> A Beginner's Guide to Irrational Behavior</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> and i’m waiting for an upcoming course </span><a href="https://www.coursera.org/course/thinkagain" style="line-height: 1.15; text-decoration: none;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Think Again: How to Reason and Argue</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Keep updated myself is an endless race. After GoogleReader died i’m move to </span><a href="https://cloud.feedly.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">feedly</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> .Feed reader help me to not miss anything even i’m being busy couple of weeks. Yes, i cannot follow always what happens in </span><a href="https://twitter.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">twitter </span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> but after getting </span><a href="https://flipboard.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">flipboard</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> mobile apps i sometime do some window shopping in twitter. With help of flipboard i created some flipboard magazine one of them is </span><a href="https://flipboard.com/section/orbitaxread-bUSiMS" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">orbitaxread</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> mostly for developers and </span><a href="http://flip.it/BUUKX" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Shark In A Jar</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> for mainly some reading about infosec. With help of following people with rss and open source knowledge source </span><a href="https://www.coursera.org/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">coursera</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and paid source </span><a href="http://www.pluralsight.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">pluralsight</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and obviously google help me to take decisions comparing and choose between technology.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In my cave i’m always keep watching potential framework,library open source projects even only few of them may be i’m working with current project. For example i’m end up choosing </span><a href="https://angularjs.org/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">angularjs</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> as client side javascript framework but i’m not stop watching </span><a href="http://knockoutjs.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">knockoutjs</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> , </span><a href="http://durandaljs.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">durandaljs</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><a href="http://backbonejs.org/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">backbonejs</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><a href="http://emberjs.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Ember.js</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. Well, my point here is not telling you and angularjs is better than all or compare between them. Inside a developer or architect cave even they already decided something to go with by the time the watch list goes </span><a href="http://en.wikipedia.org/wiki/List_of_JavaScript_libraries" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">bigger</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and </span><a href="http://www.jsdb.io/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">bigger</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You may think picking some library or framework is become very difficult because of lots parallel implementation but in real life it's become narrower when other factor comes like legacy projects existing architecture, team knowledge even servers you already brought, more weirdly your boss is freaky. If your company has a legacy five or six years old project you may not change it overnight with your favorite cutting edge technology but if you still write lots code to cloning an object by using </span><a href="https://github.com/AutoMapper/AutoMapper" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">automapper</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> you may save a lots and its a single step may be safe a move.</span></div>
<br />
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now, </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">“Developer cave”!!! a developer self talk in his mind when he is not front of any devices( pc,tab,mobile). What’s are those thoughts, depending on age, situations other personal facts. In my case i’m feeling guilty!!! well the checklist is long. Not today!.</span></div>
</div>
nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-78738520120802624572014-01-10T16:36:00.000+06:002014-01-10T16:37:53.904+06:00Recursively Minify JavaScript and CSS folder with Yahoo Yui Compressor MsBuild a quick hack<p>Yahoo! UI Library's YUI Compressor was a java project but you will found a .NET port of the this project <a href="http://yuicompressor.codeplex.com/" target="_blank">here</a>.</p> <p>NuGet package and nice documentation all are available <a href="http://yuicompressor.codeplex.com/" target="_blank">here</a> but after a quick check I found its better to use by quick hack.</p> <p>Create a quick mvc project and install it from package manager console .</p> <p><img src="http://i.imgur.com/aqKIj.png" width="443" height="50"></p> <p>Collect three dll(s) </p> <ul> <li>Yahoo.Yui.Compressor.Build.MsBuild.dll (packages\YUICompressor.NET.MSBuild.2.3.0.0\lib) <li>Yahoo.Yui.Compressor.dll (packages\YUICompressor.NET.MSBuild.2.3.0.0\lib) <li>EcmaScript.NET.dll (packages\EcmaScript.Net.1.0.1.0\lib\net20)</li></ul> <p>Now you need to modify or create a “MSBuild.proj” xml file. A sample file will be found under </p> <p>“packages\YUICompressor.NET.MSBuild.2.3.0.0\Samples\YUICompressor\MSBuild.proj”</p> <p>Include a recessive folder in MS build syntax is</p> <p><span class="kwrd"><</span><span class="html">JavaScriptFiles</span> <span class="attr">Include</span><span class="kwrd">="Scripts\**\*.js"</span><span class="kwrd">/></span> </p> <p>to output in relative path use <span class="attr">OutputFile</span><span class="kwrd">="%(RelativeDir)%(JavaScriptFiles.Filename).min.js in <span class="html">JavaScriptCompressorTask</span></span></p> <p><span class="kwrd"><span class="html">here is my final “MSBuild.proj” file </span></span></p><pre class="csharpcode"><span class="kwrd"><?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">="1.0"</span> <span class="attr">encoding</span><span class="kwrd">="utf-8"</span>?<span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">Project</span> <span class="attr">xmlns</span><span class="kwrd">="http://schemas.microsoft.com/developer/MsBuild/2003"</span><span class="kwrd">></span><br /><br /> <span class="kwrd"><</span><span class="html">UsingTask</span> <span class="attr">TaskName</span><span class="kwrd">="CssCompressorTask"</span> <span class="attr">AssemblyFile</span><span class="kwrd">="Yahoo.Yui.Compressor.Build.MsBuild.dll"</span> <span class="kwrd">/></span><br /> <span class="kwrd"><</span><span class="html">UsingTask</span> <span class="attr">TaskName</span><span class="kwrd">="JavaScriptCompressorTask"</span> <span class="attr">AssemblyFile</span><span class="kwrd">="Yahoo.Yui.Compressor.Build.MsBuild.dll"</span> <span class="kwrd">/></span> <br /><br /> <span class="kwrd"><</span><span class="html">Target</span> <span class="attr">Name</span><span class="kwrd">="Minify"</span><span class="kwrd">></span> <br /> <span class="kwrd"><</span><span class="html">ItemGroup</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">JavaScriptFiles</span> <span class="attr">Include</span><span class="kwrd">="Scripts\**\*.js"</span><span class="kwrd">/></span><br /> <span class="kwrd"></</span><span class="html">ItemGroup</span><span class="kwrd">></span><br /><br /> <span class="kwrd"><</span><span class="html">JavaScriptCompressorTask</span><br /> <span class="attr">DeleteSourceFiles</span><span class="kwrd">="false"</span><br /> <span class="attr">CompressionType</span><span class="kwrd">="Standard"</span><br /> <span class="attr">ObfuscateJavaScript</span><span class="kwrd">="false"</span><br /> <span class="attr">PreserveAllSemicolons</span><span class="kwrd">="False"</span><br /> <span class="attr">DisableOptimizations</span><span class="kwrd">="No"</span><br /> <span class="attr">EncodingType</span><span class="kwrd">="Default"</span><br /> <span class="attr">LineBreakPosition</span><span class="kwrd">="-1"</span><br /> <span class="attr">LoggingType</span><span class="kwrd">="Info"</span><br /> <span class="attr">ThreadCulture</span><span class="kwrd">="en-au"</span><br /> <span class="attr">IsEvalIgnored</span><span class="kwrd">="false"</span><br /> <span class="attr">SourceFiles</span><span class="kwrd">="@(JavaScriptFiles)"</span><br /> <span class="attr">OutputFile</span><span class="kwrd">="%(RelativeDir)%(JavaScriptFiles.Filename).min.js"</span> <span class="kwrd">/></span> <br /> <br /> <span class="kwrd"></</span><span class="html">Target</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">Project</span><span class="kwrd">></span></pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p>I copied all dll and script in a temporary directory so I do not have to worry all relative path location and other hassle.</p><br /><p><a href="http://lh6.ggpht.com/-v22_sha4Fcs/Us_NWrMcFTI/AAAAAAAAPL4/lS8i-ak0j-I/s1600-h/image%25255B2%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://lh5.ggpht.com/-Wp01Hk0UjsA/Us_NYNd5SVI/AAAAAAAAPMA/Nhp5CeMHCPM/image_thumb.png?imgmax=800" width="244" height="147"></a></p><br /><p>now open Developer Command Prompt and navigate to your directory and type “msbuild” </p><br /><p><a href="http://lh5.ggpht.com/-wC9HvwgArRY/Us_NcV9kV2I/AAAAAAAAPMI/q8XO3LRexDg/s1600-h/image%25255B6%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://lh4.ggpht.com/-vFzCLy6w9kw/Us_NfkIKNVI/AAAAAAAAPMQ/xL7v5nKEXng/image_thumb%25255B2%25255D.png?imgmax=800" width="565" height="130"></a> Bingo you have all minified js with *.mim.js recursively.</p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-86877128933965739082014-01-10T15:29:00.000+06:002014-01-10T15:31:58.188+06:00Turn on/off $log in AngularJS completely<div dir="ltr" style="text-align: left;" trbidi="on">
We have $logProvider.debugEnabled(true) to stop logging from AngularJs 1.1.2 or later. However this is only stopped logging used by $log.debug(‘happy log’) but we use other method like $log.info(‘this is from log info’), $log.warn etc. $logProvider.debugEnabled(true) not going to stop those log. Here is the code snipped you can stop those <br />
<pre class="csharpcode"><span class="rem">//in production this should be true</span>
<span class="kwrd">if</span> (config.isProduction) {
$logProvider.debugEnabled(<span class="kwrd">true</span>);
$provide.decorator(<span class="str">'$log'</span>, [<span class="str">'$delegate'</span>, <span class="kwrd">function</span> ($<span class="kwrd">delegate</span>) {
$<span class="kwrd">delegate</span>.table = angular.noop;
<span class="kwrd">return</span> $<span class="kwrd">delegate</span>;
}]);
$provide.decorator(<span class="str">'$log'</span>, [<span class="str">'$delegate'</span>, <span class="kwrd">function</span> ($<span class="kwrd">delegate</span>) {
$<span class="kwrd">delegate</span>.info = angular.noop;
<span class="kwrd">return</span> $<span class="kwrd">delegate</span>;
}]);
$provide.decorator(<span class="str">'$log'</span>, [<span class="str">'$delegate'</span>, <span class="kwrd">function</span> ($<span class="kwrd">delegate</span>) {
$<span class="kwrd">delegate</span>.warn = angular.noop;
<span class="kwrd">return</span> $<span class="kwrd">delegate</span>;
}]);
$provide.decorator(<span class="str">'$log'</span>, [<span class="str">'$delegate'</span>, <span class="kwrd">function</span> ($<span class="kwrd">delegate</span>) {
$<span class="kwrd">delegate</span>.error = angular.noop;
<span class="kwrd">return</span> $<span class="kwrd">delegate</span>;
}]);
}</pre>
<br />
How this will work? AngularJs give nice capability to extend it many way $provide.decorator can extends or override a implementation. The code snipped in basically override the internal implementation with a angular.noop which mean do nothing.<br />
<br />
You can also extends $log to get new console.table supported by chrome following way<br />
<pre class="csharpcode">$provide.decorator(<span class="str">'$log'</span>, [<span class="str">"$delegate"</span>, <span class="kwrd">function</span> ($<span class="kwrd">delegate</span>) {
$<span class="kwrd">delegate</span>.table = <span class="kwrd">function</span> () {
console.table(arguments);
};
<span class="kwrd">return</span> $<span class="kwrd">delegate</span>;
}]);</pre>
<br />
now you will have $log.table() all over the module and output is really more friendly working with a tabular data.<br />
<br />
<a href="http://lh6.ggpht.com/-fGn1mkL40NY/Us-82-b3eSI/AAAAAAAAPLg/BBhBjTOEBFc/s1600-h/table%25255B3%25255D.png"><img alt="table" border="0" src="http://lh5.ggpht.com/-jhddKp2QuoE/Us-84MPdcuI/AAAAAAAAPLo/8GyyxKNyrMA/table_thumb%25255B1%25255D.png?imgmax=800" height="50" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="table" width="525" /></a><br />
<br />
Happy $logging. </div>
nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-62318466615981770622011-09-30T21:50:00.001+06:002011-10-01T14:48:01.728+06:00OWASP’s herd of goat<p>Sorry for weird funny title. Every security folks know about OWASP <a href="https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project" target="_blank">Web goat</a> project, one most successful project of OWASP.</p> <p><b>WebGoat</b> is a deliberately insecure J2EE web application maintained by <a href="http://www.owasp.org">OWASP</a> designed to teach web application security lessons. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat application. </p> <p><a href="http://lh5.ggpht.com/-p0FUBzXFzgE/ToXk5uqNtLI/AAAAAAAACIw/ZdvcyJzFMqI/s1600-h/image%25255B10%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-Ihwmu61Jurs/ToXlDI86UHI/AAAAAAAACI0/oQIc8lUiocM/image_thumb%25255B6%25255D.png?imgmax=800" width="564" height="492"></a> </p> <p>Just copy following quote from OWASP wiki why the name is WebGoat.</p> <blockquote> <p>Why the name "WebGoat"? Developers should not feel bad about not knowing security. Even the best programmers make security errors. What they need is a scapegoat, right? <i>Just blame it on the 'Goat</i>! </p></blockquote> <p>But there are also other OWASP goat(s) project available less people know about them.</p> <p><u>OWASP .NET Goat</u></p> <p>One of them is OWASP .NET Goat. Will be found is <a href="http://owasp.codeplex.com/" target="_blank">Codeplex</a>.OWASP .NET Goat is a webgoat style security learning application written in C#.</p> <p><a href="http://lh6.ggpht.com/--CP5TKgrurY/ToXlI2QldOI/AAAAAAAACI4/sumUa1W_ChM/s1600-h/image%25255B11%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-Y7JtQLKDT80/ToXlQMtAcbI/AAAAAAAACI8/GoGZ8vdQ_Ek/image_thumb%25255B7%25255D.png?imgmax=800" width="564" height="816"></a></p> <p>And another Goat join recently is <a href="https://www.owasp.org/index.php/Projects/OWASP_GoatDroid_Project" target="_blank">GoatDroid</a>. owasp-goatdroid is also open source goat found in <a href="http://code.google.com/p/owasp-goatdroid/" target="_blank">here</a> is a a fully functional training environment for exploring Android mobile application security.</p> <p><a href="http://lh5.ggpht.com/-9-gfvXmGE3g/ToXlTQMGNUI/AAAAAAAACJA/nyJQbueYVXA/s1600-h/image%25255B14%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-3Jb_KICeX8M/ToXlVEf0YAI/AAAAAAAACJE/Yf3CKVQDGJg/image_thumb%25255B8%25255D.png?imgmax=800" width="244" height="231"></a> </p> <p>Well what about iPhone, Yes OWASP <a href="http://code.google.com/p/owasp-igoat/" target="_blank">owasp-igoat</a> is for apple iPhone.This OWASP iGoat project is a security learning tool for iOS developers to learn about security weaknesses in iOS -- by breaking things as well as fixing them. </p> <p><a href="http://lh3.ggpht.com/-DniZmPrw2V0/TobTryHZB8I/AAAAAAAACJI/SkTpFyBB6VY/s1600-h/image%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-UYkjoWht0YE/TobTvKHIiVI/AAAAAAAACJM/t_z6GRdLS2E/image_thumb%25255B1%25255D.png?imgmax=800" width="119" height="129"></a></p> <p>OWASP-iGoat project <a href="https://www.owasp.org/index.php/OWASP_iGoat_Project" target="_blank">home</a>.</p> <p>Happy learning… if anyone know other goat please write on comment.</p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-79134481586530778032011-09-27T21:58:00.001+06:002011-09-27T22:05:20.397+06:00Web Application Analysis With Owasp Hatkit<p>Yet another proxy to analyses web application. We already have WebScarab,burp,paros,ratproxy,OWASP zap proxy,fiddler so many now another one OWASP Hatkit which is released in defcon 19. The main feature that may capture your attention is it has a database to store all recoded data that’s helps further analysis. Hatkit use MongoDB where parse data store in as JSON document. So you can use MongoDB advanced querying facilities and even can use other tools to view and analyze data.</p> <p>Now how do you configure it in your favorite backtrack, I’m try it in backtrack5r1. First you need to install MongoDB . if you install synaptic you should found MongoDB by search in default repo. obviously there should other way to do it but I’m take simplex options. </p> <p>Or just $sudo apt-get install mongodb</p> <p>Next download Hatkit it self from from <a href="https://bitbucket.org/holiman/hatkit-datafiddler/downloads" target="_blank">here</a>. direct link <a href="https://bitbucket.org/holiman/hatkit-proxy/downloads/hatkit_proxy-0.6.1.zip" target="_blank">hatkit_proxy-0.6.1.zip</a> </p> <p>just extract it in /opt <br>#ls<br>#hatkit_proxy.jar hatkit_proxy.sh lib LICENSE.txt processors README<br>#java -jar hatkit_proxy.jar</p> <p><a href="http://lh3.ggpht.com/-Te9Vx6CJWnw/ToHyWDc1bhI/AAAAAAAACIY/hu2y3VHXxPw/s1600-h/image9.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-4JtPnghrLoQ/ToHyasRP7EI/AAAAAAAACIc/HAuU1VBmRt8/image_thumb5.png?imgmax=800" width="356" height="502"></a></p> <p>hatkit has web scrapper converter you need to locate its install path </p> <p><a href="http://lh4.ggpht.com/-5zmZ1-j2hNM/ToHycaLVV1I/AAAAAAAACIg/0zMXLAcNVBs/s1600-h/image4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-HE0dGp1m3-c/ToHyfmSIAkI/AAAAAAAACIk/Zfec9a7BDPk/image_thumb2.png?imgmax=800" width="358" height="512"></a></p> <p>Well so to analyze data there is another project available Owasp Hatkit Datafiddler project. So with help of this is a tool basically you do performing data analysis of data in a MongoDB, particularly Http traffic.</p> <p>This tool can be download from <a href="https://bitbucket.org/holiman/hatkit-datafiddler/downloads" target="_blank">here</a>, Direct link <a href="https://bitbucket.org/holiman/hatkit-datafiddler/downloads/hatkit_datafiddler-0.6.0.zip" target="_blank">hatkit_datafiddler-0.6.0.zip</a>.</p> <p>$ unzip hatkit_datafiddler-0.6.0.zip <br>$ cd hatkit_datafiddler-0.6.0/<br>$ python datafiddler.py</p> <p>you may got dependency error of python mongoDB if you are not install it before</p><pre>pymongo : Python drivers for MongoDB</pre>there are different way of installing pymongo but I did install it from source.Installing pymongo python driver for mongodb from source is easy <pre>git clone <a href="https://github.com/mongodb/mongo-python-driver.git">https://github.com/mongodb/mongo-python-driver.git</a></pre><pre>python setup.py install</pre><pre>$ python datafiddler.py</pre><br /><p><a href="http://lh6.ggpht.com/-sukWsvhCg6A/ToHyhUHPjeI/AAAAAAAACIo/JLlt_KQPC9Q/s1600-h/image%25255B4%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-428ElGL-wNk/ToHyj8Zbi3I/AAAAAAAACIs/Petl0X1sKn4/image_thumb%25255B1%25255D.png?imgmax=800" width="354" height="431"></a></p><br /><p>My first look feeling is still this tool need some UI improvement and need to a bit user friendly. I will try to update this post after more work with this tool. And hope this tool will keep updated.</p><br /><p>More info: defcon conference slide <a href="https://www.defcon.org/images/defcon-19/dc-19-presentations/Swende-Karlsson/DEFCON-19-Swende-Karlsson-Owasp-Hatkit.pdf" target="_blank">here</a>. OWASP project home <a href="https://www.owasp.org/index.php/OWASP_Hatkit_Proxy_Project" target="_blank">here</a></p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-56443404060472662802011-09-09T12:30:00.001+06:002011-09-09T12:30:58.482+06:00registrydecoder<p>Registry Decoder provides a single tool in which to perform browsing, searching, analysis, and reporting of registry hive contents. All functionality is exposed through an intuitive GUI interface and accommodates even novice investigators. </p> <p>Download <a title="http://code.google.com/p/registrydecoder/downloads/list" href="http://code.google.com/p/registrydecoder/downloads/list">http://code.google.com/p/registrydecoder/downloads/list</a></p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-35138502744525541492011-09-09T12:27:00.001+06:002011-09-09T12:27:17.759+06:00SWFREtools<p>The SWFRETools are a collection of tools built for vulnerability analysis of the Adobe Flash player and for malware analysis of malicious SWF files.</p> <p>Current version is SWFRETools v1.4.0</p> <p>Download <a title="https://github.com/sporst/SWFREtools/downloads" href="https://github.com/sporst/SWFREtools/downloads">https://github.com/sporst/SWFREtools/downloads</a></p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-6962933160895900422011-09-09T11:51:00.001+06:002011-09-09T11:51:29.311+06:00Pentest cheat sheet bookmark<ul> <li><a href="http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+pentestmonkey+%28pentestmonkey.net+RSS+Feed%29">Reverse Shell Cheat Sheet</a> <li>Namp cheat sheet <ul> <li><a title="http://nmapcookbook.blogspot.com/2010/02/nmap-cheat-sheet.html" href="http://nmapcookbook.blogspot.com/2010/02/nmap-cheat-sheet.html">http://nmapcookbook.blogspot.com/2010/02/nmap-cheat-sheet.html</a> <li><a title="http://sbdtools.googlecode.com/files/Nmap5%20cheatsheet%20eng%20v1.pdf" href="http://sbdtools.googlecode.com/files/Nmap5%20cheatsheet%20eng%20v1.pdf">http://sbdtools.googlecode.com/files/Nmap5%20cheatsheet%20eng%20v1.pdf</a></li></ul> <li>Nessus cheat sheet <ul> <li><a title="http://www.infosecwriters.com/text_resources/pdf/nessusNMAPcheatSheet.pdf" href="http://www.infosecwriters.com/text_resources/pdf/nessusNMAPcheatSheet.pdf">http://www.infosecwriters.com/text_resources/pdf/nessusNMAPcheatSheet.pdf</a></li></ul> <li>Backtrack <ul> <li><a title="http://www.corelan.be/index.php/2009/07/04/backtrack-4-cheat-sheet/" href="http://www.corelan.be/index.php/2009/07/04/backtrack-4-cheat-sheet/">http://www.corelan.be/index.php/2009/07/04/backtrack-4-cheat-sheet/</a></li></ul> <li>Oracle Security <ul> <li><a href="http://www.red-database-security.com/wp/oracle_cheat.pdf">http://www.red-database-security.com/wp/oracle_cheat.pdf</a></li></ul> <li>XSS <ul> <li><a href="http://ha.ckers.org/xss.html">http://ha.ckers.org/xss.html</a> <li><a href="http://openmya.hacker.jp/hasegawa/security/utf7cs.html">http://openmya.hacker.jp/hasegawa/security/utf7cs.html</a> <li><a href="http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet</a></li></ul> <li>SSH cheat shhet <ul> <li><a title="http://pentestmonkey.net/cheat-sheet/ssh-cheat-sheet" href="http://pentestmonkey.net/cheat-sheet/ssh-cheat-sheet">http://pentestmonkey.net/cheat-sheet/ssh-cheat-sheet</a></li></ul> <li>SQl Injection <ul> <li><a href="http://ha.ckers.org/sqlinjection/">http://ha.ckers.org/sqlinjection/</a> <li><a href="http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/">http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/</a> <li><a href="http://ferruh.mavituna.com/oracle-sql-injection-cheat-sheet-oku/">http://ferruh.mavituna.com/oracle-sql-injection-cheat-sheet-oku/</a> <li><a href="http://www.irongeek.com/xss-sql-injection-fuzzing-barcode-generator.php">http://www.irongeek.com/xss-sql-injection-fuzzing-barcode-generator.php</a></li></ul> <li>Unix cheat sheet <ul> <li><a title="http://bhami.com/rosetta.html" href="http://bhami.com/rosetta.html">http://bhami.com/rosetta.html</a></li></ul> <li>Microsoft SQL,Sybase,MySQL,Oracle,PostgreSQL,DB2,IngresBypass SQL Injection Filters <ul> <li><a href="http://michaeldaw.org/sql-injection-cheat-sheet">http://michaeldaw.org/sql-injection-cheat-sheet</a> <li><a href="http://pentestmonkey.net/cheat-sheets/">http://pentestmonkey.net/cheat-sheets/</a></li></ul> <li>Packetlife Cheatsheets <ul> <li><a href="http://packetlife.net/cheatsheets/">http://packetlife.net/cheatsheets/</a></li></ul> <li>Windows command line tools <ul> <li><a href="http://www.sans.org/resources/sec560/windows_command_line_sheet_v1.pdf">http://www.sans.org/resources/sec560/windows_command_line_sheet_v1.pdf</a></li></ul> <li>Netcat Cheat Sheet <ul> <li><a href="http://www.sans.org/resources/sec560/netcat_cheat_sheet_v1.pdf">http://www.sans.org/resources/sec560/netcat_cheat_sheet_v1.pdf</a></li></ul> <li>Useful Attack Tools, Metasploit commands, HPing, FGDump <ul> <li><a href="http://www.sans.org/resources/sec560/misc_tools_sheet_v1.pdf">http://www.sans.org/resources/sec560/misc_tools_sheet_v1.pdf</a></li></ul> <li>Reverse Engineering Malware Cheat Sheet <ul> <li><a href="http://zeltser.com/reverse-malware/reverse-malware-cheat-sheet.html">http://zeltser.com/reverse-malware/reverse-malware-cheat-sheet.html</a></li></ul></li></ul> <p><strong>Original sources and other sources</strong></p> <ul> <li><a title="http://www.cheat-sheets.org/" href="http://www.cheat-sheets.org/">http://www.cheat-sheets.org/</a> <li><a title="http://media.packetlife.net/media/library/Cheat%20Sheets%20-%20Packet%20Life.zip" href="http://media.packetlife.net/media/library/Cheat%20Sheets%20-%20Packet%20Life.zip">http://media.packetlife.net/media/library/Cheat%20Sheets%20-%20Packet%20Life.zip</a> <li><a title="http://h.ackack.net/cheatsheets/netcat" href="http://h.ackack.net/cheatsheets/netcat">http://h.ackack.net/cheatsheets/netcat</a> <li><a title="http://punter-infosec.com/cheat-sheets-for-pentesters" href="http://punter-infosec.com/cheat-sheets-for-pentesters">http://punter-infosec.com/cheat-sheets-for-pentesters</a> <li><a title="http://code.google.com/p/pentest-bookmarks/wiki/BookmarksList" href="http://code.google.com/p/pentest-bookmarks/wiki/BookmarksList">http://code.google.com/p/pentest-bookmarks/wiki/BookmarksList</a></li></ul> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-71426919853401198292011-09-09T10:58:00.001+06:002011-09-09T10:58:28.586+06:00Bookmarked RSS items- until 8/9/2011<p>Last few month RSS bookmark before forget forever- its for me but somebody else may find some thing interesting also.</p> <blockquote></blockquote> <p><a href="http://isc.sans.edu/diary.html?storyid=11383&rss"><strong><font color="#000000">Vulnerabilities</font></strong></a></p> <h4></h4> <ul> <li><a href="http://isc.sans.edu/diary.html?storyid=11383&rss">Firefox 3.6.20 Corrects Several Critical Vulnerabilities, (Tue, Aug 16th)</a> via <a href="http://isc.sans.edu">SANS Internet Storm Center, InfoCON: green</a> on 8/16/11 <li><a href="http://seclists.org/fulldisclosure/2011/Aug/73">ZDI-11-251: Apple QuickTime STSS atom Parsing Remote Code Execution Vulnerability</a> via <a href="http://seclists.org/#fulldisclosure">Full Disclosure</a> on 8/9/11 <li><a href="http://seclists.org/fulldisclosure/2011/Aug/158">Skype (<= 5.5.0.113, Windows) html/js code injection vulnerability</a> via <a href="http://seclists.org/#fulldisclosure">Full Disclosure</a> on 8/17/11 <li><a href="http://feedproxy.google.com/%7Er/ComputerInformationSecurityBlog/%7E3/XYbur3mBxZM/dropbox-for-android-vulnerability.html">Dropbox for Android Vulnerability Breakdown</a> via <a href="http://r00tsec.blogspot.com/">Computer Security Blog | Learning The Offensive Security</a> by noreply@blogger.com (Medt) on 8/19/11 <li><a href="http://feedproxy.google.com/%7Er/nakedsecurity/%7E3/l1r9ebCUA-w/">Apache exploit leaves up to 65% of all websites vulnerable</a> via <a href="http://nakedsecurity.sophos.com">Naked Security - Sophos</a> by Mark Stockley on 8/26/11</li></ul> <p><strong>Learn,see, check, think and forgot</strong></p> <h4></h4> <ul> <li><a href="http://www.labnol.org/software/add-speech-recognition-to-website/19989/">How to Add Speech Recognition to your Website</a> via <a href="http://www.labnol.org">Digital Inspiration Technology Blog</a> by Amit on 8/16/11 <li><a href="http://feedproxy.google.com/%7Er/aldeidnews/%7E3/1cxK5YmDhSo/An-interesting-forensics-analysis">An-interesting-forensics-analysis</a> via <a href="http://www.aldeid.com">Aldeid News</a> on 8/9/11 <li><a href="http://feeds.gawker.com/%7Er/lifehacker/full/%7E3/DHbfPIgOSkU/sneak-in-these-simple-exercises-at-the-office-to-stay-healthy">Sneak in These Simple Exercises at the Office to Stay Healthy [Health]</a> via <a href="http://lifehacker.com">Lifehacker</a> by Melanie Pinola on 8/25/11 <li><a href="http://www.terminal23.net/2011/08/aaron_barr_defcon_and_anonymit.html">aaron barr, defcon, and anonymity</a> via <a href="http://www.terminal23.net/">terminal23</a> by michael on 9/7/11 <li><a href="http://www.malwarecity.com/blog/3-reasons-why-computer-security-fails-1122.html">3 Reasons Why Computer Security Fails</a> via <a href="http://www.malwarecity.com">MalwareCity Blog</a> by WebMaster (news@malwarecity.com) on 8/26/11 <li><a href="http://feeds.gawker.com/%7Er/lifehacker/full/%7E3/T1W31T4RoXg/how-can-i-make-the-windows-command-prompt-better">How Can I Make the Windows Command Prompt Better? [Ask Lifehacker]</a> via <a href="http://lifehacker.com">Lifehacker</a> by Whitson Gordon on 8/26/11 <li><a href="http://blog.ncircle.com/blogs/High-Performance-Security/2011/09/when_is_offense_the_best_defen_1.html">When is Offense the Best Defense?</a> via <a href="http://blog.ncircle.com/">360 Security</a> by John Alexander on 9/7/11 <h4> </h4></li></ul> <p><strong>Book review</strong></p> <h4></h4> <ul> <li><a href="http://www.hexblog.com/?p=363">Book review: IDA Pro Book, 2nd Edition</a> via <a href="http://www.hexblog.com">Hex Blog</a> by Elias Bachaalany on 8/3/11 <li><a href="http://xorl.wordpress.com/2011/08/28/book-puzzles-for-programmers-and-pros/">Book: Puzzles for Programmers and Pros</a> via <a href="http://xorl.wordpress.com">xorl %eax, %eax</a> by xorl on 8/27/11</li></ul> <p><strong>Discover</strong></p> <ul> <li><a href="http://blogs.technet.com/b/mmpc/archive/2011/08/10/can-we-believe-our-eyes.aspx">Can we believe our eyes?</a> by msft-mmpc on 8/10/11 This is about how a Trojan that hijack the hosts by modify hosts file with some Unicode technique .</li></ul> <p><strong>Tools</strong></p> <h4></h4> <ul> <li><a href="http://feedproxy.google.com/%7Er/security-shell/%7E3/7amg0gyw5GA/ldap-xpath-injection-tools.html">LDAP & XPATH Injection tools</a> via <a href="http://security-sh3ll.blogspot.com/">Security-Shell</a> by noreply@blogger.com (d3v1l) on 8/16/11 <li><a href="http://blog.tenablesecurity.com/2011/08/integrating-nessus-with-backtrack-5s-tools.html">Integrating Nessus with BackTrack 5's Tools</a> via <a href="http://blog.tenablesecurity.com/">Tenable Network Security</a> by Paul Asadoorian on 8/3/11 <li><a href="http://feedproxy.google.com/%7Er/ehacking/%7E3/ONEk4z0uv7k/advance-sql-injection-tool-havij.html">Advance SQL Injection Tool – Havij</a> via <a href="http://www.ehacking.net/">Ethical Hacking-Your Way To The World Of IT Security</a> by noreply@blogger.com (Ethical Hacking) on 8/9/11 <li><a href="http://feedproxy.google.com/%7Er/security-shell/%7E3/h9QiwgUSMJs/updates-procdump-v40-process-monitor.html">Updates: ProcDump v4.0, Process Monitor v2.96, Process Explorer v15.02,and Zero Day Malware Cleaning</a> via <a href="http://security-sh3ll.blogspot.com/">Security-Shell</a> by noreply@blogger.com (d3v1l) on 8/16/11 <li><a href="http://www.hackpconline.com/2011/07/detect-hidden-trojans-on-your-computer.html">Detect Hidden Trojans on Your Computer</a> via <a href="http://www.hackpconline.com/">Computer Hacking | Learn How To Hack</a> by noreply@blogger.com (Aleksandar) on 7/20/11</li></ul> <p><strong>Trips and trick </strong></p> <ul> <li> <p><a href="http://johnpapa.net/5-easy-tips-to-reduce-and-refactor-your-code-with-resharper">5 Easy Tips to Reduce and Refactor Your Code with Resharper</a> by JohnPapa.net on 10/2/10 – People who can’t write code without Reshaper should know this tips before.</p> <li> <h4></h4> <p><a href="http://feedproxy.google.com/%7Er/ehacking/%7E3/D9FUV8fzPYU/seo-poisoning-attack-what-and-how.html">SEO Poisoning Attack - What and How</a> via <a href="http://www.ehacking.net/">Ethical Hacking-Your Way To The World Of IT Security</a> by noreply@blogger.com (Ethical Hacking) on 8/10/11</p> <li> <h4></h4> <p><a href="http://feedproxy.google.com/%7Er/OmarAlZabirBlog/%7E3/Mt3Hgf39PZ4/">Tweaking WCF to build highly scalable async REST API</a> via <a href="http://omaralzabir.com">Omar AL Zabir on things you don't find easily</a> by Omar AL Zabir on 7/31/11</p></li></ul> <p><strong>News</strong></p> <h4></h4> <ul> <li><a href="http://www.suck-o.com/index.php/the-news/216-windows-8-is-on-the-way-and">Windows 8 is on the way and...</a> via <a href="http://www.suck-o.com/">suck-o.com RSS news feed</a> by bad_brain@suck-o.com (floodhound2) on 8/16/11 <li><a href="http://www.backtrack-linux.org/backtrack/backtrack-5-r1-released/">BackTrack 5 R1 released</a> via <a href="http://www.backtrack-linux.org">BackTrack Linux - Penetration Testing Distribution</a> by admin on 8/18/11 <li><a href="http://feedproxy.google.com/%7Er/MichaelCoates/security/%7E3/oVde9FVrrcA/joining-owasp-board.html">Joining OWASP Board</a> via <a href="http://michael-coates.blogspot.com/">...Application Security...</a> by Michael Coates on 8/18/11 <li><a href="http://owasp.blogspot.com/2011/07/appsec-asia-2011.html">AppSec Asia 2011</a> via <a href="http://owasp.blogspot.com/">Open Web Application Security Project</a> by Jim Manico on 7/20/11 <li><a href="http://feedproxy.google.com/%7Er/Liquidmatrix/%7E3/2QvT975Rezk/">Cyberdouchery of Kasperskian Proportions</a> via <a href="http://www.liquidmatrix.org/blog">Liquidmatrix Security Digest</a> by James Arlen on 7/21/11 <li><a href="http://feedproxy.google.com/%7Er/nakedsecurity/%7E3/CPcBsN-BK7Y/">Falsely issued Google SSL certificate in the wild for more than 5 weeks</a> via <a href="http://nakedsecurity.sophos.com">Naked Security - Sophos</a> by Chester Wisniewski on 8/29/11</li></ul> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-59210761868145217382011-08-29T13:04:00.001+06:002011-08-29T13:37:31.023+06:00Running dradis server in any port and ip address on backtrack 5<p> </p> <p>By default dradis server run on localhost. To run it in any interface following helps available in <a title="http://dradisframework.org/FAQ.html#q4" href="http://dradisframework.org/FAQ.html#q4">http://dradisframework.org/FAQ.html#q4</a>. But its not works for me.</p> <blockquote> <p>By default the server starts in 127.0.0.1:3004. How can I make it listen on a different interface/port number?</p> <p><strong>Port</strong> number can be changed using the <strong>-p</strong> parameter. For instance to listen on port 80: <p>rails server -p 80 </p> <p>The <strong>interface</strong> can be changed using the <strong>-b</strong> parameter. To listen on ALL (dangerous!) interfaces do: <p>rails server -b 0.0.0.0 </p></blockquote> <p>I’m try couple of way and can’t make it work. get following error </p> <p>ruby ./script/rails server -b 0.0.0.0 -p 3004<br>./script/rails:5:in `require': no such file to load -- rails/commands/server (LoadError)<br>from ./script/rails:5:in `<main>'</p> <p>After a long time search internet i found a fix.I’m try </p> <p><code>$./start.sh –h </code></p> <p><code></code><code><font face="Arial">But its not work, then a fixed has been found <a href="http://j.mp/mXCID3">there</a> git hut source.</font></code><code><font face="Arial">You just need to modify </font></code><code><font face="Arial">start.sh following way</font></code></p> <p><code></code>-bundle exec rails server webrick</p> <p>+bundle exec rails server webrick $*</p> <p>After that you have <code>$./start.sh –h cool help.</code> <p><code></code><code><font face="Arial">Just type</font> ./start.sh –b <ip> <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh6.ggpht.com/-2p6Vzf9dQn4/TltBudlt4wI/AAAAAAAACIM/1HO0gfe9aTo/wlEmoticon-smile%25255B2%25255D.png?imgmax=800"> <font face="Arial">will work.</font> </code></p><pre><code><font face="Arial">Hope this save some one time.</font></code></pre> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-13853401278990042011-08-24T20:07:00.001+06:002011-08-24T20:16:55.346+06:00Dradis Server in backtrack 5<p> </p> <p>Dradis is an open source framework that basically design for information sharing when a group of people do vulnerability assessment in a team. </p> <p>In back track 5 it comes by default. But after start the server and you hit the url <a title="https://127.0.0.1:3004/" href="http://127.0.0.1:3004/">http://127.0.0.1:3004/</a> you may got following error. Just switch to https (<a title="https://127.0.0.1:3004/" href="https://127.0.0.1:3004/">https://127.0.0.1:3004/</a>) will solved the problem.</p> <p>ERROR OpenSSL::SSL::SSLError: SSL_accept returned=1 errno=0 state=SSLv2/v3 read client hello A: http request<br> /usr/lib/ruby/1.9.2/openssl/ssl-internal.rb:164:in `accept'</p> <p>It look like following <br><a href="http://lh6.ggpht.com/-OUDi_M_-Ng0/TlUFem_S1tI/AAAAAAAACIA/STDJgDTOanY/s1600-h/image%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-xyJD28WxWpw/TlUFkBg3hdI/AAAAAAAACIE/6AROzHyxdDg/image_thumb%25255B1%25255D.png?imgmax=800" width="539" height="419"></a></p> <p>The recent dradis has built is import feature form a lots well known security tool scan output like nmap,w3af,openvas,burp and many others. Its also has reporting feature.Have a look on it <a title="http://dradisframework.org/" href="http://dradisframework.org/">http://dradisframework.org/</a>.</p> <p>Thought its specially design for security assessment team but any other team like software QA and other people working in a team can use it for effective information sharing.</p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-69668824010019377472011-08-20T14:39:00.002+06:002011-08-20T14:47:33.174+06:00Find out CSRF in your application using OWASP's CSRFTester tool<p> </p> <p>Firstly if you are not familiar with CSRF(Cross site request forgery), in short it’s a attack which force the end user to submit a request to a web application in which he or she already authenticated. For example now a days we are using multiple tabs in our browser, lets say you are login to facebook in one tab and the browser has session that already authenticated and now you are visited a attacker site. The attacker can trick you into loading information from or submitting information to facebook that you are already authenticated.</p> <p>Let me give more example in depth how it work</p> <p>let say Victim logon to bank.com</p> <p><a href="http://lh5.ggpht.com/-fsyy4ficC-s/Tk9xtmEvQmI/AAAAAAAACHA/zNzxheufVOQ/s1600-h/image%25255B42%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-yJJFHT91IsI/Tk9xxX5C8EI/AAAAAAAACHE/cqXZtVeFzg0/image_thumb%25255B20%25255D.png?imgmax=800" width="513" height="362"></a></p> <p>what actually happen in http request is shown bellow</p> <p><a href="http://lh5.ggpht.com/-5bLcgVKfn1I/Tk9x0TuUMRI/AAAAAAAACHI/WgxXatq-jnY/s1600-h/image%25255B43%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-ZWWA01HRYd8/Tk9x5pfpOYI/AAAAAAAACHM/Vso9ZONsOtE/image_thumb%25255B21%25255D.png?imgmax=800" width="528" height="118"></a></p> <p>Now some web site it not really care about the POST or GET,Attacker can convert the POST request to a get request by following manner</p> <p><a href="http://lh4.ggpht.com/-cML2VRkIPEE/Tk9x88-RyUI/AAAAAAAACHQ/4ldQEltXIDg/s1600-h/image%25255B19%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-13Pj-C9kgf0/Tk9yA2lI8sI/AAAAAAAACHU/Dej_HoaUoVY/image_thumb%25255B9%25255D.png?imgmax=800" width="525" height="77"></a></p> <p><a href="http://lh4.ggpht.com/-AT5jjrHxLbg/Tk9yDsiikKI/AAAAAAAACHY/br3VJeKrq50/s1600-h/image%25255B20%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-PdBileDDhi0/Tk9yGwlwZtI/AAAAAAAACHc/TqsUHqmV-Xk/image_thumb%25255B10%25255D.png?imgmax=800" width="529" height="65"></a></p> <p>look, an image tag added a html page that to basically a GET request to a server. ahaaa what happen this malicious img tag come from another site and request to your bank site. Server really don’t care(if there is no CSRF protection) because its come from your browser that already authenticated. So scary right. But you can say hai, this is not my fault or my application fault this is how the http work! True, this is why this is a A 'Sleeping Giant'. </p> <p>To learn more about CSRF I recommend go <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery">here</a>.</p> <p>No how do you can test quickly is your application has CSRF? OWASP has a tool name CSRFTester can be download from <a href="http://www.owasp.org/index.php/Image:CSRFTester-1.0.zip">here</a>. Its open source and you can get the source from <a title="http://code.google.com/p/owaspcsrftester/" href="http://code.google.com/p/owaspcsrftester/">http://code.google.com/p/owaspcsrftester/</a>. You need to install JRE to run this application that can be download from <a title="http://www.java.com/en/download/" href="http://www.java.com/en/download/">http://www.java.com/en/download/</a></p> <p>Well,how to use the tool, The tool is simple when you run the tool its look like following</p> <p><a href="http://lh5.ggpht.com/-0waTA6HnTGk/Tk9yLsejKJI/AAAAAAAACHg/9XpgFKsaQ64/s1600-h/image%25255B15%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-vNjIdRFnJJg/Tk9yQ3506qI/AAAAAAAACHk/yIP96GS3uNk/image_thumb%25255B5%25255D.png?imgmax=800" width="504" height="306"></a></p> <p>CSRFTester tool by default listening like a proxy in 8008. At the time blog is written there is no way I found to change this port. So you have to make sure your 8080 port is free and not already used by any other application in your pc. The first job is setting your browser so all request go threw this proxy 8008. In internet explorer it can be done from lan setting go Tools -> Internet Options -> Connections -> LAN Settings</p> <p><a href="http://lh5.ggpht.com/-vlhypPQf604/Tk9yT7A6E8I/AAAAAAAACHo/8sDy-yLVXdQ/s1600-h/image%25255B33%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-S9NYp2ynx5c/Tk9yajk4lII/AAAAAAAACHs/VvrArjizlyQ/image_thumb%25255B15%25255D.png?imgmax=800" width="432" height="387"></a></p> <p>But I’m prefer to do this short of things in firefox. Firefox has a feature to run multiple instance with complete deferent profile. Normally I do use multiple profile for different task. if you go run and use “firefox -p -no-remote” command you have user choose option. This command help you to run multiple instance of firefox at a time with complete different session.</p> <p><a href="http://lh5.ggpht.com/-v1hlxVTtHYE/Tk9yenUT8rI/AAAAAAAACHw/G-xzkbxjq40/s1600-h/image%25255B37%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-L2nNHpx_SGs/Tk9ykI4l2JI/AAAAAAAACH0/N9e0evnAyoo/image_thumb%25255B17%25255D.png?imgmax=800" width="400" height="321"></a></p> <p>Now you can do set proxy from Tools>Options> Advanced>Network>settings</p> <p><a href="http://lh3.ggpht.com/-JXVYm-PMPdA/Tk9yo8UI7zI/AAAAAAAACH4/isVu0h1lgg8/s1600-h/image%25255B41%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-ZzhMYLEGJ4I/Tk9ytSb-TnI/AAAAAAAACH8/S7rBbeQltiw/image_thumb%25255B19%25255D.png?imgmax=800" width="407" height="437"></a> </p> <p>But most of the time you may need to switch between multiple proxy, for this I’m prefer mutiproxyswitch firefox add on download link <a title="https://github.com/downloads/jmccrohan/Multiproxy-Switch/multiproxy_switch.xpi" href="https://github.com/downloads/jmccrohan/Multiproxy-Switch/multiproxy_switch.xpi">https://github.com/downloads/jmccrohan/Multiproxy-Switch/multiproxy_switch.xpi</a></p> <p>Ok, after configuring proxy in your browser you can recode any number of request by CSRFTEST tool and it can generate report in different format forms,iframe,img,XHR and link. Normally you should recode a business functionality that may need done by multiple request to server. Once you generate report open a new browser instance, authenticate as another user with access to the same business function(s) of your testing site, and have then launch the newly created HTML report file. If the action effect after viewing the file in the same browser window that was used to authenticate the the victim, then that particular function is vulnerable to CSRF(cross-site request forgery).</p> <p>Ok for defense against this attack check <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet">Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet</a>.</p> <p>Be safe… </p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-87550145417307708652010-01-08T15:03:00.002+06:002010-01-08T15:08:16.543+06:00E: flashplugin-nonfree: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.E: flashplugin-nonfree: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.<br /><br />i'm fall in this error while upgrading my Ubuntu 8.04 to 9.10 .<br /><br />trust me! do don't waste your more time on it just do a backup of /var/lib/dpkg/status file then<br /><br />type sudo gedit /var/lib/dpkg/status<br /><br />find flashplugin-nonfree block and carefully delete<br /><br />reboot...<br /><br />good luck if found any good resolution don't forgot to leave a commentnahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-2708708819305446732009-08-15T12:00:00.001+07:002009-08-15T12:00:38.187+07:00Error while running wifizoo in ubuntu 9.04<div xmlns='http://www.w3.org/1999/xhtml'>when in play with wifizoo in my lab i'm get following error while start wifizoo <br/> <br/>Traceback (most recent call last):<br/> File "wifizoo.py", line 6, in <module><br/> from scapy import *<br/> File "/pentest/wireless/wifizoo/scapy.py", line 3114<br/> tr = map(lambda x: Gnuplot.Data(x,with="lines"), trt.values())<br/><br/>i'm on ubuntu 9.04 and install all pentest tool from offensive security archive. After randomly <br/>try here and there i'm found this <a href='http://trac.secdev.org/scapy/changeset/852:055a9be0f2d3'>link</a> . then just modify scapy file "with" with "with_" <br/><br/> tr = map(lambda x: Gnuplot.Data(x,with="lines"), trt.values()) <br/> ===>> tr = map(lambda x: Gnuplot.Data(x,with_="lines"), trt.values()) <br/> g = Gnuplot.Gnuplot() <br/> world = Gnuplot.File(conf.gnuplot_world,with="lines") <br/> ===> world = Gnuplot.File(conf.gnuplot_world,with_="lines") <br/> g.plot(world,*tr) <br/> return g <br/><br/>it's a random try but fixed my problem.<br/><br/>hope helps or bring more error's :)<br/><br/><div class='zemanta-pixie'><img src='http://img.zemanta.com/pixy.gif?x-id=fbc0dd71-58da-86ec-b82c-e03c73b8c1a6' alt='' class='zemanta-pixie-img'/></div></div>nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com2tag:blogger.com,1999:blog-2599464925013219301.post-58307769139043516032009-07-26T17:25:00.005+07:002009-07-26T18:49:28.641+07:00Acer Aspire One 751h 1366x768 resolution in ubuntu 9.04i'm reading few <a href="https://help.ubuntu.com/community/AspireOne">post</a> ,<a href="http://ubuntuforums.org/showthread.php?t=1190639">post2</a> and try this...<br /><br />/etc/apt/sources.list.d/ubuntu-mobile.list<br />with this in it<br />deb http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main<br />deb-src http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main<br /><br />Then,<br />apt-get update<br />apt-get install xserver-xorg-video-psb<br /><br />No luck on backtrack4 pre release but worked in ununtu 9.04 after live update.<br />I'm install xserver-xorg-video-psb just after install ubuntu 9.04 from USB then get some error but after update ubuntu its start working...<br />So if you install ubuntu from cd or usb update it fist then install xserver-xorg-video-psb else it may not work.nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com2tag:blogger.com,1999:blog-2599464925013219301.post-64856996802804756872009-07-21T17:08:00.000+07:002009-07-22T12:38:37.364+07:00How to metasploit with autopwn on backtrack 4<div xmlns='http://www.w3.org/1999/xhtml'>I'm install metasploit on ubuntu 8.04 and can did autopwn by following this <a href='http://ubuntuforums.org/showthread.php?t=1069859'>post</a>. Recently i'm play with backtrack 4 prerelease and surprised with followiing error white try to load db_postgres command on msfconsole. it shows <br/>[-]<br/>[-] The functionality previously provided by this plugin has been<br/>[-] integrated into the core command set. Use the new 'db_driver'<br/>[-] command to use a database driver other than sqlite3 (which<br/>[-] is now the default). All of the old commands are the same.<br/>[-]<br/>[-] Error while running command load: Deprecated plugin<br/><br/>then after some research i'm found things are become easer then before .<br/><br/>now you have to do only <br/><br/>./msfconsole<br/><strike>load db_postgres</strike> db_driver<br/>db_create test<br/>db_nmap IP ADDRESS TO TEST -p 445 <br/>all other command also remain same...<br/>db_autopwn -t -p -e -s -b <br/>sessions -l <br/><br/>happy pentest....<br/><br/><br/><div class='zemanta-pixie'><img src='http://img.zemanta.com/pixy.gif?x-id=0724c26e-9aa9-8be3-9a70-d90c40d09cde' alt='' class='zemanta-pixie-img'/></div></div>nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-35118385122647924922009-07-17T17:08:00.006+07:002009-07-22T12:37:53.821+07:00BackTrack 4 Pre Release acer aspire one 751h problem with greaphics driveri'm install BackTrack 4 Pre Release on acer aspire one 751h without any problem check my previous <a href="http://nahidulkibria.blogspot.com/2009/07/install-backtrack-4-pre-release-acer.html">post</a>. But i had problem with graphics driver backtrack automatically detect graphics card as vesa with resulution 10024x768 where as my graphics card is "Integrated Intel® Graphics Media Accelerator 500" with 1366x768 resulotion suport. i'm read sevaral post related to this issure <a href="http://ubuntuforums.org/showthread.php?p=7430443">1</a>,<a href="http://touchstudio.wordpress.com/2009/05/31/acer-aspire-one-1366x768-graphics-driver-needed/">2</a> none can sloved my problem. i'm tryed<br />sudo apt-get install xserver-xorg-video-psb and made the untimate disuster. after install xserver-xorg-video-psb i'm reboot my system then logon and type startx...its give error like<br /><br />/usr/bin/X11/X: no such file or directory lablalbla<br /><br />then i have to install xserver-xorg-core with command<br />sudo apt-get install xserver-xorg-core<br /><br />then startx is worked and get back the graphical mode in backtrack again but still in 1024x768 resulotion..<br /><br />if any one know how do i get work 1366x768 resulution in backtrack or ubuntu please give feed back as commant herenahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-40120318981334678562009-07-15T13:10:00.006+07:002009-07-22T12:37:53.822+07:00Install BackTrack 4 Pre Release acer aspire one 751hI'm successfully installed BackTrack 4 Pre Release on acer aspire one 751h from USB.<br />For the partition option i'm choose guided partition option and just resize my xpdrive up to 40 GB and remaining 100GB for backtrack. its take may be above 15 minute to install. And without losing anything it installed fine...cool..here is the screen short of HDD after install backtrack. Its take 4 GB for swap as my ram is 2 GB and not break my hidden restore partition...great again.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj58H8ChPPb47TrMvCdBrVZirN-Tc-o_Oi9IFcy9_PsJOf-NhLAvXMcvDXWm_GjromGzhCvuoQr00OMm7dA9H6ZAJj1ZzeSGdsi8YIztiCPxITmVOcs-rp3T0tRD4fXaVTjlq5oLSf5KQ/s1600-h/snapshot1.png"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj58H8ChPPb47TrMvCdBrVZirN-Tc-o_Oi9IFcy9_PsJOf-NhLAvXMcvDXWm_GjromGzhCvuoQr00OMm7dA9H6ZAJj1ZzeSGdsi8YIztiCPxITmVOcs-rp3T0tRD4fXaVTjlq5oLSf5KQ/s400/snapshot1.png" alt="" id="BLOGGER_PHOTO_ID_5358571067934989074" border="0" /></a>nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-56927199069333370582009-07-14T12:28:00.002+07:002009-07-22T12:37:53.822+07:00backtrack on acer aspire one 751hI'm buy a new acer aspire one 751h and boot BackTrack 4 Pre Release from USB device looks working okay with sound. I'm not play with other details parts like wi-fi, bluethooth and window resolution yet.Hope let you know soon all issue i will get this post is just a quick feed back.<br /><br />I was made USB boot disk using <a href="http://unetbootin.sourceforge.net/">UNetBootin</a>.nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com1tag:blogger.com,1999:blog-2599464925013219301.post-64808872837054987942009-06-30T16:37:00.001+07:002009-06-30T16:42:59.611+07:00WCF not following default proxy settings<p>One of my xbap project I was creating wcf proxy using channel factory but all wcf call fail on a machine(actually all pc under a network) that only connect Internet through a proxy server. then after detail investigation I'm discover that if you are create wcf proxy using channel factory its ignore the configuration  useDefaultWebProxy="true" and try to connect with Internet by pass the proxy server. I'm found it by monitor raw packet using   <a title="YATT" href="http://www.pocketsoap.com/YATT/">YATT</a>. </p> <p>But in case of auto generated proxy its simply working fine. if you user  useDefaultWebProxy="true" in your binding its not by pass proxy server.</p> <p> <p></p> <p>to full proof that your apps following the default proxy settings on a machine you can add following code at start up</p> <p> </p> </p> <p>public App() <br />       { </p> <p> <p>           WebRequest.DefaultWebProxy = System.Net.WebRequest.GetSystemWebProxy();</p> <p>//to get default proxy settings <br />           WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials; </p> </p> <p>           try <br />           { <br />               WebRequest request = System.Net.WebRequest.Create( <br />               "<a href="http://www.labla.com/lablabla.html");">http://www.labla.com/lablabla.html");</a> <br />               request.GetResponse(); <br />           } <br />           catch (Exception ex) <br />           { </p> <p>               if (ex.Message.Equals("The remote server returned an error: (407) Proxy Authentication Required.")) <br />               { <br />                   //Proxy Authentication Required.  <br />                   //WebRequest.DefaultWebProxy.Credentials = new NetworkCredential(c.UserName, c.Pass); <br />               } <br />             } </p> <p></p> <p>} </p> <p> <p>hope this help… </p></p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0tag:blogger.com,1999:blog-2599464925013219301.post-84415468250936968182009-06-30T16:04:00.001+07:002009-06-30T16:42:59.612+07:00How to fix WCF Error The remote server returned an unexpected response: (417) Expectation failed.<p></p> Few day’s ago one of our project(using wpf and wcf ) going live and we are start getting lots of weird error one of is 417 the remote server return unexpected response. <p> <p>after some investigation and we found its only occur when client are behind a proxy in our case its squid(<a href="http://webmail.kaz.com.bd/exchweb/bin/redir.asp?URL=http://www.squid-cache.org/">http://www.squid-cache.org/</a>) and has a configuration like following in squid.conf</p> </p> <p> <p></p> <p></p> #This option makes Squid ignore any Expect: 100-continue header present <br />#in the request. Note: Enabling this is a HTTP protocol violation, but some #client may not handle it well.. <p>#Default: <br />ignore_expect_100 off </p> </p> <p></p> we are solving this problem can be solved by changing squid configuration     <p> <p>ignore_expect_100 on </p> <p></p> <p></p> <p>the following settings on the app.config also solved the problem  </p> </p> <p></p> <p><configuration></p> <p><system.net></p> <p><settings></p> <p><servicePointManager expect100Continue="false" /></p> <p></settings></p> <p></system.net></p> <p> <p></configuration></p> <p></p> but if you have control over your proxy server settings change that. if you do not have chance to change proxy settings and handle this with changing app.config may be facing problem upload large amount of file <p></p> <p></p> for more information you can check this</p> <p><a title="http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue.aspx" href="http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue.aspx">http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue.aspx</a></p> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com2tag:blogger.com,1999:blog-2599464925013219301.post-35093053492994018622009-05-24T15:33:00.002+06:002009-05-24T15:59:38.370+06:00Extract tool links mentioned in Professional Pen Testing for Web Applications part 1<div xmlns="http://www.w3.org/1999/xhtml">Chapter 3: Discovery <br /><i><b>Logistics </b></i> <br /><b>WHOIS</b> (Common to all that helps to get information about a domain name and an Internet Protocol (IP) addres) <br />Online- <a href="http://www.internic.net/whois.html">http://www.internic.net/whois.html</a> <br /><a href="http://www.allwhois.com">http://www.allwhois.com</a> <br /> <br /><b>Dig</b> (Geting IP address of a target host) <br />smiler nslookup, host and other usefull tool is digbug found in <a href="http://www.edge-security.com/soft/digdug-0.8.tar">http://www.edge-security.com/soft/digdug-0.8.tar</a> <br /> <br /><b>ARIN</b> (Discovery and understanding Of the IP block) <br /><a href="http://www.arin.net">http://www.arin.net</a> use : whois -h whois.arin.net 217.160.235.213 <br /> <br /><b>SamSpade</b> <br />Gets you lots of the logistical information only run on windows(<a href="http://preview.samspade.org/ssw/download.html">http://preview.samspade.org/ssw/download.html</a>) or use online at <a href="http://samspade.org">http://samspade.org</a> <br /> <br /><b>AFD</b>(Active Filter Detection) <br />Found on <a href="http://www.purehacking.com/afd/downloads.php">http://www.purehacking.com/afd/downloads.php</a> <br /> <br /><b>SSL/TLS </b>(Windows tool that checks the remote ssl stack for supported ciphers <br />and version) <br />THCSSLCheck (<a href="http://freeworld.thc.org/root/tools/THCSSLCheck.zip">http://freeworld.thc.org/root/tools/THCSSLCheck.zip</a>) <br /> <br /><b>SSLDigger</b> <br />You can get it here: <a href="http://www.foundstone.com/us/resources/termsofuse.asp?file=ssldigger.zip">http://www.foundstone.com/us/resources/termsofuse.asp?file=ssldigger.zip</a> <br /> <br /><i><b>OS Fingerprinting</b></i> <br /><b>Netcraft</b> (I'm confused about this... ) <br /><b> <br />p0f</b> (passive OS fingerprinting) <br />i'm getting details about p0f here <a href="http://lcamtuf.coredump.cx/p0f.shtml">http://lcamtuf.coredump.cx/p0f.shtml</a> <br />download link <a href="http://lcamtuf.coredump.cx/p0f.tgz">http://lcamtuf.coredump.cx/p0f.tgz</a> <br />readme <a href="http://lcamtuf.coredump.cx/p0f/README">http://lcamtuf.coredump.cx/p0f/README</a> <br /> <br /><b>DMitry</b> (Deepmagic Information Gathering Tool) <br />available here <a href="http://www.mor-pah.net/index.php?file=projects/dmitry">http://www.mor-pah.net/index.php?file=projects/dmitry</a></div> <div xmlns="http://www.w3.org/1999/xhtml"> <br /> <br /><i><b>Web Server Fingerprinting</b></i> <br /><b>httprint</b> <br />available @ <a href="http://www.net-square.com/httprint/">http://www.net-square.com/httprint/</a> <br /> <br /><i><b>Application Fingerprinting</b></i> <br /><b>unicornscan</b> <br />available @ <a href="http://www.unicornscan.org">http://www.unicornscan.org</a> <br /> <br /><b>nmap</b> <br />available @ <a href="http://www.insecure.org/nmap/">http://www.insecure.org/nmap/</a> <br /> <br /><i><b>Service Identification</b></i> <br /><b>amap</b> <br />available @ <a href="http://freeworld.thc.org/thc-amap/">http://freeworld.thc.org/thc-amap/</a> <br /> <br />Miscellaneous : <br />Perl script that ties nmap and amap together (<a href="http://packetstorm.linuxsecurity.com/UNIX/audit/multimap.pl">http://packetstorm.linuxsecurity.com/UNIX/audit/multimap.pl</a> ) <br />nwrap available at <a href="http://isecom.securenetltd.com/nwrap.zip">http://isecom.securenetltd.com/nwrap.zip</a></div> <div xmlns="http://www.w3.org/1999/xhtml"> <br /> <br /><i><b>Database Identification</b></i> <br /><b>THCDBFP</b> <br />Found at <a href="http://freeworld.thc.org/root/tools/THCDBFP.zip">http://freeworld.thc.org/root/tools/THCDBFP.zip</a></div> <div xmlns="http://www.w3.org/1999/xhtml"> <br /> <br /><b>Web Crawler</b> <br />HTTrack,wget well-known <br /> <br />TO BE CONTINUE (Hope this save time) <br /> <br /> <br /> <br /> <br /> <br /></div> nahidulkibriahttp://www.blogger.com/profile/16354592040961367750noreply@blogger.com0