<?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>cat brain.stuff &#62; wordpress</title>
	<atom:link href="http://famvdploeg.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://famvdploeg.com/blog</link>
	<description>A simple look on things</description>
	<lastBuildDate>Fri, 30 Jul 2010 13:01:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Greasemonkey + jQuery = 1337</title>
		<link>http://famvdploeg.com/blog/2010/07/greasemonkey-jquery-1337/</link>
		<comments>http://famvdploeg.com/blog/2010/07/greasemonkey-jquery-1337/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 12:58:28 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=180</guid>
		<description><![CDATA[Got some inspiration from this site for the base script: click I wanted a site to always show the answer &#8216;Ja&#8217; (Dutch for yes). Which was normally only shown at a specific time. (The question was when you could drink beer. ) Here is the full script: // ==UserScript== // @name ishetalbiertijd.user.js // @namespace http://famvdploeg.com/greasemonkey [...]]]></description>
			<content:encoded><![CDATA[<p>Got some inspiration from this site for the base script: <a href="http://joanpiedra.com/jquery/greasemonkey/">click</a></p>
<p>I wanted a site to always show the answer &#8216;Ja&#8217; (Dutch for yes). Which was normally only shown at a specific time. (The question was when you could drink beer. <img src='http://famvdploeg.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p>Here is the full script:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name           ishetalbiertijd.user.js</span>
<span style="color: #006600; font-style: italic;">// @namespace      http://famvdploeg.com/greasemonkey</span>
<span style="color: #006600; font-style: italic;">// @include        http://www.ishetalbiertijd.nl/*</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> $<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Add jQuery</span>
<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> unsafeWindow.<span style="color: #660066;">jQuery</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> GM_Head <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'head'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> document.<span style="color: #660066;">documentElement</span><span style="color: #339933;">,</span>
			GM_JQ <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		GM_JQ.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'</span><span style="color: #339933;">;</span>
		GM_JQ.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">;</span>
		GM_JQ.<span style="color: #660066;">async</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
		GM_Head.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span>GM_JQ<span style="color: #339933;">,</span> GM_Head.<span style="color: #660066;">firstChild</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	GM_wait<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Check if jQuery's loaded</span>
<span style="color: #003366; font-weight: bold;">function</span> GM_wait<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> unsafeWindow.<span style="color: #660066;">jQuery</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>GM_wait<span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
		$ <span style="color: #339933;">=</span> unsafeWindow.<span style="color: #660066;">jQuery</span>.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		letsJQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// All your GM code must be inside this function</span>
<span style="color: #003366; font-weight: bold;">function</span> letsJQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//@require does not work for us...</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span#answer'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Jaaa!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#datum'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replaceWith</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span style=&quot;font-size: 200%; font-weight:bold; color:white&quot;&gt;Het kan nu!&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/07/greasemonkey-jquery-1337/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deserializing XML twitter feeds.</title>
		<link>http://famvdploeg.com/blog/2010/07/deserializing-xml-twitter-feeds/</link>
		<comments>http://famvdploeg.com/blog/2010/07/deserializing-xml-twitter-feeds/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 10:08:41 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[deserialize]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xsd]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=172</guid>
		<description><![CDATA[1. Use xsd.exe to extract an xsd file from an xml feed. Download a private xml feed for example from &#8220;http://api.twitter.com/1/statuses/user_timeline.xml&#8221; and store it to local disk. Use xsd.exe to generate the xsd. 2. Generate the classes from the xsd file you just generated. xsd.exe yourxsd.xsd /c 3. Add the generated classes to your C# [...]]]></description>
			<content:encoded><![CDATA[<p>1. Use xsd.exe to extract an xsd file from an xml feed.<br />
Download a private xml feed for example from &#8220;http://api.twitter.com/1/statuses/user_timeline.xml&#8221; and store it to local disk. Use xsd.exe to generate the xsd.<br />
2. Generate the classes from the xsd file you just generated.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xsd.exe yourxsd.xsd <span style="color: #000000; font-weight: bold;">/</span>c</pre></div></div>

<p>3. Add the generated classes to your C# project.<br />
4. Time for some fetching here is a short example:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// encode the username/password</span>
<span style="color: #993333;">string</span> user <span style="color: #339933;">=</span> Convert.<span style="color: #202020;">ToBase64String</span><span style="color: #009900;">&#40;</span>System.<span style="color: #202020;">Text</span>.<span style="color: #202020;">Encoding</span>.<span style="color: #202020;">UTF8</span>.<span style="color: #202020;">GetBytes</span><span style="color: #009900;">&#40;</span>username <span style="color: #339933;">+</span> <span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #339933;">+</span> password<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
HttpWebRequest request <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>HttpWebRequest<span style="color: #009900;">&#41;</span>WebRequest.<span style="color: #202020;">Create</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;http://api.twitter.com/1/statuses/user_timeline.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// set the method to GET</span>
request.<span style="color: #202020;">Method</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;GET&quot;</span><span style="color: #339933;">;</span>
request.<span style="color: #202020;">ServicePoint</span>.<span style="color: #202020;">Expect100Continue</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// set the authorisation levels</span>
request.<span style="color: #202020;">Headers</span>.<span style="color: #202020;">Add</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Authorization&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Basic &quot;</span> <span style="color: #339933;">+</span> user<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
request.<span style="color: #202020;">ContentType</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #339933;">;</span>
&nbsp;
using <span style="color: #009900;">&#40;</span>HttpWebResponse response <span style="color: #339933;">=</span> request.<span style="color: #202020;">GetResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> as HttpWebResponse<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	XmlSerializer serializer <span style="color: #339933;">=</span> new XmlSerializer<span style="color: #009900;">&#40;</span>typeof<span style="color: #009900;">&#40;</span>statuses<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	statuses s <span style="color: #339933;">=</span> serializer.<span style="color: #202020;">Deserialize</span><span style="color: #009900;">&#40;</span>response.<span style="color: #202020;">GetResponseStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> as statuses<span style="color: #339933;">;</span>
&nbsp;
	listBox1.<span style="color: #202020;">Items</span>.<span style="color: #202020;">Clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	foreach <span style="color: #009900;">&#40;</span>statusesStatus status in s.<span style="color: #202020;">status</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		listBox1.<span style="color: #202020;">Items</span>.<span style="color: #202020;">Add</span><span style="color: #009900;">&#40;</span>status.<span style="color: #202020;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/07/deserializing-xml-twitter-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting user GUID from Active Directory.</title>
		<link>http://famvdploeg.com/blog/2010/06/getting-user-guid-from-active-directory/</link>
		<comments>http://famvdploeg.com/blog/2010/06/getting-user-guid-from-active-directory/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 09:28:09 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[distinguished name]]></category>
		<category><![CDATA[dn]]></category>
		<category><![CDATA[guid]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[vbs]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=168</guid>
		<description><![CDATA[Sometimes you need to get a GUID for an entry in Active Directory. There are several tools available to do this. This is just one example how you could approach this. To go the network where you can search/browse AD. Perform a search and modify the columns you want to view. Look for a Distinguished [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to get a GUID for an entry in Active Directory. There are several tools available to do this. This is just one example how you could approach this.</p>
<p>To go the network where you can search/browse AD.<br />
<a href="http://famvdploeg.com/blog/wp-content/uploads/2010/06/active_directory.png"><img class="alignnone size-full wp-image-169" title="active_directory" src="http://famvdploeg.com/blog/wp-content/uploads/2010/06/active_directory.png" alt="" width="543" height="428" /></a></p>
<p>Perform a search and modify the columns you want to view. Look for a Distinguished Name property and add it. We will use it to retrieve the GUID.<br />
<a href="http://famvdploeg.com/blog/wp-content/uploads/2010/06/active_directory_2.png"><img class="alignnone size-full wp-image-170" title="active_directory_2" src="http://famvdploeg.com/blog/wp-content/uploads/2010/06/active_directory_2.png" alt="" width="530" height="421" /></a></p>
<p>Create a simple vbs script to retrieve the GUID and write it to a text file.</p>

<div class="wp_syntax"><div class="code"><pre class="vbscript" style="font-family:monospace;">Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
ForWriting = 2
Set file = objFSO.OpenTextFile(&quot;C:\Windows\Temp\guid.txt&quot;, ForWriting, true)
&nbsp;
Set sampleUser = GetObject(&quot;LDAP://CN=Wytze van der Ploeg,OU=kantoor,DC=vincis,DC=nl&quot;)
file.WriteLine(&quot;User: &quot; &amp; sampleUser.Name &amp; &quot; &quot; &amp; sampleUser.Guid)
&nbsp;
file.Close</pre></div></div>

<p>Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/06/getting-user-guid-from-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jackrabbit configuration</title>
		<link>http://famvdploeg.com/blog/2010/04/jackrabbit-configuration/</link>
		<comments>http://famvdploeg.com/blog/2010/04/jackrabbit-configuration/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 07:58:35 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=156</guid>
		<description><![CDATA[1. Download the jackrabbit jca from http://jackrabbit.apache.org/downloads.html 2. Deploy it on glassfish 3. Create a new Resource Adapter Configuration &#40;Create a new Thread-pool first if you want&#41; 4. Create a new Connector Connection Pool with the new Resource Adapter Configuration Add the following properties: homeDir &#60;full path to where your repository is located&#62; configFile &#60;full [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">1. Download the jackrabbit jca from http:<span style="color: #000000; font-weight: bold;">//</span>jackrabbit.apache.org<span style="color: #000000; font-weight: bold;">/</span>downloads.html
2. Deploy it on glassfish
3. Create a new Resource Adapter Configuration <span style="color: #7a0874; font-weight: bold;">&#40;</span>Create a new Thread-pool first <span style="color: #000000; font-weight: bold;">if</span> you want<span style="color: #7a0874; font-weight: bold;">&#41;</span>
4. Create a new Connector Connection Pool with the new Resource Adapter Configuration
Add the following properties:
homeDir <span style="color: #000000; font-weight: bold;">&lt;</span>full path to where your repository is located<span style="color: #000000; font-weight: bold;">&gt;</span>
configFile <span style="color: #000000; font-weight: bold;">&lt;</span>full path to where your repository config <span style="color: #7a0874; font-weight: bold;">&#40;</span>repository.xml<span style="color: #7a0874; font-weight: bold;">&#41;</span> is located<span style="color: #000000; font-weight: bold;">&gt;</span>
5. Create the connector resource and name it <span style="color: #ff0000;">'jcr/repository'</span> <span style="color: #000000; font-weight: bold;">for</span> example.</pre></div></div>

<p>You can now access your repository in the code. Below is a sample.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.famvdploeg.jackrabbit</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.annotation.Resource</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.ejb.Stateless</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jcr.Node</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jcr.Repository</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jcr.Session</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jcr.SimpleCredentials</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author wytze
 */</span>
@Stateless
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> JackrabbitManager <span style="color: #009900;">&#123;</span>
&nbsp;
	@Resource<span style="color: #009900;">&#40;</span>mappedName<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;jcr/repository&quot;</span>, type<span style="color: #339933;">=</span>javax.<span style="color: #006633;">jcr</span>.<span style="color: #003399;">Repository</span>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Repository</span> repository<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getFromRepo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			Session session <span style="color: #339933;">=</span> repository.<span style="color: #006633;">login</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SimpleCredentials<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;username&quot;</span>, <span style="color: #0000ff;">&quot;password&quot;</span>.<span style="color: #006633;">toCharArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			Node root <span style="color: #339933;">=</span> session.<span style="color: #006633;">getRootNode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			Node hello <span style="color: #339933;">=</span> root.<span style="color: #006633;">addNode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			hello.<span style="color: #006633;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;message&quot;</span>, <span style="color: #0000ff;">&quot;Hello, World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			session.<span style="color: #006633;">save</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// Retrieve content</span>
            		Node node <span style="color: #339933;">=</span> root.<span style="color: #006633;">getNode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>node.<span style="color: #006633;">getPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>node.<span style="color: #006633;">getProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;message&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			root.<span style="color: #006633;">getNode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;Created and removed!&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> ex.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A possible Java EE 6 Servlet which you can use for WebDAV support. You will need jackrabbit-jcr-server for the base servlet. You can get it by building the source package with maven.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.famvdploeg.jackrabbit</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.annotation.PostConstruct</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.ejb.EJB</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jcr.Repository</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.annotation.WebServlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.annotation.WebInitParam</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author wytze
 */</span>
@WebServlet<span style="color: #009900;">&#40;</span>
	name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;webdav&quot;</span>,
	urlPatterns <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/repository/*&quot;</span>,
	initParams <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		@WebInitParam<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;resource-path-prefix&quot;</span>, value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/repository&quot;</span><span style="color: #009900;">&#41;</span>,
		@WebInitParam<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;missing-auth-mapping&quot;</span>, value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;admin:admin&quot;</span><span style="color: #009900;">&#41;</span>,
		@WebInitParam<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;resource-config&quot;</span>, value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/WEB-INF/config.xml&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleWebdavServlet <span style="color: #000000; font-weight: bold;">extends</span> org.<span style="color: #006633;">apache</span>.<span style="color: #006633;">jackrabbit</span>.<span style="color: #006633;">webdav</span>.<span style="color: #006633;">simple</span>.<span style="color: #006633;">SimpleWebdavServlet</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	@EJB
	<span style="color: #000000; font-weight: bold;">private</span> RepositoryFactory repositoryFactory<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Repository</span> repository<span style="color: #339933;">;</span>
&nbsp;
	@PostConstruct
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> postConstruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		repository <span style="color: #339933;">=</span> repositoryFactory.<span style="color: #006633;">getRepository</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Repository</span> getRepository<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> repository<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Possible extended configuration of the repository:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Store all items larger than 256 bytes in the FileDataStore --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DataStore</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.apache.jackrabbit.core.data.FileDataStore&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${rep.home}/repository/datastore&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;minRecordLength&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;256&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DataStore<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/04/jackrabbit-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio copy selection macro</title>
		<link>http://famvdploeg.com/blog/2010/04/visual-studio-copy-selection-macro/</link>
		<comments>http://famvdploeg.com/blog/2010/04/visual-studio-copy-selection-macro/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:54:35 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[copy line]]></category>
		<category><![CDATA[copy selection]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[selection]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=160</guid>
		<description><![CDATA[I use the copy line / copy selection under cursor in NetBeans a lot. So I created this macro for use in Visual Studio that provides this functionality. If no line is selected the current line where the cursor is placed will be copied. When a selection is made the selection will be copied and [...]]]></description>
			<content:encoded><![CDATA[<p>I use the copy line / copy selection under cursor in NetBeans a lot. So I created this macro for use in Visual Studio that provides this functionality. If no line is selected the current line where the cursor is placed will be copied.<br />
When a selection is made the selection will be copied and pasted below the selection. Afterwards the selection will be remade so you can repeat the action immediately.</p>
<p>Below is the VB snippet.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
&nbsp;
<span style="color: #000080;">Public</span> Module Famvdploeg
    <span style="color: #008000;">' Copy the current line or selection
</span>    <span style="color: #000080;">Sub</span> CopySelection()
        <span style="color: #000080;">Dim</span> selection <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
        <span style="color: #000080;">Dim</span> lines <span style="color: #000080;">As</span> Array
&nbsp;
        <span style="color: #008000;">' Select current line if nothing is selected
</span>        <span style="color: #000080;">If</span> <span style="color: #000080;">String</span>.IsNullOrEmpty(DTE.ActiveDocument.Selection.Text) <span style="color: #000080;">Then</span>
            DTE.ActiveDocument.Selection.StartOfLine(0)
            DTE.ActiveDocument.Selection.EndOfLine(<span style="color: #000080;">True</span>)
        <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
        <span style="color: #008000;">' Store some variables
</span>        selection = DTE.ActiveDocument.Selection.Text
        lines = Split(selection, vbCrLf)
&nbsp;
        <span style="color: #008000;">' Perform the copy+paste action depending on how selection is made
</span>        <span style="color: #000080;">If</span> <span style="color: #000080;">String</span>.IsNullOrEmpty(lines(lines.Length - 1)) <span style="color: #000080;">Then</span>
            DTE.ActiveDocument.Selection.Copy()
            DTE.ActiveDocument.Selection.EndOfLine(0)
            DTE.ActiveDocument.Selection.StartOfLine(0)
            DTE.ActiveDocument.Selection.Paste()
        <span style="color: #000080;">Else</span>            
            DTE.ActiveDocument.Selection.Copy()
            DTE.ActiveDocument.Selection.EndOfLine()
            DTE.ActiveDocument.Selection.NewLine()
            DTE.ActiveDocument.Selection.StartOfLine(0)
            DTE.ActiveDocument.Selection.Paste()
        <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
        <span style="color: #000080;">If</span> lines.Length &gt; 1 <span style="color: #000080;">Then</span>
            <span style="color: #008000;">' ReSelect the text so we can repeat the action immediately
</span>            DTE.ActiveDocument.Selection.LineUp(<span style="color: #000080;">False</span>, lines.Length - 1)
            DTE.ActiveDocument.Selection.StartOfLine(0)
            DTE.ActiveDocument.Selection.LineDown(<span style="color: #000080;">True</span>, lines.Length - 1)
            <span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> <span style="color: #000080;">String</span>.IsNullOrEmpty(lines(lines.Length - 1)) <span style="color: #000080;">Then</span>
                DTE.ActiveDocument.Selection.EndOfLine(<span style="color: #000080;">True</span>)
            <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
        <span style="color: #000080;">Else</span>
            DTE.ActiveDocument.Selection.StartOfLine(0)
        <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
    <span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span>
<span style="color: #000080;">End</span> Module</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/04/visual-studio-copy-selection-macro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some basic Glassfish commands</title>
		<link>http://famvdploeg.com/blog/2010/04/some-basic-glassfish-commands/</link>
		<comments>http://famvdploeg.com/blog/2010/04/some-basic-glassfish-commands/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 14:05:34 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=149</guid>
		<description><![CDATA[I ran out of brain capacity. So here is a list of commands to do some basic glassfish stuff. Updating: pkg image-update Start domain: asadmin start-domain Stop domain: asadmin stop-domain Deploy item: asadmin deploy &#60;path to file&#62; List JNDI entries: asadmin list-jndi-entries]]></description>
			<content:encoded><![CDATA[<p>I ran out of brain capacity. So here is a list of commands to do some basic glassfish stuff.</p>
<table>
<tr>
<td>Updating: </td>
<td>pkg image-update</td>
</tr>
<tr>
<td>Start domain: </td>
<td>asadmin start-domain</td>
</tr>
<tr>
<td>Stop domain: </td>
<td>asadmin stop-domain</td>
</tr>
<tr>
<td>Deploy item: </td>
<td>asadmin deploy &lt;path to file&gt;</td>
</tr>
<tr>
<td>List JNDI entries: </td>
<td>asadmin list-jndi-entries</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/04/some-basic-glassfish-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic iptables configuration</title>
		<link>http://famvdploeg.com/blog/2010/01/basic-iptables-configuration/</link>
		<comments>http://famvdploeg.com/blog/2010/01/basic-iptables-configuration/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 13:21:36 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux iptables chains]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=136</guid>
		<description><![CDATA[Here is a small basic example allowing you to setup your iptables. First we reset everything. See the man page for exact details on the parameters we use. iptables -F iptables -Z iptables -X Create some chains that will provide us with some logging. iptables -N logdrop iptables -N logreject iptables -N logaccept Add some [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a small basic example allowing you to setup your iptables.</p>
<p>First we reset everything. See the man page for exact details on the parameters we use.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-F</span>
iptables <span style="color: #660033;">-Z</span>
iptables <span style="color: #660033;">-X</span></pre></div></div>

<p>Create some chains that will provide us with some logging.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-N</span> logdrop
iptables <span style="color: #660033;">-N</span> logreject
iptables <span style="color: #660033;">-N</span> logaccept</pre></div></div>

<p>Add some rules to these chains.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-A</span> logdrop <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">'DROP: '</span> <span style="color: #660033;">--log-level</span> warning
iptables <span style="color: #660033;">-A</span> logdrop <span style="color: #660033;">-j</span> DROP
iptables <span style="color: #660033;">-A</span> logreject <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">'REJECT: '</span> <span style="color: #660033;">--log-level</span> warning
iptables <span style="color: #660033;">-A</span> logreject <span style="color: #660033;">-j</span> REJECT
iptables <span style="color: #660033;">-A</span> logaccept <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">'ACCEPT: '</span> <span style="color: #660033;">--log-level</span> warning
iptables <span style="color: #660033;">-A</span> logaccept <span style="color: #660033;">-j</span> ACCEPT</pre></div></div>

<p>Now you have a basic setup with some logging.<br />
The next step will be to apply your rules and jump to the corresponding chain on a positive match.<br />
You could set the default policies for the INPUT, FORWARD and OUTPUT chains to ACCEPT and add a jump to logdrop at the end of each chain so that any non-matching rules will be automatically dropped.</p>
<p>Small example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> RELATED,ESTABLISHED <span style="color: #660033;">-j</span> ACCEPT
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">22</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> logaccept
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">443</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> logaccept
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> logaccept
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-j</span> logdrop
&nbsp;
iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-j</span> logreject</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2010/01/basic-iptables-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some bash stuff</title>
		<link>http://famvdploeg.com/blog/2009/08/some-bash-stuff/</link>
		<comments>http://famvdploeg.com/blog/2009/08/some-bash-stuff/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 07:38:25 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=124</guid>
		<description><![CDATA[I just need a cheat sheet because I keep forgetting all these bash things. Number of parameters: $# All parameters: $@ String length: ${#foo} Remove trailing slash: ${foo%/} Check return value from last command: $?]]></description>
			<content:encoded><![CDATA[<p>I just need a cheat sheet because I keep forgetting all these bash things.</p>
<table border="0">
<tbody>
<tr>
<td>Number of parameters:</td>
<td>$#</td>
</tr>
<tr>
<td>All parameters:</td>
<td>$@</td>
</tr>
<tr>
<td>String length:</td>
<td>${#foo}</td>
</tr>
<tr>
<td>Remove trailing slash:</td>
<td>${foo%/}</td>
</tr>
<tr>
<td>Check return value from last command:</td>
<td>$?</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2009/08/some-bash-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lm-sensors on the VIA EPIA SN10000EG and SN18000g</title>
		<link>http://famvdploeg.com/blog/2009/07/lm-sensors-on-the-via-epia-sn10000eg-and-sn18000g/</link>
		<comments>http://famvdploeg.com/blog/2009/07/lm-sensors-on-the-via-epia-sn10000eg-and-sn18000g/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 09:39:17 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=112</guid>
		<description><![CDATA[1. Edit /etc/modprobe.d/options.conf 2. Add the following line: options dme1737 probe_all_addr=1 3. Save and exit 4. Load the module modprobe dme1737 5. Check that it loaded succesfully: lsmod 6. Edit the /etc/sysconfig/lm_sensors file HWMON_MODULES=&#34;dme1737&#34; MODULE_0=dme1737 7. Run sensors to check the output sensors 8. I also compiled the c7temp module because the in0 didn&#8217;t show [...]]]></description>
			<content:encoded><![CDATA[<p>1. Edit /etc/modprobe.d/options.conf<br />
2. Add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">options dme1737 <span style="color: #007800;">probe_all_addr</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>3. Save and exit<br />
4. Load the module</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">modprobe dme1737</pre></div></div>

<p>5. Check that it loaded succesfully:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">lsmod</span></pre></div></div>

<p>6. Edit the /etc/sysconfig/lm_sensors file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">HWMON_MODULES</span>=<span style="color: #ff0000;">&quot;dme1737&quot;</span>
<span style="color: #007800;">MODULE_0</span>=dme1737</pre></div></div>

<p>7. Run sensors to check the output</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sensors</pre></div></div>

<p>8. I also compiled the c7temp module because the in0 didn&#8217;t show and loaded it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>c7temp
<span style="color: #7a0874; font-weight: bold;">&#40;</span>I extracted the c7temp.c <span style="color: #c20cb9; font-weight: bold;">file</span> from the <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #c20cb9; font-weight: bold;">which</span> is placed here:
http:<span style="color: #000000; font-weight: bold;">//</span>lists.lm-sensors.org<span style="color: #000000; font-weight: bold;">/</span>pipermail<span style="color: #000000; font-weight: bold;">/</span>lm-sensors<span style="color: #000000; font-weight: bold;">/</span>attachments<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">20080619</span><span style="color: #000000; font-weight: bold;">/</span>0dccdaf0<span style="color: #000000; font-weight: bold;">/</span>attachment.bin<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>c7temp<span style="color: #000000; font-weight: bold;">/</span>c7temp.c
filled the contents of c7temp.c with those of the <span style="color: #c20cb9; font-weight: bold;">patch</span></pre></div></div>

<p>Created a makefile in the c7temp dir.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">obj-m    := c7temp.o
&nbsp;
KDIR    := <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>shell <span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>build
PWD    := $<span style="color: #7a0874; font-weight: bold;">&#40;</span>shell <span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
default:
	$<span style="color: #7a0874; font-weight: bold;">&#40;</span>MAKE<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-C</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>KDIR<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">SUBDIRS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>PWD<span style="color: #7a0874; font-weight: bold;">&#41;</span> modules</pre></div></div>

<p>And ran make in the c7temp dir. This will get you a .ko file. Install it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">644</span> c7temp.ko <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>hwmon<span style="color: #000000; font-weight: bold;">/</span>c7temp.ko</pre></div></div>

<p>Generate the modules.dep and map files</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">depmod <span style="color: #660033;">-a</span></pre></div></div>

<p>And load the module</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">modprobe c7temp</pre></div></div>

<p>And check that the module loaded with lsmod</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">lsmod</span></pre></div></div>

<p>Modified the /etc/sysconfig/lm_sensors file a bit again</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Generated by sensors-detect on Wed Jul  1 08:43:13 2009</span>
<span style="color: #666666; font-style: italic;"># This file is sourced by /etc/init.d/lm_sensors and defines the modules to</span>
<span style="color: #666666; font-style: italic;"># be loaded/unloaded.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The format of this file is a shell script that simply defines variables:</span>
<span style="color: #666666; font-style: italic;"># HWMON_MODULES for hardware monitoring driver modules, and optionally</span>
<span style="color: #666666; font-style: italic;"># BUS_MODULES for any required bus driver module (for example for I2C or SPI).</span>
&nbsp;
<span style="color: #007800;">HWMON_MODULES</span>=<span style="color: #ff0000;">&quot;dme1737 c7temp&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># For compatibility reasons, modules are also listed individually as variables</span>
<span style="color: #666666; font-style: italic;">#    MODULE_0, MODULE_1, MODULE_2, etc.</span>
<span style="color: #666666; font-style: italic;"># You should use BUS_MODULES and HWMON_MODULES instead if possible.</span>
&nbsp;
<span style="color: #007800;">MODULE_0</span>=dme1737
<span style="color: #007800;">MODULE_1</span>=c7temp</pre></div></div>

<p>Done.<br />
9. I edited the /etc/sensors3.conf file on my machine</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">chip <span style="color: #ff0000;">&quot;sch311x-*&quot;</span>
    ignore in0
&nbsp;
    label in1 <span style="color: #ff0000;">&quot;Vcore&quot;</span>
    label in2 <span style="color: #ff0000;">&quot;+3.3V&quot;</span>
    label in3 <span style="color: #ff0000;">&quot;+5V&quot;</span>
    label in4 <span style="color: #ff0000;">&quot;+12V&quot;</span>
    label in5 <span style="color: #ff0000;">&quot;3VSB&quot;</span>
    label in6 <span style="color: #ff0000;">&quot;Vbat&quot;</span>
&nbsp;
    label temp1 <span style="color: #ff0000;">&quot;CPU&quot;</span>
    label temp2 <span style="color: #ff0000;">&quot;SIO Temp&quot;</span>
    label temp3 <span style="color: #ff0000;">&quot;M/B Temp&quot;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">set</span> in2_min  <span style="color: #000000;">3.3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0.90</span>
    <span style="color: #000000; font-weight: bold;">set</span> in2_max  <span style="color: #000000;">3.3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1.10</span>
    <span style="color: #000000; font-weight: bold;">set</span> in3_min  <span style="color: #000000;">5.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0.90</span>
    <span style="color: #000000; font-weight: bold;">set</span> in3_max  <span style="color: #000000;">5.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1.10</span>
    <span style="color: #000000; font-weight: bold;">set</span> in4_min <span style="color: #000000;">12.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0.90</span>
    <span style="color: #000000; font-weight: bold;">set</span> in4_max <span style="color: #000000;">12.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1.10</span>
    <span style="color: #000000; font-weight: bold;">set</span> in5_min  <span style="color: #000000;">3.3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0.90</span>
    <span style="color: #000000; font-weight: bold;">set</span> in5_max  <span style="color: #000000;">3.3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1.10</span>
    <span style="color: #000000; font-weight: bold;">set</span> in6_min  <span style="color: #000000;">3.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0.90</span>
    <span style="color: #000000; font-weight: bold;">set</span> in6_max  <span style="color: #000000;">3.0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1.10</span>
&nbsp;
chip <span style="color: #ff0000;">&quot;c7temp-*&quot;</span>
    ignore temp1</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2009/07/lm-sensors-on-the-via-epia-sn10000eg-and-sn18000g/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Samba basic config</title>
		<link>http://famvdploeg.com/blog/2009/05/samba-basic-config/</link>
		<comments>http://famvdploeg.com/blog/2009/05/samba-basic-config/#comments</comments>
		<pubDate>Thu, 07 May 2009 07:10:45 +0000</pubDate>
		<dc:creator>Wytze</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://famvdploeg.com/blog/?p=100</guid>
		<description><![CDATA[Step one: You will need samba apt-get install samba Step two: Check if you have a group for your samba users. cat /etc/group &#124; grep samba On my system this resulted in &#8220;sambashare:x:107:&#8221; which means we have a group called sambashare with gid 107. If you don&#8217;t have a group you can create it. I [...]]]></description>
			<content:encoded><![CDATA[<p>Step one: You will need samba
<pre>apt-get install samba</pre>
<p>Step two: Check if you have a group for your samba users.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> samba</pre></div></div>

<p>On my system this resulted in &#8220;sambashare:x:107:&#8221; which means we have a group called sambashare with gid 107.</p>
<p>If you don&#8217;t have a group you can create it. I recommend specifying an own gid which you can use on multiple systems.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">groupadd <span style="color: #660033;">-g</span> <span style="color: #000000;">2000</span> share</pre></div></div>

<p>Step three: Create some basic users.</p>
<p>If the user doesn&#8217;t exist on the system you will need to create it. I assume this new user will only be used with samba.<br />
So we will force it into the sambashare group and disable the shell. (If you didn&#8217;t have the sambashare group use share or whatever name you choose in the previous step)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-g</span> sambashare <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> yourusername</pre></div></div>

<p>-g sets the main group for this user<br />
-s sets the shell login</p>
<p>After this we set a samba password</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">smbpasswd <span style="color: #660033;">-a</span> yourusername</pre></div></div>

<p>-a adds a new user and sets the password</p>
<p>Do a round trip of this step for all the users you need.</p>
<p>Step four:</p>
<p>Create some basic shares. Here is a short snippet to make a new share. Edit /etc/samba/smb.conf and add something like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>sharename<span style="color: #7a0874; font-weight: bold;">&#93;</span>
valid <span style="color: #c20cb9; font-weight: bold;">users</span> = user1, user2
path = <span style="color: #000000; font-weight: bold;">/</span>share
browsable = <span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #c20cb9; font-weight: bold;">write</span> list = user2
create mask = 0664
directory mask = 0775
force user = root
force group = sambashare</pre></div></div>

<p>That&#8217;s it. Save it and then restart the server to be sure the settings are picked up.<br />
/etc/init.d/samba restart</p>
]]></content:encoded>
			<wfw:commentRss>http://famvdploeg.com/blog/2009/05/samba-basic-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
