<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Not Really a Blog &#187; program</title>
	<atom:link href="http://blog.notreally.org/tag/program/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.notreally.org</link>
	<description>or is it?</description>
	<lastBuildDate>Sat, 21 Jan 2012 18:17:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.notreally.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Not Really a Blog &#187; program</title>
		<link>http://blog.notreally.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.notreally.org/osd.xml" title="Not Really a Blog" />
	<atom:link rel='hub' href='http://blog.notreally.org/?pushpress=hub'/>
		<item>
		<title>Firefox trick</title>
		<link>http://blog.notreally.org/2007/01/26/firefox-trick/</link>
		<comments>http://blog.notreally.org/2007/01/26/firefox-trick/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 10:53:38 +0000</pubDate>
		<dc:creator>jesus</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blognotreally.wordpress.com/2007/01/26/firefox-trick/</guid>
		<description><![CDATA[Try this in firefox: Go to any page with lots of images. Delete the URL bar Substitute it with: javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300;y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0) Press Enter and enjoy!!!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=44&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Try this in firefox:</p>
<ul>
<li> Go to any page with lots of images.</li>
<li> Delete the URL bar</li>
<li> Substitute it with:</li>
</ul>
<pre>
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300;y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0)</pre>
<p>Press Enter and enjoy!!!<br />
 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/blognotreally.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/blognotreally.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blognotreally.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blognotreally.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blognotreally.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=44&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.notreally.org/2007/01/26/firefox-trick/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e39e820dfad61c10be3c1f2c7f9c2747?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">golan</media:title>
		</media:content>
	</item>
		<item>
		<title>More on setting a subversion mirror repository</title>
		<link>http://blog.notreally.org/2006/12/13/more-on-setting-a-subversion-mirror-repository/</link>
		<comments>http://blog.notreally.org/2006/12/13/more-on-setting-a-subversion-mirror-repository/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 22:34:37 +0000</pubDate>
		<dc:creator>jesus</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://blognotreally.wordpress.com/2006/12/13/more-on-setting-a-subversion-mirror-repository/</guid>
		<description><![CDATA[A few days ago I wrote about setting up a subversion repository using svnsync. On that entry I was using svn+ssh authentication, but there are some gotchas to take into account to avoid having a security issue.If you recall correctly, we had a unix user with which people will access the repository. If we haven&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=41&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few days ago I wrote about <a href="http://blog.notreally.org/articles/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync">setting up a subversion repository using  svnsync</a>. On that entry I was using svn+ssh authentication, but there are some gotchas to take into account to avoid having a security issue.If you recall correctly, we had a unix user with which people will access the repository. If we haven&#8217;t taken any extra protection, that means that anyone that has their ssh key on such a user&#8217;s ~/.ssh/authorized_keys file can log into the system. If such user uses public authentication to access the remote account used for the remote repository, any committer can have access to the private key and thus access the remote machine and have write permissions on it.</p>
<p>To avoid this scenario we need to set things up in a way that users can commit to the main repository but cannot have access to the remote repository. And that, again, can be done by creating a different user (<strong>Remember, all this applies to the main repository box</strong>, not the remote box).<br />
Say:</p>
<ul>
<li> <strong>svn</strong>: The user used for the repository. It will let any user have write permission on the repository. It will also have all the public keys of all the committers, to allow them to access the server using the svn+ssh authentication under the generic user svn, in case it needs to be retrieved from a remote location, which can be easily used by forwarding your credentials.</li>
<li> <strong>svnsync</strong>: A user which will have access to the repository (read access is enough) and will have a couple of wrapper scripts to svnsync. It will use a ssh key to access the remote repository. The rest of the users will have <strong>no read permissions</strong> on this user&#8217;s home directory.</li>
<li> <strong>The rest of the users</strong> for the committers. They will have write access to the repository. As you may know, if you use svn+ssh authentication, whenever you do a commit, you basically are executing svnserve on the repositoy under your user ID (That&#8217;s why you need write permissions).</li>
</ul>
<p>This way, committers won&#8217;t have access to the svnsync private key. But we must grant them access to the wrapper scripts, so whenever they do a commit, svnserve is able to execute those scripts by triggering a post-commit hook.</p>
<p>All these can be achieved by using <a href="http://www.gratisoft.us/sudo/">sudo</a>. So, say that we have two different wrapper scripts:</p>
<ul>
<li>/home/svnsync/bin/synccommit.sh<br />
<pre class="brush: bash;">
#!/bin/bash
# this is to synchronize the repostory
# $1 will be the repository
if [[ -z $1 ]]
  then
    # The repository should be a parameter
    exit
fi

DATE=`date +%Y%m%d-%H%M `

echo &quot;[$DATE] Commiting to repository $1 . (output below if any)&quot; &gt;&gt; /home/svnsync/svnsync-commit.log 2&gt;&amp;1
/usr/local/bin/svnsync synchronize --username svnsync &quot;$1&quot; &gt;&gt; /home/svnsync/svnsync-commit.log 2&gt;&amp;1
</pre>
</li>
<li>/home/svnsync/bin/syncprop.sh<br />
<pre class="brush: bash;">
#!/bin/bash
# this is to synchronize the a property

# $1 will be the repository
# $2 will be the revision number

if [[ -z $1 || -z $2 ]]
  then
    # The repository should be a parameter
    exit
fi

DATE=`date +%Y%m%d-%H%M `
echo &quot;[$DATE] Updating property (Revision $2) to repository $1 . (output below if any)&quot; &gt;&gt; /home/svnsync/svnsync-properties.log 2&gt;&amp;1
/usr/local/bin/svnsync copy-revprops --username svnsync &quot;$1&quot; &quot;$2&quot;  &gt;&gt; /home/svnsync/svnsync-properties.log 2&gt;&amp;1
</pre>
</li>
</ul>
<p>We can call them by setting up the hook scripts as:</p>
<li> <strong>post-commit</strong> hook:<br />
<pre class="brush: bash;">
# Propagate the data to the remote repository
sudo -u svnsync /home/svnsync/bin/synccommit.sh svn+ssh://svnsync@remote/home/svnsync/svn &amp;
</pre>
</li>
<li>post-rev-change:<br />
<pre class="brush: bash;">
# Propagating changes to the remote repository. Putting it to the background
sudo -u svnsync /home/svnsync/bin/syncprop.sh svn+ssh://svnsync@remote/home/svnsync/svn $REV  &amp;amp;
</pre><br />
All we need to do now is grant access to the committers to execute both wrapper scripts by adding the following to the /etc/sudoers file (remember, by using visudo)<br />
<pre class="brush: plain;">
%commiters  ALL= (svnsync) NOPASSWD: /home/svnsync/bin/syncprop.sh
svn         ALL= (svnsync) NOPASSWD: /home/svnsync/bin/syncprop.sh
</pre>
</li>
</ul>
<p>Where committers is a common group where all committers belong to.</li>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/blognotreally.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/blognotreally.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blognotreally.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blognotreally.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blognotreally.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=41&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.notreally.org/2006/12/13/more-on-setting-a-subversion-mirror-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e39e820dfad61c10be3c1f2c7f9c2747?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">golan</media:title>
		</media:content>
	</item>
		<item>
		<title>Speeding up trac&#8217;s response time</title>
		<link>http://blog.notreally.org/2006/12/04/speeding-up-tracs-response-time/</link>
		<comments>http://blog.notreally.org/2006/12/04/speeding-up-tracs-response-time/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 18:30:44 +0000</pubDate>
		<dc:creator>jesus</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blognotreally.wordpress.com/2006/12/04/speeding-up-tracs-response-time/</guid>
		<description><![CDATA[I&#8217;ve been trying to speed up an installation of trac over the last few days. The web interface took ages to display each of the directories or files within the subversion repository. But this one wasn&#8217;t too big. The only change to the subversion repository is that we started using a vendor branch imported into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=40&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to speed up an installation of <a href="http://trac.edgewall.org/">trac</a> over the last few days. The web interface took ages to display each of the directories or files within the subversion repository. But this one wasn&#8217;t too big. The only change to the subversion repository is that we started using a vendor branch imported into our main repository using <a href="http://search.cpan.org/~clkao/SVN-Mirror-0.72/bin/svm">svm</a></p>
<p>So, after a few hours trying different solutions, and reading trac&#8217;s source code, I think I got where the bottleneck was.Well, it was <a href="sqlite">http://www.sqlite.org/download.html</a> which was causing the bottleneck. Trac uses an object <em>CachedRepository</em> to access the repositories. Whenever we want to get the <em>chagesets</em>, a function to synchronize the repository is called:<br />
<pre class="brush: python;">
class CachedRepository(Repository):
  def get_changeset(self, rev):
    if not self.synced:
      self.sync()
      self.synced = 1
      return CachedChangeset(self.repos.normalize_rev(rev), self.db, self.authz)
</pre><br />
and such method, sync(), makes a call to:<br />
<pre class="brush: python;">
youngest_stored = self.repos.get_youngest_rev_in_cache(self.db)
</pre><br />
which is all this:<br />
<pre class="brush: python;">
def get_youngest_rev_in_cache(self, db):
    &quot;&quot;&quot;Get the latest stored revision by sorting the revision strings
    numerically
    &quot;&quot;&quot;
    cursor = db.cursor()
    cursor.execute(&quot;SELECT rev FROM revision ORDER BY -LENGTH(rev), rev DESC LIMIT 1&quot;)
    row = cursor.fetchone()
    return row and row[0] or None
</pre><br />
And that SQL query was taking around 1-2 seconds each time it was executed. It happened that we were running an old version of <a href="http://www.sqlite.org/">sqlite</a> and <a href="http://www.initd.org/pub/software/pysqlite/">pysqlite</a>, so a <strong>./cofigure &amp;&amp; make &amp;&amp; make install</strong> using the recommended installation saved my day <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hope it is useful to anybody if it gets indexed by <a href="http://www.google.com">Google</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/blognotreally.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/blognotreally.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blognotreally.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blognotreally.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blognotreally.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=40&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.notreally.org/2006/12/04/speeding-up-tracs-response-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e39e820dfad61c10be3c1f2c7f9c2747?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">golan</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up a subversion mirror repository using svnsync</title>
		<link>http://blog.notreally.org/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync/</link>
		<comments>http://blog.notreally.org/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync/#comments</comments>
		<pubDate>Thu, 30 Nov 2006 01:48:36 +0000</pubDate>
		<dc:creator>jesus</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blognotreally.wordpress.com/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync/</guid>
		<description><![CDATA[With the new version of subversion 1.4 you have a new tool called svnsync with which you can maintain mirror repositories quite easily. I&#8217;ve been working on one at work and would like to share with you my findings in case it interests anyone Understanding the problem In order to have a mirror repository, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=39&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With the new version of <a href="http://subversion.tigris.org">subversion 1.4</a> you have a new tool called <a href="http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt">svnsync</a> with which you can maintain mirror repositories quite easily. I&#8217;ve been working on one at work and would like to share with you my findings in case it interests anyone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>Understanding the problem</h3>
<p>In order to have a mirror repository, it is important that commits only happen on the master and then they are synchronized to the mirror using the svnsync program. Then, the mirror repository can be used for whatever you may think of but for committing: backup, high speed checkouts, web front-ends, etc.</p>
<p>So, svnsync must be the only &#8220;one&#8221; able to commit to the repository. If we use the apache integration, there are various ways to do this. Let&#8217;s say we are using svn+ssh for authentication, in which case it is more complicated as ssh access usually grants writing access to the file system. So creating a different user is going to be handy.</p>
<h3>Creating and populating the repository</h3>
<p>So, let&#8217;s say that we created a user called svnsync on the target machine and that we are going to create a new subversion repository in its home directory:</p>
<p>
svnadmin create /home/svnsync/svn
</p>
<p>Now, we need to set up a hook to let svnsync change the properties. For this, we create /home/svnsync/svn/hooks/pre-revprop-change with:</p>
<p><pre class="brush: bash;">
#!/bin/sh
USER=&quot;$3&quot;

if [ &quot;$USER&quot; = &quot;svnsync&quot; ]; then exit 0; fi

echo &quot;Only the svnsync user can change revprops&quot; &gt;&amp;2
exit 1
</pre></p>
<p>We will grant access to the user running svnsync on the main machine by copying its ssh key to .ssh/authorized_keys. And now, we only need to initialize the remote repository. Note that we can run svnsync from where ever we want, but for the sake of simplicity, we will run it on the main machine, where the original repository resides.</p>
<p><pre class="brush: bash;">
$ svnsync init --username svnsync \
      svn+ssh://svnsync@remote/home/svnsync/svn \
      file:///source-svn
</pre></p>
<p>Note:</p>
<ul>
<li>The syntax is
<pre>svnsync init DEST SOURCE</pre>
<p>That&#8217;s it, the destination repository goes before the source  repository.</li>
<li> There is no &#8220;:&#8221; between the host name and the path to the remote repository.</li>
</ul>
<p>With this command, we will have initialized the destination repository and now we are ready to populate the destination repository. We can do it with this command:</p>
<p><pre class="brush: bash;">
svnsync synchronize --username svnsync \
       svn+ssh://svnsync@remote/home/svnsync/svn
</pre></p>
<p>And, as we already initialized the repository, there is no need to specify the source repository. This will take more or less time depending on how big you repository is and how fast your network connection is. Hopefully it will have finished after you take a coffee <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>Creating another user to let users access the repository</h3>
<p>So, we will now create an user called svn which will be used to access the repository using the subversion client. As we are using svn+ssh, all we need is to grant access to such user to all the users that have access to the main repository. If we are using ssh keys it&#8217;s as easy as copying all the allowed keys to the /home/svn/.ssh/authorized_keys file.<br />
Also, if we change the permissions to the repository at /home/svnsync/svn (and its parent) to be something like</p>
<pre>drwxr-xr-x  7 svnsync users 4096 2006-11-28 17:30 svn/</pre>
<p>we will let svnsync (and the svnsync user) be the owner and have write permissions to the repository and let svn (and all the users ssh&#8217;ing) have read access only to the repository (provided both belong to the users group).</p>
<p><pre class="brush: bash;">
$ svn co svn+ssh://svn@remote/home/svnsync/svn/test
A    test/trunk
[...]
A    test/trunk/readme
Checked out revision 2.
$ echo &quot;test&quot; &gt;&gt; test/trunk/readme
$ cd test/
$ svn -m &quot;test commit&quot; ci
Sending        trunk/readme
Transmitting file data .svn: Commit failed (details follow):
svn: Can't create directory '/home/svnsync/svn/db/transactions/2-1.txn':
Permission denied
</pre></p>
<p>And that&#8217;s all.</p>
<h3>Commiting to the master respository</h3>
<p>In case you want to commit back to the master respository, you need to do a &#8220;svn switch &#8211;relocate&#8221; to point to the master repository, but for that to work, it needs to have the same <a href="http://en.wikipedia.org/wiki/UUID">UUID</a> if we don&#8217;t want it to fail.</p>
<ol>
<li>To get the UUID on the main machine:<br />
<pre class="brush: bash;">
svnadmin dump -r0 /source-svn | head -n 3 &gt; saved-uuid
</pre>
</li>
<li>Copy the file saved-uuid to the remote machine and do a<br />
<pre class="brush: bash;">
svnadmin load --force-uuid /home/svnsynd/svn &lt; saved-uuid
</pre>
</li>
</ol>
<p>So, thins to take into account:</p>
<ol>
<li> When populating the repository, we use the svnsync user who has write permissions to the repository (svn+ssh://svnsync@&#8230;)</li>
<li>When checking out, we use the svn user (svn+ssh://svn@&#8230;)</li>
<h3>Automatization</h3>
<p>If we want to keep both repositories synchronized, we need to set up a couple of hooks on the source repository.</p>
<h4>post-commit</h4>
<p>Add this to such hook (it needs to be executable and not have the .tmpl extension)</p>
<p><pre class="brush: bash;">
# Propagate the data to the remote repository
/usr/local/bin/svnsync synchronize --username svnsync
        svn+ssh://svnsync@remote/home/svnsync/svn &amp;
</pre></p>
<h4>post-rev-changes</h4>
<p>We also want the properties changes to be present at the remote repository:</p>
<p><pre class="brush: bash;">
# Propagating changes to the remote repository.
/usr/local/bin/svnsync copy-revprops --username svnsync
       svn+ssh://svnsync@remote/home/svnsync/svn $REV  &amp;
</pre></p>
<p>Note that we put them to the background to let the user go on with what he was doing.</p>
<h3>Final notes</h3>
<p>This is a quick guide on how to set things to have a remote repository. There is much more than this and I recommend you to read the documentation and, obviously, do a backup. Doing a &#8220;svnadmin dump&#8221; only takes a while a it´s really worth it.</p>
<p>In any case, just let me know if you find any errors or typos.</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/blognotreally.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/blognotreally.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blognotreally.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blognotreally.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blognotreally.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=39&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.notreally.org/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e39e820dfad61c10be3c1f2c7f9c2747?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">golan</media:title>
		</media:content>
	</item>
		<item>
		<title>Mini tutorial on gdb</title>
		<link>http://blog.notreally.org/2006/10/03/mini-tutorial-on-gdb/</link>
		<comments>http://blog.notreally.org/2006/10/03/mini-tutorial-on-gdb/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 02:43:33 +0000</pubDate>
		<dc:creator>jesus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blognotreally.wordpress.com/2006/10/03/mini-tutorial-on-gdb/</guid>
		<description><![CDATA[Thanks to Matthew: Obviously, you need to compile things with -g as an argument to GCC.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=37&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to Matthew:</p>
<p><pre class="brush: plain;">
gdb --args program/to/debug --whatever
break Foo.c:532
# to put a breakpoint at line 532 of Foo.c
run # to run it, until it hits that line
bt # to display the stacktrace (backtrace)
frame 2 # to change the stack frame you're looking at
list # to list the sourcecode for that stack frame
step # to step into the next command for that frame
next # to run the code to the next command
continue # to continue onwards
print bar # to print the contents of variable bar
printf  &quot;%08x&quot;, bar # standard printf for bar
delete 2 # to remove the 2nd breakpoint
</pre></p>
</pre>
<p>Obviously,  you need to compile things with -g as an argument to GCC.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/blognotreally.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/blognotreally.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blognotreally.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blognotreally.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blognotreally.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.notreally.org&amp;blog=8911601&amp;post=37&amp;subd=blognotreally&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.notreally.org/2006/10/03/mini-tutorial-on-gdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e39e820dfad61c10be3c1f2c7f9c2747?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">golan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
