<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ones and Zeros</title>
	<atom:link href="http://www.nordenbro.se/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nordenbro.se</link>
	<description>Technology Now</description>
	<lastBuildDate>Wed, 27 Jun 2012 13:51:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Jenkins &#8211; Displaying graphs in the views</title>
		<link>http://www.nordenbro.se/2012/03/jenkins-displaying-graphs-in-the-views/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jenkins-displaying-graphs-in-the-views</link>
		<comments>http://www.nordenbro.se/2012/03/jenkins-displaying-graphs-in-the-views/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 18:16:38 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[analysis-core]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[jenkins-ci]]></category>
		<category><![CDATA[plot]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=145</guid>
		<description><![CDATA[A common problem that have been encountered is the option to customize what is shown on a view. It could be Lint warnings from one job, C++Test warnings from another job. The question is how to do it in a usable way&#8230; The above picture shows how a view might look like. The view is [...]]]></description>
			<content:encoded><![CDATA[<p>A common problem that have been encountered is the option to customize what is shown on a view. It could be Lint warnings from one job, C++Test warnings from another job. </p>
<p>The question is how to do it in a usable way&#8230;</p>
<p><a href="http://www.nordenbro.se/wp-content/uploads/2012/03/static_analysis_graph1.png"><img src="http://www.nordenbro.se/wp-content/uploads/2012/03/static_analysis_graph1.png" alt="" title="Static Analysis View" width="646" height="232" class="aligncenter size-full wp-image-151" /></a></p>
<p>The above picture shows how a view might look like. The view is showing both the Lint warnings collected by the Warnings plugin and C++ Test warnings collected using the Cpptest plugin.</p>
<p>So what is needed to accomplish this?</p>
<p><span id="more-145"></span></p>
<p>First a more competent view plugin is needed, the Sectioned View Plugin, found <a href="https://wiki.jenkins-ci.org/display/JENKINS/Sectioned+View+Plugin" title="Sectioned View Plugin" target="_blank">here</a>.</p>
<p>This could enough since there is a section called Job Graphs Section, it can display some types of graphs. </p>
<p>So what is needed to display the graphs in a more suitable format? </p>
<p>Collect all the image links for the graphs to be displayed in the view, this is done by:</p>
<ul>
<li>Finding the graph image in the jobs</li>
<li>Fetching the links to the graphs image for each of the graphs, it is something like <br /><em>http://example.com/job/Job1/Cpptest/trendGraph/png</em></li>
<li>Optionally strip the domain from the url so it would look something like this:<br /><em>/job/Job1/Cpptest/trendGraph/png</em><br /><em>/job/Job1/warnings/trendGraph/png</em></li>
</ul>
<p>To include the graphs in the view a Text Section is used. In the text html code can be used, so it is possible to create some fancy layout here.</p>
<p>This is the code used to display the two graphs, it creates a table with two columns, and displays a graph in each:</p>
<pre lang=html>
&lt;table&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;strong&gt;C++Test&lt;/strong&gt;&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;strong&gt;Lint&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;
      &lt;a href="/job/Job1/lastBuild/"&gt;
        &lt;img width="375px" height="150px" src="/job/Job1/Cpptest/trendGraph/png" /&gt;
      &lt;/a&gt;
    &lt;/td&gt;
    &lt;td width="50%"&gt;
      &lt;a href="/job/Job2/lastBuild/"&gt;
        &lt;img width="375px" height="150px" src="/job/Job2/warnings/trendGraph/png" /&gt;
      &lt;/a&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</pre>
<p>The possibilities are limitless (or at least limited to what html can handle).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2012/03/jenkins-displaying-graphs-in-the-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse: Edit bash scripts using shelled</title>
		<link>http://www.nordenbro.se/2011/10/eclipse-edit-bash-scripts-using-shelled/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=eclipse-edit-bash-scripts-using-shelled</link>
		<comments>http://www.nordenbro.se/2011/10/eclipse-edit-bash-scripts-using-shelled/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 14:28:10 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=120</guid>
		<description><![CDATA[I have a few quite large bash shell scripts (collections) running on my server, and it would have been nice to have a good editor in Eclipse to edit the files. After some searching i found an Eclipse plug-in called ShellEd The installation process below: Prerequisites: * Dynamic Languages Toolkit &#8211; Core Frameworks version 3.0.0.0, [...]]]></description>
			<content:encoded><![CDATA[<p>I have a few quite large bash shell scripts (collections) running on my server, and it would have been nice to have a good editor in Eclipse to edit the files.</p>
<p>After some searching i found an Eclipse plug-in called <a href="http://sourceforge.net/projects/shelled/" title="ShellEd" target="_blank">ShellEd</a> </p>
<p>The installation process below:<br />
<span id="more-120"></span></p>
<p>Prerequisites:<br />
* Dynamic Languages Toolkit &#8211; Core Frameworks version 3.0.0.0, available in the Indigo repository.<br />
* Man page viewer &#8211; update site <a href="http://download.eclipse.org/technology/linuxtools/updates-nightly/" target="_blank">http://download.eclipse.org/technology/linuxtools/updates-nightly/</a></p>
<p>After the prerequisites have been installed the plug-in can be added. There is a link to an unofficial update site <a href="http://akurtakov.fedorapeople.org/shelled/updates/" target="_blank">here</a> and more information about the installation can be found <a href="http://sourceforge.net/apps/trac/shelled/wiki/Documentation/InstallGuide" target="_blank">here</a>.</p>
<p>After a restart i can now open bash files with syntax highlighting.</p>
<p><a href="http://www.nordenbro.se/wp-content/uploads/2011/10/ShellEd_Eclipse.png"><img src="http://www.nordenbro.se/wp-content/uploads/2011/10/ShellEd_Eclipse.png" alt="Editing a bash script using ShellEd in Eclipse" title="Editing a bash script using ShellEd in Eclipse" width="562" height="338" class="aligncenter size-full wp-image-106" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/eclipse-edit-bash-scripts-using-shelled/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; make back/forward mouse buttons work in Firefox</title>
		<link>http://www.nordenbro.se/2011/10/ubuntu-make-backforward-buttons-work-in-firefox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-make-backforward-buttons-work-in-firefox</link>
		<comments>http://www.nordenbro.se/2011/10/ubuntu-make-backforward-buttons-work-in-firefox/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 09:37:54 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=114</guid>
		<description><![CDATA[If you like me are used to navigate back/forward in Firefox using the mouse, it gets quite annoying when it doesn&#8217;t work. After a bit of searching I found a great guide here. The original post is much more detailed, here is a short summary. Finding the button code on the mouse Step one is [...]]]></description>
			<content:encoded><![CDATA[<p>If you like me are used to navigate back/forward in Firefox using the mouse, it gets quite annoying when it doesn&#8217;t work. </p>
<p>After a bit of searching I found a great guide <a href="http://chrisjean.com/2009/02/13/navigate-in-ubuntu-nautilus-using-the-mouse/" title="navigate-in-ubuntu-nautilus-using-the-mouse" target="_blank">here</a>.</p>
<p>The original post is much more detailed, here is a short summary.<br />
<span id="more-114"></span></p>
<p><strong>Finding the button code on the mouse</strong><br />
Step one is to install the needed applications</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> xvkbd xbindkeys x11-utils</pre></td></tr></table></div>

<p>Next find the mouse button codes. This is done by starting the xev application and check which button codes are used by clicking in the popup window.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span> xev <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">', button'</span>
    state 0x0, button <span style="color: #000000;">6</span>, same_screen YES
    state 0x0, button <span style="color: #000000;">6</span>, same_screen YES
    state 0x0, button <span style="color: #000000;">7</span>, same_screen YES
    state 0x0, button <span style="color: #000000;">7</span>, same_screen YES</pre></td></tr></table></div>

<p>From this output I can see that button 6 should be back and 7 forward.</p>
<p><strong>Adding the button binding</strong><br />
Now that we have the button codes, we add them to the binding file</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span> gedit ~<span style="color: #000000; font-weight: bold;">/</span>.xbindkeysrc</pre></td></tr></table></div>

<p>And connect the back to ALT-Left and forward to ALT-Right</p>
<pre>
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
  m:0x0 + b:6
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
  m:0x0 + b:7
</pre>
<p>Test the new bindings by starting the xbindkeys application</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span> xbindkeys</pre></td></tr></table></div>

<p><strong>Make it work after a restart</strong><br />
To make the xbindkeys application to start at login add an entry in System > Preferences > Startup Applications.</p>
<p>For detailed instructions and explanations read the original post at  <a href="http://chrisjean.com/2009/02/13/navigate-in-ubuntu-nautilus-using-the-mouse/" title="navigate-in-ubuntu-nautilus-using-the-mouse" target="_blank">http://chrisjean.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/ubuntu-make-backforward-buttons-work-in-firefox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Have Jenkins monitor available harddisk space</title>
		<link>http://www.nordenbro.se/2011/10/have-jenkins-monitor-available-harddisk-space/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=have-jenkins-monitor-available-harddisk-space</link>
		<comments>http://www.nordenbro.se/2011/10/have-jenkins-monitor-available-harddisk-space/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 03:25:32 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[diskusage]]></category>
		<category><![CDATA[jenkins-ci]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=85</guid>
		<description><![CDATA[Jenkins continuous integrations server can be used for many applications. I use it at home for many different tasks on my network. If you don&#8217;t know what continuous integration is read more here Basically a CI tool can perform the same action on a trigger. This trigger can be time 00:00 each night. Except for [...]]]></description>
			<content:encoded><![CDATA[<p>Jenkins continuous integrations server can be used for many applications. I use it at home for many different tasks on my network.</p>
<p>If you don&#8217;t know what continuous integration is read more <a href="2011/10/continuous-integration-my-thoughts/" target="_blank">here</a> </p>
<p>Basically a CI tool can perform the same action on a trigger. This trigger can be time 00:00 each night. Except for doing builds and tests of the software I develop at home I use Jenkins-CI to monitor the disk space usage on my server.<br />
<span id="more-85"></span></p>
<p>In this example I uses a bash script executing df and the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Plot+Plugin" title="Plot Plugin" target="_blank">Plot plugin</a></p>
<p>On my server I have two disks that I want to monitor, /nas/data and /nas/share. To be able to plot the available disk space I query the system for available disk space in GB and put the output value into java properties files, using a bash script. See below:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;YVALUE=&quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-B</span> <span style="color: #000000;">1073741824</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #000000; font-weight: bold;">/</span>nas<span style="color: #000000; font-weight: bold;">/</span>share <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">--</span> <span style="color: #ff0000;">'{print $3}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">%`</span> <span style="color: #000000; font-weight: bold;">&gt;</span> disk-used_share.properties
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;YVALUE=&quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-B</span> <span style="color: #000000;">1073741824</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #000000; font-weight: bold;">/</span>nas<span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">--</span> <span style="color: #ff0000;">'{print $3}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">%`</span> <span style="color: #000000; font-weight: bold;">&gt;</span> disk-used_data.properties
<span style="color: #c20cb9; font-weight: bold;">cat</span> disk-used_share.properties
<span style="color: #c20cb9; font-weight: bold;">cat</span> disk-used_data.properties</pre></td></tr></table></div>

<p>To trigger this script I use the Build trigger -> Build periodically set to @daily (once a day)</p>
<p>For visualization I provide the above created files to the plot plugin, and are using the following settings:</p>
<ul>
<li>Plot group &#8211; Name for the plot group</li>
<li>Plot title &#8211; Any good name for the plot</li>
<li>Number of builds to include &#8211; ~50 (use something appropriate here)</li>
<li>Plot y-axis label &#8211; GB</li>
<li>Plot style &#8211; line</li>
<p>Series 1:</p>
<li>Data series file &#8211; disk-used_share.properties</li>
<li>Data series legend label &#8211; Share</li>
<p>Series 2:</p>
<li>Data series file &#8211; disk-used_data.properties</li>
<li>Data series legend label &#8211; Data</li>
</ul>
<p>On my test server I get the following plot, which indicates if anything is wrong:<br />
<a href="http://www.nordenbro.se/wp-content/uploads/2011/10/disk_usage_plot.png"><img src="http://www.nordenbro.se/wp-content/uploads/2011/10/disk_usage_plot.png" alt="" title="disk_usage_plot" width="750" height="450" class="aligncenter size-full wp-image-106" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/have-jenkins-monitor-available-harddisk-space/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Continuous Integration, my thougts</title>
		<link>http://www.nordenbro.se/2011/10/continuous-integration-my-thoughts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=continuous-integration-my-thoughts</link>
		<comments>http://www.nordenbro.se/2011/10/continuous-integration-my-thoughts/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 03:01:11 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[jenkins-ci]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=88</guid>
		<description><![CDATA[What is Continuous Integration (CI)? As I believe it is a mean to perform a task in the same way every time something changes. The trigger for a change can be a check-in of some code into a Configuration Management (CM) system like svn, git, or Serena Dimensions or something completely different like a time [...]]]></description>
			<content:encoded><![CDATA[<p>What is Continuous Integration (CI)?</p>
<p>As I believe it is a mean to perform a task in the same way every time something changes. The trigger for a change can be a check-in of some code into a Configuration Management (CM) system like svn, git, or Serena Dimensions or something completely different like a time based trigger. </p>
<p>CI is starting to get a foothold in the software development community since it saves development time, which is the same as money. CI can be automated or manual, below I will have focus on an automated process using a tool.<br />
<span id="more-88"></span></p>
<p><strong>Before CI</strong><br />
Think of the following scenario (which is quite normal):</p>
<ul>
<li>A team of 5 developers are developing their own modules for a product which is due to be released 3 months from now.</li>
<li>Each member of the development team perform a check-in actions into the CM system once a week.</li>
<li>After two months the systems integrator fetches the code from the CM system and tries to build it for a first test &#8211; he/she gets an avalanche of build errors and warnings, the components don&#8217;t fit together at all, interfaces are wrong, return codes are note tested, etc.</li>
<li>Now a pain-staking process to sync the interfaces together starts, it might even go as bad as starting a &#8220;blame-game&#8221; whose fault it is, or who made the mistakes.</li>
<li>The product is finished after 5 months.</li>
</ul>
<p><strong>When CI has been introduced</strong></p>
<ul>
<li>The same team is going to develop the same modules as above.</li>
<li>Since there is a CI system available, the build process is the first thing that is decided (and developed).</li>
<li>The CI system is configured to build and integrate (even run tests when they are available) on each check-in of new code into the CM system.</li>
<li>Each developer is told to do a check-in as soon as the code compiles.</li>
<li>During the first two months the CI system checks-out the code from the CM system in each check-in (commit in svn), builds it and run available tests. This is now occurring several times a day (as soon as a developer feel confident with a change).</li>
<li>When the CI system finds an error it reports it, could be that one of the developers mistakenly changed an interface. If an error is found the developer is alerted and are able to fix the problem directly.</li>
<li>Now two months has gone by, and since the product code has been built and tested each time a check-in into the CM system has been performed, the systems integrator has an easier job to integrate everything. The first checkout probably will build and get PASSED on all the tests.</li>
<li>The product can even be finished after 2,5 months.</li>
</ul>
<p><strong>Why is this, why might the development time be shorter?</strong><br />
The advantage of doing a development process automated using a CI tool, is that when a problem arises. The developer that might have done a mistake, forgotten an interface change, or any other programming issue, will be notified directly after the check-in. This quick feedback on a problem comes when the recent changes, which broke the build, are fresh, so the effort for fixing the problem is a lot less when it is found than after 3 weeks.</p>
<p>A more professional explanation of CI can be found on the <a href="http://en.wikipedia.org/wiki/Continuous_integration" title="CI wiki" target="_blank">CI Wikipedia page</a>.</p>
<p>Currently I&#8217;m using a tool for continuous integration both for my home development and for the development I do at work. The tool I use is Jenkins, <a href="http://jenkins-ci.org/" title="Jenkins Homepage" target="_blank">read more here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/continuous-integration-my-thoughts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Accessing your Plex Media Server when not home</title>
		<link>http://www.nordenbro.se/2011/10/accessing-your-plex-media-server-remote/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=accessing-your-plex-media-server-remote</link>
		<comments>http://www.nordenbro.se/2011/10/accessing-your-plex-media-server-remote/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 01:48:56 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Plex]]></category>
		<category><![CDATA[plex]]></category>
		<category><![CDATA[plex media server]]></category>
		<category><![CDATA[remote access]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=78</guid>
		<description><![CDATA[At home I have a nice setup with a Mac Mini as &#8220;Media/TV&#8221; client and a homemade Ubuntu NAS Server hosting media files to the client. A while back I discovered Plex. Plex is a great application for organizing media files and viewing them. For more information about Plex see Plex Homepage The setup I [...]]]></description>
			<content:encoded><![CDATA[<p>At home I have a nice setup with a Mac Mini as &#8220;Media/TV&#8221; client and a homemade Ubuntu NAS Server hosting media files to the client. A while back I discovered Plex. Plex is a great application for organizing media files and viewing them. For more information about Plex see <a href="http://www.plexapp.com" title="Plex Homepage" target="_blank">Plex Homepage</a></p>
<p>The setup I use at home is:</p>
<ul>
<li>Ubuntu NAS server &#8211; is running the Plex Media Server for Linux serving media to all my clients</li>
<li>Mac Mini Media Client – connected to the TV and running Plex Client</li>
<li>A MacBook Pro – where the Plex Client is installed</li>
<li>I also have an iPad and an iPhone running the Plex iOS client</li>
</ul>
<p>Everything works fine when I’m connected on the same network as the Plex Media Server, but sometimes I’m traveling and still wants access to my media. After a bit of searching I found a perfect solution.<br />
<span id="more-78"></span></p>
<p>I found the solution <a href="http://wiki.plexapp.com/index.php/Plex_Nine_RemoteAccess" title="Plex Wiki - Remote Access" target="_blank">here</a> on the plex wiki.</p>
<p>By simply issuing two command line commands I’m able to access my home media from wherever I am.</p>
<p>The commands are:</p>
<pre>
dns-sd -R PMS _plexmediasvr._tcp . 32400 &#038;
ssh -N -L 32400:localhost:32400 x.x.x.x -l username -p 22
</pre>
<p>These two line does the following:</p>
<ul>
<li>The dns-sd command adds a dns entry to the local domain on the port which Plex searches</li>
<li>The ssh line opens a connection to your server, running Plex Media Server, over ssh and tunneling the previously add port to that computer</li>
</ul>
<p>For a more detailed description of the commands see the <a href="http://wiki.plexapp.com/index.php/Plex_Nine_RemoteAccess" title="Plex Wiki - Remote Access" target="_blank">Plex Wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/accessing-your-plex-media-server-remote/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Jenkins &#8211; Combining multiple analysis results into one plot</title>
		<link>http://www.nordenbro.se/2011/10/jenkins-combining-multiple-analysis-results-into-one-plot/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jenkins-combining-multiple-analysis-results-into-one-plot</link>
		<comments>http://www.nordenbro.se/2011/10/jenkins-combining-multiple-analysis-results-into-one-plot/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 21:33:35 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[analysis-core]]></category>
		<category><![CDATA[jenkins-ci]]></category>
		<category><![CDATA[plot]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=37</guid>
		<description><![CDATA[After using Jenkins for a while I have ended up with many jobs, doing the same thing, such as building different parts of an application. When the warnings plugin analyses the build output a summary of the test result will be created. Instead of having to view every jobs result it would be good to [...]]]></description>
			<content:encoded><![CDATA[<p>After using Jenkins for a while I have ended up with many jobs, doing the same thing, such as building different parts of an application. When the warnings plugin analyses the build output a summary of the test result will be created.</p>
<p>Instead of having to view every jobs result it would be good to get a quick summary plot of all the jobs.<br />
<span id="more-37"></span><br />
In this example we will be working with the following build jobs:</p>
<ul>
<li>build_component1</li>
<li>build_component2</li>
<li>build_component3</li>
</ul>
<p>To create a summary plot we need a summary job which runs after the build jobs have executed. This job consists of a shell execute script and a plot plugin evaluation.</p>
<p><strong>Shell execute script</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> .<span style="color: #000000; font-weight: bold;">/</span>get_summary.pl <span style="color: #cc0000; font-style: italic;">&lt;&lt;END
#!/usr/bin/perl
use LWP::Simple qw(\$ua get);
use LWP::Protocol::http;
use URI::Escape;
&nbsp;
# Configuration part, add projects to search
@projects = ('component1', 'component2', 'component3');
\$local_ip = &quot;1.2.3.4&quot;;
\$job_prefix = &quot;build_&quot;;
\$output_file = &quot;summary.xml&quot;;
&nbsp;
# Open the output file
open (MYFILE, '&gt;'.\$output_file);
print MYFILE &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n\n&quot;; 
print MYFILE &quot;&lt;warnings&gt;\n&quot;;
&nbsp;
# Set up which IP to use on an multi-interface server
@LWP::Protocol::http::EXTRA_SOCK_OPTS = (LocalAddr =&gt; &quot;\$local_ip&quot;);
&nbsp;
# Fake a user agent
\$ua-&gt;agent('Mozilla/5.0');
&nbsp;
# Collect all the results from selected projects
foreach (@projects) {
        my \$project = \$_;
        print &quot;Scanning project: \$project\n&quot;;
        my \$url = &quot;$JENKINS_URL/job/&quot; . uri_escape(\$job_prefix) . uri_escape(\$project) . &quot;/lastSuccessfulBuild/warningsResult/api/xml?depth=0&quot;;
        my \$response = \$ua-&gt;get(\$url);
        \$project =~ s/\s+/_/g;
        if (\$response-&gt;is_success) {
                my \$content = \$response-&gt;decoded_content;
                print &quot;Got response from server:\n\$content\n&quot;;
                if (\$content =~ m/&lt;numberOfWarnings&gt;(\d+)&lt;\/numberOfWarnings&gt;/g) {
                        print MYFILE &quot;   &lt;\$project type=\&quot;project\&quot;&gt;\$1&lt;/\$project&gt;\n&quot;;
                        print &quot;Found \$1 warnings for this project\n&quot;;
                } else {
                        print &quot;Error: Did not find any warnings for this project\n&quot;;
                }
        } else {
                print MYFILE &quot;   &lt;\$project type=\&quot;project\&quot;&gt;0&lt;/\$project&gt;\n&quot;;
                print &quot;Error: Connection error\n&quot;;
        }
}
&nbsp;
print MYFILE &quot;&lt;/warnings&gt;\n&quot;;
close (MYFILE);
END</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Exec</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> get_summary.pl</pre></td></tr></table></div>

<p>This bash script creates a perl script on the server. The perl script queries the Jenkins server for the build result of each of the jobs and adds them to a XML-file. To use the bash script above, change the 4 configurable variables to adapt them to the environment.</p>
<p>The output the execution should be a XML-file looking like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;warnings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component1</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;project&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/component1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component2</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;project&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/component2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component3</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;project&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/component3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/warnings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>Plot Evaluation</strong><br />
Now that we have the XML-file with the results we pass it to the plot plugin where the following settings are used:<br />
Data series file: summary.xml<br />
XPath Result type: Nodeset<br />
XPath expression: /warnings/*[@type='project']</p>
<p>Now it is just build the job and view the summary plot.</p>
<p><a href="http://www.nordenbro.se/wp-content/uploads/2011/10/getPlot.png"><img src="http://www.nordenbro.se/wp-content/uploads/2011/10/getPlot.png" alt="" title="Summary Plot" width="421" height="337" class="aligncenter size-full wp-image-52" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/jenkins-combining-multiple-analysis-results-into-one-plot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Make SSH listen to multiple ports</title>
		<link>http://www.nordenbro.se/2011/10/make-ssh-listen-to-multiple-ports/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-ssh-listen-to-multiple-ports</link>
		<comments>http://www.nordenbro.se/2011/10/make-ssh-listen-to-multiple-ports/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 19:55:10 +0000</pubDate>
		<dc:creator>stellan</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.nordenbro.se/?p=21</guid>
		<description><![CDATA[Scenario: On a home network behind a router there are 3 (A, B, C) Linux computers that needs to be accessed from the outside. There are several ways to access them. Solution 1: One entry point. Make the router point port 22 to Computer A. The user can SSH into Computer A and from there [...]]]></description>
			<content:encoded><![CDATA[<p>Scenario: On a home network behind a router there are 3 (A, B, C) Linux computers that needs to be accessed from the outside. There are several ways to access them.<br />
<span id="more-21"></span><br />
<strong>Solution 1: One entry point.</strong><br />
Make the router point port 22 to Computer A. The user can SSH into Computer A and from there SSH into B and C.</p>
<p>Pros:</p>
<ul>
<li>It is very easy to set this up, just point port 22 in the router to Computer A and we are done.</li>
<li>Only one entry point exposed to the outside.</li>
</ul>
<p>Cons:</p>
<ul>
<li>When doing more advance tunneling it soon will become very complex, and hard to remember.</li>
</ul>
<p><strong>Solution 2: Multiple entry points.<br />
</strong>Make the router point; port 2222 to Computer A, port 2223 to Computer B and port 2224 to Computer C. If A, B and C is configured correctly the will each listen to their port.</p>
<p>Pros:</p>
<ul>
<li>Each of the computers can be access directly from the outside, which makes tunneling easier</li>
</ul>
<p>Cons:</p>
<ul>
<li>All computers are exposed to the outside</li>
<li>Ports could be blocked by the ISP</li>
</ul>
<p><strong>How it is done:</strong></p>
<p>The Linux distribution I&#8217;m using is Ubuntu (currently version 10.04).</p>
<p>First configure the router to forward a non-standard port, e.g. 2222 to one of the computers.</p>
<p>SSH into that computer and edit /etc/ssh/sshd_config</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config</pre></td></tr></table></div>

<p>Find the line in the beginning of the config file that says:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">Port <span style="color: #000000;">22</span></pre></td></tr></table></div>

<p>Below that add the ports you want the ssh server to listen to, and you will get something like:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">Port <span style="color: #000000;">22</span>
Port <span style="color: #000000;">2222</span>
Port <span style="color: #000000;">22222</span></pre></td></tr></table></div>

<p>Save the file and restart the SSH server</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> service <span style="color: #c20cb9; font-weight: bold;">ssh</span> restart</pre></td></tr></table></div>

<p>And you are done.</p>
<p>To connect to the different computers use the following command</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> user<span style="color: #000000; font-weight: bold;">@</span>hostA <span style="color: #660033;">-p</span> <span style="color: #000000;">2222</span>
$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> user<span style="color: #000000; font-weight: bold;">@</span>hostB <span style="color: #660033;">-p</span> <span style="color: #000000;">2223</span>
$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> user<span style="color: #000000; font-weight: bold;">@</span>hostC <span style="color: #660033;">-p</span> <span style="color: #000000;">2224</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nordenbro.se/2011/10/make-ssh-listen-to-multiple-ports/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
