<?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"
	>

<channel>
	<title>Flashmark</title>
	<atom:link href="http://www.flashmark.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashmark.co.uk</link>
	<description></description>
	<pubDate>Sat, 08 Nov 2008 13:36:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Getting SmartyPDT working with PDT (Eclipse 3.3.2) and .html file extensions</title>
		<link>http://www.flashmark.co.uk/2008/11/getting-smartypdt-working-with-pdt-eclipse-332-and-html-file-extensions/</link>
		<comments>http://www.flashmark.co.uk/2008/11/getting-smartypdt-working-with-pdt-eclipse-332-and-html-file-extensions/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 18:01:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Smarty]]></category>

		<category><![CDATA[pdt]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[smartypdt]]></category>

		<guid isPermaLink="false">http://www.flashmark.co.uk/?p=23</guid>
		<description><![CDATA[I use Eclipse as my Integrated Development Environment (IDE) for working on PHP projects - the fantastic PDT Project provides a PHP Development Tools framework for the Eclipse platform. it is a great free alternative to Zend Studio. I make extensive use of the Smarty Template Engine in nearly all of my PHP projects - [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a title="Eclipse" href="http://www.eclipse.org/">Eclipse</a> as my Integrated Development Environment (IDE) for working on <a title="PHP Hypertext Preprocessor" href="www.php.net">PHP</a> projects - the fantastic <a title="PDT Project - PHP Development Tools framework" href="http://www.eclipse.org/pdt/">PDT Project</a> provides a PHP Development Tools framework for the Eclipse platform. it is a great free alternative to Zend Studio. I make extensive use of the <a title="Smarty Template Engine" href="http://www.smarty.net/">Smarty Template Engine</a> in nearly all of my PHP projects - so when I came across the <a title="SmartyPDT Eclipse Plugin" href="http://code.google.com/p/smartypdt/">SmartyPDT</a> plugin for Eclipse which supports syntax highlighting, code completion, runtime Smarty errors and debug capabilities, I was keen to give it a go.</p>
<p><span id="more-23"></span></p>
<p>Unfortunately I ran into a number of problems getting this plugin running, but I managed to solve all of them. As of writing I am running latest release version of PDT which is currently 1.0.3 (built on Eclipse 3.3.2).</p>
<h3>Error opening the Editor</h3>
<p>After installing SmartyPDT 0.5.4, which is the latest version in the Featured Downloads section, I encountered the following error when trying to open a Smarty .tpl file in Eclipse:</p>
<blockquote><p><span style="color: #ff0000;">Error opening the editor.<br />
tried to access field org.eclipse.php.internal.ui.editor.PHPStructuredEditor.isExternal from class org.eclipse.php.smarty.ui.editor.SmartyStructuredEditor</span></p>
<p><img class="alignnone size-full wp-image-25" title="Eclipse SmartyPDT 0.5.4 Error" src="http://www.flashmark.co.uk/wp-content/uploads/2008/11/eclipse-smartypdt-error.png" alt="" width="443" height="203" /></p></blockquote>
<p>After a little digging, I found a <a title="SmartyPDT 0.5.5 re-build" href="http://code.google.com/p/smartypdt/issues/detail?id=31#c11">re-built version of SmartyPDT</a> (0.5.5) as an attachment to one of the Issues on the Google Code project pages (it also claims to fix problems with Java 6 (jre 1.6.0), which is what I&#8217;m using). It is installed in exactly the same way:</p>
<ul>
<li>Extract the contents of the .zip into the parent folder above your Eclipse PDT installation.</li>
<li>Start Eclipse and go to the <strong>Help menu &gt; Software Updates &gt; Manage Configuration</strong>.</li>
<li>Tick the icon marked &#8220;Show Disabled Features&#8221; - it&#8217;s third in from the left on my Eclipse.</li>
<li>Expand the <strong>Eclipse Platform</strong> tree, and find the <strong>Smarty Feature 0.5.5</strong> entry.</li>
<li>Choose <strong>Enable</strong> under <strong>Available Tasks</strong> (you may first need to Disable the Smarty Feature 0.5.4 entry).</li>
<li>Restart Eclipse.</li>
</ul>
<p>This re-built version 0.5.5 solved the above error for me.<br />
<a name="other-file-extensions"></a></p>
<h3>File extensions other than .tpl are not using the SmartyPDT plugin</h3>
<p>The SmartyPDT plugin by default is only configured to work with .tpl files. If like me you use the .html file extension for your template files (I actually use .tpl.html), then you will find that these files are not highlighted by the SmartyPDT plugin.</p>
<p>You need to add *.html files to the Smarty Template content type - <strong>Window &gt; Preferences &gt; General &gt; Content Types &gt; Text &gt; PHP Content Type &gt; Smarty Template &gt; Add</strong></p>
<p>But it&#8217;s already associated with the HTML content type and adding it to the Smarty Template content type has no effect. It also can&#8217;t be removed from the HTML content type as it is locked - &#8220;*.html (locked)&#8221; - because it has been defined by the HTML plugin.</p>
<p>However, it can be disabled by manually editing the HTML plugin.xml file. In order to do this, first close down Eclipse and browse to the Eclipse installation directory, and in the <strong>plugins</strong> directory, find the .jar file beginning with <strong>org.eclipse.wst.html.core</strong> - this can be opened in WinRAR or similar. Extract the <strong>plugin.xml</strong> file and open it in your favourite text editor.</p>
<p>Find the <strong>extension</strong> element with <strong>point</strong> property whose value is <strong>org.eclipse.core.runtime.contentTypes</strong>, and remove <strong>html</strong> from the <strong>file-extensions</strong> property of the <strong>content-type</strong> sub-element.</p>
<p>This is what it should look like after editing:</p>
<pre style="padding-left: 30px;">&lt;extension point="org.eclipse.core.runtime.contentTypes"&gt;
    &lt;content-type
        file-extensions="htm,xhtml,htpl,wml,shtml,shtm"
        priority="high"
        name="%HTML_Content_Type_Extension_Element.name"
        id="htmlsource"
        base-type="org.eclipse.core.runtime.text"&gt;
        &lt;!-- note: no default-charset for HTML, should use 'platform' --&gt;
        &lt;describer
            class="org.eclipse.wst.html.core.internal.contenttype.ContentDescriberForHTML" /&gt;
    &lt;/content-type&gt;
&lt;/extension&gt;</pre>
<p>Now save the file and put it back into the .jar file, overwriting the existing plugin.xml file.</p>
<p>Start up Eclipse again and SmartyPDT should now be activated for .html files!<img src="file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmark.co.uk/2008/11/getting-smartypdt-working-with-pdt-eclipse-332-and-html-file-extensions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Set up a BlackBerry with Microsoft Exchange, without BlackBerry Enterprise Server</title>
		<link>http://www.flashmark.co.uk/2008/10/set-up-a-blackberry-with-microsoft-exchange-without-blackberry-enterprise-server/</link>
		<comments>http://www.flashmark.co.uk/2008/10/set-up-a-blackberry-with-microsoft-exchange-without-blackberry-enterprise-server/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 14:29:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.flashmark.co.uk/blog/?p=16</guid>
		<description><![CDATA[Without going down the BlackBerry Enterprise Server (BES) route, most BlackBerry providers are now able to integrate with Outlook Web Access – however it has a major drawback – it will only synchronise with your Inbox, and if you use rules to organise your emails into folders, any emails which are moved into folders will [...]]]></description>
			<content:encoded><![CDATA[<p>Without going down the BlackBerry Enterprise Server (BES) route, most BlackBerry providers are now able to integrate with Outlook Web Access – however it has a major drawback – it will only synchronise with your Inbox, and if you use rules to organise your emails into folders, any emails which are moved into folders will not appear on your BlackBerry. IMAP is another option worth investigating, but if these solutions are not suitable for you, read on for a different idea..</p>
<p><span id="more-16"></span></p>
<p>This solution is straightforward and is accomplished by setting up a forward so all emails arriving at the user&#8217;s Exchange mailbox are forwarded to the BlackBerry, and all messages sent from the BlackBerry are sent with the Exchange email address in the From field, and are BCC&#8217;d back to the Exchange mailbox and moved via a Rule into the Sent Items. It requires a bit of tweaking but works very well. It is not possible to synchronise Contacts, Calendars and Tasks, however this can still be done with a direct connection to the PC where Outlook is running.</p>
<blockquote><p><em>The following examples assume BlackBerry from Vodafone and Windows SBS 2003 with Exchange 2003 SP2. The process should be similar for other configurations.</em></p></blockquote>
<h3>Set up via mobile provider&#8217;s BlackBerry web interface</h3>
<p>This assumes you have already have a login to the BlackBerry web interface and have associated it succesfully with your device (i.e. registered the PIN and IMEI).</p>
<h4>1. Log in and create a BlackBerry device email address:</h4>
<ul>
<li>Log in to the BlackBerry web interface.</li>
<li>Rather than setting up an existing email account, we want to <strong>create a BlackBerry device email address</strong>.</li>
<li>After doing this you should see a message saying that your chosen email address has been created, and it will be listed in the <strong>Valid Email Account</strong> table.</li>
</ul>
<h4>2. Alter the account details so messages appear to have come from your Exchange email address:</h4>
<ul>
<li>Click the <strong>Edit</strong> link next to this email address, and alter the following fields:</li>
<li>Reply to: <em>&lt;Your Exchange email address&gt;</em><br />
Auto BCC: <em>&lt;Your Exchange email address&gt;</em><br />
Your Name and Signature - <em>set as you like</em>.</li>
<li>Click <strong>Save</strong>. You will be taken back to the <strong>Email Accounts</strong> page.</li>
</ul>
<h4>3. Add a filter so that BCC&#8217;d emails sent to Exchange do not re-appear in your Blackberry inbox:</h4>
<ul>
<li>Click the <strong>Filters</strong> link next to the same BlackBerry device email address.</li>
<li>Choose <strong>Add a filter</strong> and set the following:</li>
<li>Filter name: <em>Filter out emails from myself.</em><br />
Apply filter when: <em>&#8220;From&#8221; field&#8221;</em><br />
Contains: <em>&lt;Your Exchange email address&gt;</em></li>
<li>Make sure <em>“Do not forward messages to device”</em> is selected, and choose <strong>Add Filter</strong>.</li>
</ul>
<p>The BlackBerry settings are now complete.</p>
<h3>Exchange configuration</h3>
<h4>1. Create a contact on the Exchange server for the new BlackBerry email address</h4>
<ul>
<li>Navigate to <strong>Active Directory Users and Computers \ &lt;YOUR DOMAIN&gt; \ MyBusiness \ Users \ SBSUsers</strong> (or wherever your list of Users is stored).</li>
<li>Right-click and choose <strong>New &gt; Contact</strong>, and fill in the details.<br />
Note: As you will generally be adding a BlackBerry contact for an existing Active Directory user, it is a good idea to prefix the first name with e.g. <em>&#8220;Blackberry - &#8220;</em> - so that Active Directory does not complain about duplicate names.</li>
<li>On the second page, you need to specify the <strong>E-mail</strong> field. Click the <strong>Modify..</strong> button, double click <strong>SMTP Address</strong> and enter the BlackBerry device email address (as created via the web interface earlier) in the box.</li>
<li>Click Next and then Finish to add this Contact to the Active Directory.</li>
</ul>
<h4>2. Hide the new Contact so it doesn’t appear on the Global Address List (optional).</h4>
<ul>
<li>Right-click the Contact you just created, and choose <strong>Properties</strong>.</li>
<li>On the <strong>Exchange Advanced</strong> tab, tick the box which says <em>“Hide from Exchange address lists”</em> and then click<strong> </strong>Ok.</li>
</ul>
<h4>3. Set up a Forward on the Exchange account:</h4>
<ul>
<li>Right-click the Exchange User account (not the Blackberry contact you just created) and choose <strong>Properties</strong>.</li>
<li>On the <strong>Exchange General</strong> tab, click <strong>Delivery Options</strong>.</li>
<li>In the Forwarding address panel, select <em>“Forward to”</em> and click <strong>Modify..</strong></li>
<li>Select the Blackberry contact you just created and click <strong>Ok</strong>.</li>
<li>Make sure that <em>“Deliver messages to both forwarding address and mailbox”</em> is ticked.</li>
</ul>
<h3>Outlook configuration</h3>
<p>Create a rule in Outlook to move any emails received from your Exchange email address into the Sent Items folder. Your Blackberry device will Auto BCC you into any emails sent, and this rule catches them and puts them in your Sent Items folder. They will show up as Unread, which helps you to identify them as emails you sent from your BlackBerry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmark.co.uk/2008/10/set-up-a-blackberry-with-microsoft-exchange-without-blackberry-enterprise-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Filtering array elements in PHP using a array_filter and an anonymous callback function</title>
		<link>http://www.flashmark.co.uk/2008/08/filtering-array-elements-in-php-using-a-array_filter-and-an-anonymous-callback-function/</link>
		<comments>http://www.flashmark.co.uk/2008/08/filtering-array-elements-in-php-using-a-array_filter-and-an-anonymous-callback-function/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 21:45:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.flashmark.co.uk/blog/?p=13</guid>
		<description><![CDATA[There&#8217;s been a few times when i&#8217;ve used PHP&#8217;s array_filter() function to filter out some array elements - and I regularly find that I want to pass a parameter to the callback function which will affect the filter results. Unfortunately, this can&#8217;t be done with the callback implementation! This is the technique I use to [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a few times when i&#8217;ve used <a href="http://www.php.net/array_filter">PHP&#8217;s array_filter()</a> function to filter out some array elements - and I regularly find that I want to pass a parameter to the callback function which will affect the filter results. Unfortunately, this can&#8217;t be done with the callback implementation! This is the technique I use to achieve the same effect.</p>
<p><span id="more-13"></span></p>
<p>I am suprised that PHP&#8217;s implementation of callback functions does not support passing arbitrary parameters, especially since <a href="http://www.php.net/manual/en/language.pseudo-types.php">methods of a class / object can be referenced as callback functions</a> by passing an array with the object / class name at index 0 and the method name at index 1.</p>
<p>I&#8217;ll normally use this technique when i&#8217;m calling array_filter() from within a loop - and I need to filter the array based on some variable which changes on each iteration of the loop. I&#8217;d like to pass this variable as a parameter to the callback function, but array_filter() will only pass the current array element to the callback function, so we need to achieve it in another way.</p>
<p>The solution I employ is to create an anonymous function during each loop iteration, using PHP&#8217;s <a href="http://www.php.net/manual/en/function.create-function.php">create_function()</a>. This creates a function at runtime, from the parameters passed in. We can pass the function definition (i.e. the PHP code) as a string, and use variables, much the same as you would when outputting dynamic variables in HTML output.</p>
<p>Here&#8217;s an example:</p>
<pre style="PADDING-LEFT: 30px">&lt;?php</pre>
<pre style="PADDING-LEFT: 30px">// Students and their grade results
$results = array(
 0 =&gt; array('name' =&gt; 'John Doe',  'grade' =&gt; 'A'),
 1 =&gt; array('name' =&gt; 'Jane Doe',  'grade' =&gt; 'A'),
 2 =&gt; array('name' =&gt; 'Jim Doe',   'grade' =&gt; 'B'),
 3 =&gt; array('name' =&gt; 'Paul Doe',  'grade' =&gt; 'C'),
 4 =&gt; array('name' =&gt; 'Peter Doe', 'grade' =&gt; 'C')
);</pre>
<pre style="PADDING-LEFT: 30px">// We want to know how many strudents achieved each grade.
$grades = array('A','B','C');</pre>
<pre style="PADDING-LEFT: 30px">foreach($grades as $grade)
{
 // Create anonymous callback function to filter results for this grade.
 $function_body = 'return ( $input[\'grade\'] == "'.$grade.'" );';
 $function_name = create_function('$input', $function_body);
 
 // Filter the results array using the anonymous callback function.
 $filtered_results = array_filter($results, $function_name);
 
 // Write some output.
 echo "students achieving grade $grade: ".count($filtered_results)."&lt;br &gt;\n";
}</pre>
<pre style="PADDING-LEFT: 30px">?&gt; </pre>
<p>This will output the following:</p>
<pre style="PADDING-LEFT: 30px">students achieving grade A: 2
students achieving grade B: 1
students achieving grade C: 2 </pre>
<p>There you have it, how to implement an anonymous callback function to be used to filter an array.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmark.co.uk/2008/08/filtering-array-elements-in-php-using-a-array_filter-and-an-anonymous-callback-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Subversion merging problems - working copy on Samba share</title>
		<link>http://www.flashmark.co.uk/2008/08/subversion-15-merging-problems/</link>
		<comments>http://www.flashmark.co.uk/2008/08/subversion-15-merging-problems/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 11:10:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Samba]]></category>

		<category><![CDATA[Subversion]]></category>

		<category><![CDATA[merge tracking]]></category>

		<guid isPermaLink="false">http://www.flashmark.co.uk/blog/?p=5</guid>
		<description><![CDATA[Subversion has been giving me a few headaches lately - it seems to coincide with upgrading both repository and clients to 1.5, but i&#8217;ve not tried downgrading so can&#8217;t be sure. The latest problem is occurring when trying to merge some trunk bug fixes (from a single changeset, the latest revision in the trunk) into [...]]]></description>
			<content:encoded><![CDATA[<p>Subversion has been giving me a few headaches lately - it seems to coincide with upgrading both repository and clients to 1.5, but i&#8217;ve not tried downgrading so can&#8217;t be sure. The latest problem is occurring when trying to merge some trunk bug fixes (from a single changeset, the latest revision in the trunk) into a feature branch we&#8217;re working on.</p>
<p><span id="more-5"></span></p>
<p>This is the error message we are seeing:</p>
<blockquote><p><span style="color: #999999;">Command: Merging revisions 1-HEAD of svn+ssh://host/repos-path into R:\, respecting ancestry, Test Only</span><br />
<span style="color: #ff0000;">Error: Working copy path &#8216;folder/file.txt&#8217; does not exist in repository</span><br />
Finished!:</p></blockquote>
<p>I&#8217;m using <a title="TortoiseSVN subversion client" href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> 1.5.1 and the repository is running <a href="http://subversion.tigris.org/">Subversion</a> 1.5.0. I&#8217;ve done quite a few merges into this branch since upgrading to 1.5, so there is some tracked merge-history. I get this error when I instruct Subversion to <strong>merge all revisions</strong> - i.e. not specifying the revision range to merge and allowing the server to work out the revisions which require merging. I wonder if <span style="color: #999999;">1-HEAD</span> is the correct revision range to use? The file it is complaining about is present in the working copy, trunk and branch. It is also not modified in the revision I want to merge - however it was modified about 3 revisions earlier. Perhaps Subversion is trying to merge already-merged changes?</p>
<p>I have checked using the <strong>&#8211;show-revs eligible</strong> switch to <strong>svn mergeinfo</strong> to view <a href="http://svnbook.red-bean.com/nightly/en/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.mergeinfo">which changesets it is eligible to receive</a>, and this shows me the single revision that I was expecting.</p>
<p>When I use <strong>Show log</strong> to select the revision range, and choose just that single revision, the merge works without any problems, which leads me to think that the problem is to do with my merge-history.</p>
<p>I should mention at this point that we are actually using TortoiseSVN to check out our working copies onto <a href="http://www.samba.org/">Samba</a> network shares. This is officially an unsupported configuration, however it has worked flawlessly for us for the last couple of years but since upgrading to Subversion 1.5 we have started getting various problems with corrupted working copies after successful commits - with TortoiseSVN reporting &#8216;permission denied&#8217; errors when moving files around in the .svn folders. One thing I tried when fixing this was to <a href="http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#id2532706">allow readonly files to be deleted in the samba config</a> file:</p>
<blockquote>
<pre>[global]
delete readonly = yes</pre>
</blockquote>
<p>That is the only thing that has changed since the last <strong>merge all revisions</strong> operation I tried. I have just tried to merge another trunk changeset to the branch with the <strong>merge all revisions</strong> option and it has worked without any problems! I can&#8217;t be certain that this is to do with the above samba settings, or whether some broken mergeinfo was eventually fixed in the last merge commit to the branch, or even if it was to do with the specific file which was being merged originally - but it may be worth a try.</p>
<p><em>Update: August 27th 2008<br />
</em>It looks like the above setting has solved all our Subversion-related problems; we&#8217;re no longer experiencing trashed working copies and merging seems to be working perfectly with Subversion tracking mergeinfo as it should.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmark.co.uk/2008/08/subversion-15-merging-problems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Public key authentication when tunnelling Subversion repository access over SSH</title>
		<link>http://www.flashmark.co.uk/2008/08/public-key-authentication-when-tunnelling-subversion-repository-access-over-ssh/</link>
		<comments>http://www.flashmark.co.uk/2008/08/public-key-authentication-when-tunnelling-subversion-repository-access-over-ssh/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 09:45:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Subversion]]></category>

		<category><![CDATA[forced command]]></category>

		<category><![CDATA[SSH]]></category>

		<category><![CDATA[tortoisesvn]]></category>

		<guid isPermaLink="false">http://www.flashmark.co.uk/blog/?p=3</guid>
		<description><![CDATA[It is relatively straightforward to allow access to the repository by tunnelling the Subversion protocol over ssh. The use of public key authentication is necessary in this scenario, and also makes life easier when implemented correctly. It is possible to use a single system account for multiple Subversion users, none of which have to be [...]]]></description>
			<content:encoded><![CDATA[<p>It is relatively straightforward to allow access to the repository by tunnelling the Subversion protocol over ssh. The use of public key authentication is necessary in this scenario, and also makes life easier when implemented correctly. It is possible to use a single system account for multiple Subversion users, none of which have to be given command prompt access.</p>
<p>The public/private key pair generated here will be used exclusively for repository access; it will be configured to run a specific command (the Subversion server) automatically and as such cannot be used for command prompt access. If you need to use the same account for command prompt access, you will need to set up another key pair (or just use password logins).</p>
<p><span id="more-3"></span></p>
<p>First a public / private key pair is required. I am creating this and saving it as svn_&lt;username&gt; instead of the default (as this will be used for general ssh access). It is a good idea to use a passphrase - your users can <a href="http://mah.everybody.org/docs/ssh">use a key agent to avoid being prompted for it</a> all the time.</p>
<blockquote>
<pre>$ ssh-keygen -t rsa -f ~/.ssh/svn_user
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/svn_user.
Your public key has been saved in /home/user/.ssh/svn_user.pub.
The key fingerprint is:
??:??:??:??... user@serve</pre>
</blockquote>
<p>Now we need to append the public portion of this key to the authorized_keys file so the ssh daemon knows about it.</p>
<blockquote>
<pre>$ cat ~/.ssh/svn_gjm.pub &gt;&gt; ~/.ssh/authorized_keys</pre>
</blockquote>
<p>Next step is to prepend a <a href="http://oreilly.com/catalog/sshtdg/chapter/ch08.html#22858">forced command</a> to this key entry so it automatically invokes the Subversion server. Open up the ~/.ssh/.authorized_keys file in your favourite editor. The last line in the file will contain your new key. The line should look like this when you are finished:</p>
<blockquote>
<pre>command="/usr/local/bin/svnserve -t -r /var/repos",no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqi6WkturG.......</pre>
</blockquote>
<p>It is probably worth checking out the manpage for svnserve at this point if you are not sure what is going on here. Clients logging in with this key will now have the svnserve command invoked for them, with the parameters specified. The -t switch specified tunnel mode (you will want to use this), and the -r switch sets the virtual root for repositories served by svnserve, which means you don&#8217;t have to specify a full filesystem path to the repository. On my server, all my repositories are under /var/repos, so adjust this for your system configuration. The no-port-forwarding option instructs the ssh daemon to reject and port forwarding requests, and prevents the client tunnelling to any other ports - see the sshd man page for more information.</p>
<p>Now we need to configure the Subversion client to use this private key when accessing the repository. This is achieved by setting the SVN_SSH environment variable. You will probably want to add the following to your ~/.bash_history file so it is run every time you log in.</p>
<blockquote>
<pre>$ export SVN_SSH="ssh -i /home/user/.ssh/svn_user"</pre>
</blockquote>
<p>And that should be everything complete!</p>
<p>The same process can be used under Windows - I use <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> as a client most of the time - you can generate a key pair using <a href="http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter8.html">PuTTYgen</a> in a similar way and copy the public portion to the ~/.ssh/authorized_keys file. Configure TortoiseSVN to use the key - right-click in Windows Explorer and choose TortoiseSVN &gt; Settings - on the Network page, under SSH Client specify TortoisePlink.exe (normally foudn in &#8220;C:\Program Files\TortoiseSVN\bin&#8221; - you will want to use the -l parameter to specify the username and the -i parameter to specify the location of your private key - run TortoisePlink.exe without any arguments to see a list of options. <a href="http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html#pageant">Pageant</a> is a nice key agent so you don&#8217;t have to enter your key passphrase every time.</p>
<p>Some useful information, in particular on using a single unix account for multiple Subversion users, can be found in the <a href="http://svn.collab.net/repos/svn/trunk/notes/ssh-tricks">ssh-tricks file on collab.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmark.co.uk/2008/08/public-key-authentication-when-tunnelling-subversion-repository-access-over-ssh/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
