<?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>be present now &#187; linux</title>
	<atom:link href="http://durdn.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://durdn.com/blog</link>
	<description>modern alchemy for joyful living.</description>
	<lastBuildDate>Tue, 17 Apr 2012 18:48:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Git with Subversion: Tips that will make your life easier</title>
		<link>http://durdn.com/blog/2011/07/06/using-git-with-subversion-tips-that-will-make-your-life-easier/</link>
		<comments>http://durdn.com/blog/2011/07/06/using-git-with-subversion-tips-that-will-make-your-life-easier/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 17:36:02 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://durdn.com/blog/?p=129</guid>
		<description><![CDATA[&#160; In the last couple of years I&#8217;ve been working on various projects that &#8211; unfortunately &#8211; still use Subversion as their version control system. I moved to git already a few years ago and I wanted to keep using it as much as possible. Luckily git-svn is an incredibly complete tool to interact with [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>In the last couple of years I&#8217;ve been working on various projects that &#8211; unfortunately &#8211; still use Subversion as their version control system. I moved to git already a few years ago and I wanted to keep using it as much as possible. Luckily <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> is an incredibly complete tool to interact with a Subversion repository without leaving the comfort of the git power toolset. But there are gotchas.</p>
<p>This post assumes you are already a little bit aquainted with git-svn and you know how to interact with a subversion repository using it. In case you are not or you want a refresher, please have a look at this <a href="http://www.jukie.net/~bart/blog/svn-branches-in-git">post from Bart</a> or google it.</p>
<p>The list below is a list of all the tips I had to research and integrate in my workflow to keep using git joyfully in conjunction with Subversion. Enjoy!</p>
<p>&nbsp;</p>
<h2>Setting up the files to ignore</h2>
<p>You should make sure that git ignores the same files svn does. The simpler trick is to append the list of svn:ignore files to the default git exclude file:</p>
<pre>git svn show-ignore &gt;&gt; .git/info/exclude</pre>
<p>An alternative method is the magical <strong>update-index  &#8211;assume-unchanged</strong>:</p>
<pre>git update-index --assume-unchanged files to ignore</pre>
<p>This is quite a fine trick I&#8217;ve consistently used in the past year. If you need more information, have a look at this <a href="http://stackoverflow.com/questions/655243/ignore-modified-but-not-committed-files-in-git">post on Stackoverflow</a>.</p>
<p>If you use the latter method, how do you find out later that a file has been ignored in git? You can use this:</p>
<pre>git ls-files -v | grep ^[a-z] | sed -e 's/^h\ //'</pre>
<div>
<h2>Shallow clone big repositories</h2>
<p>I&#8217;ve worked with codebases that are above 1.5Gb for a full Subversion checkout. I am not kidding. Checking out the entire history commit by commit &#8211; the way git-svn does &#8211; would be impossible. The repository is simply to big.</p>
<p>The way around it is to create a shallow clone of the repository, instead of copying the entire history of the project you just copy the last n commits and proceed from there. For example:</p>
<pre>git svn clone -s -r604:HEAD <a href="http://nick@svn.xxxxxx.com/repos/">http://nick@svn.xxxxxx.com/repos/</a> -T trunk -b branches -t tags</pre>
<p>Mandatory <a href="http://stackoverflow.com/questions/747075/how-to-git-svn-clone-the-last-n-revisions-from-a-subversion-repository">Stackoverflow reference</a>.</p>
<h2></h2>
<h2>If you added the .svn folders by mistake in git</h2>
<p>Sooner or later you&#8217;ll run into a few snags. For example one time I didn&#8217;t use git-svn right from the start, I just checked out a project from subversion and I wanted to do my own tracking using git. At that time I mistakenly added the .svn folders to the index (staging area) in git.  How to keep those important files but remove them from the index?  Tricky!</p>
<p>Here&#8217;s how to untrack files without deleting them in git:</p>
<pre>git st | grep .svn | awk {'print $3'} | xargs git rm --cached</pre>
<p>Very clearly explained in this <a href="http://progit.org/book/ch2-2.html">chapter on progit</a>.</p>
<h2></h2>
<h2>What to do when a Subversion repository moves</h2>
<p>When a Subversion repository moves (or when you have to access it via VPN and do some smart tunneling that will change its address) you have to follow the correct procedure to avoid a full checkout.</p>
<p>The first method listed at the <a href="https://git.wiki.kernel.org/index.php/GitSvnSwitch">git wiki</a> is the one with which I had consistent success. Directly from the wiki here is the important part:</p>
<div>
<ul>
<li>Edit the svn-remote url URL in .git/config to point to the new domain name</li>
<li>Run <code>git svn fetch</code> - <em>This needs to fetch at least one new revision from svn!</em></li>
<li>Change svn-remote url back to the original url</li>
<li>Run <code>git svn rebase -l</code> to do a local rebase (with the changes that came in with the last fetch operation)</li>
<li>Change svn-remote url back to the new url</li>
<li>Run <code>git svn rebase</code> should now work again!</li>
</ul>
<p>This will only work, if the <code>git svn fetch</code> step actually fetches anything!</p>
<h2></h2>
<h2>Conclusion</h2>
<p>Working with git is a joy for me. You have total freedom and total control. You can commit endlessly, reformat your commits, squash them into clean ones, branch like crazy. You can bring the same joy with you even if you have to interact with Subversion. I&#8217;ve done it for the past 2 years. And it works beautifully.</p>
<p><div class="woo-sc-twitter left"><a href="http://twitter.com/share" class="twitter-share-button" data-via="durdn"data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div> 
<div class="woo-fblike none">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://durdn.com/blog/2011/07/06/using-git-with-subversion-tips-that-will-make-your-life-easier/&amp;layout=box_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=arial&locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:auto; height:65px;"></iframe>
</div>
	</p>
<p>&nbsp;</p>
</div>
</div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fdurdn.com%2Fblog%2F2011%2F07%2F06%2Fusing-git-with-subversion-tips-that-will-make-your-life-easier%2F';
  addthis_title  = 'Using+Git+with+Subversion%3A+Tips+that+will+make+your+life+easier';
  addthis_pub    = 'durdn';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://durdn.com/blog/2011/07/06/using-git-with-subversion-tips-that-will-make-your-life-easier/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>how to setup pinax with nginx</title>
		<link>http://durdn.com/blog/2009/10/07/how-to-setup-pinax-with-nginx/</link>
		<comments>http://durdn.com/blog/2009/10/07/how-to-setup-pinax-with-nginx/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 00:38:44 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pinax]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[flup]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://durdn.com/blog/?p=66</guid>
		<description><![CDATA[Tonight I spent sometime getting Pinax &#8211; Django swiss army knife &#8211; to work on nginx via fastcgi on my Ubuntu 9.10 box. Here is a step by step guide. First of course we need to install nginx, pretty easy with Ubuntu: sudo apt-get install nginx Create a new file called &#60;appname&#62; in /etc/nginx/sites-available/ like [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I spent sometime getting <a href="http://pinaxproject.com">Pinax</a> &#8211; <a href="http://www.djangoproject.com/">Django</a> swiss army knife &#8211; to work on <a href="http://wiki.nginx.org/Main">nginx</a> via fastcgi on my <a href="http://www.ubuntu.com/testing/karmic/beta">Ubuntu 9.10</a> box. Here is a step by step guide.</p>
<p>First of course we need to install nginx, pretty easy with Ubuntu:</p>
<pre>sudo apt-get install nginx</pre>
<p>Create a new file called &lt;appname&gt; in /etc/nginx/sites-available/ like the following:</p>
<pre>upstream djangoserv {
    server 127.0.0.1:8801;
}

server {
    listen   80;
    server_name  alkemic;

    access_log  /var/log/nginx/appname.access.log;

    location ^~ /site_media/  {
       alias /home/nick/dev/projects/pinax07/appname/site_media/;
       autoindex on;
    }
    location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc \
        |xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)   {
        #access_log   off;
        expires      30d;
    }

    location / {
        # host and port to fastcgi server
        fastcgi_pass 127.0.0.1:8801;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_pass_header Authorization;
        fastcgi_intercept_errors off;
    }
}</pre>
<p>Link it to sites-enabled so that we know it&#8217;s going to be started up (meanwhile you want to remove the default one):</p>
<pre>sudo ln -s /etc/nginx/sites-available/appname /etc/nginx/sites-enabled/</pre>
<p>Startup nginx with:</p>
<pre>sudo /etc/init.d/nginx start</pre>
<p>Activate your pinax installation (change the path to where you have installed your Pinax virtual environment):</p>
<pre>source /home/nick/dev/projects/pinax07/bin/activate</pre>
<p>Install <a href="http://trac.saddi.com/flup">flup</a> (required to have manage.py run as fastcgi) in your virtual env:</p>
<pre>pip install flup</pre>
<p>Symlink all the static assets into the site_media folder:</p>
<pre>css -&gt; /home/nick/dev/projects/pinax07/appname/media/css/
img -&gt; /home/nick/dev/projects/pinax07/appname/media/img
js -&gt; /home/nick/dev/projects/pinax07/appname/media/js
pinax -&gt; ../../lib/python2.6/site-packages/pinax/media/default/pinax/
snd -&gt; /home/nick/dev/projects/pinax07/appname/media/snd
swf -&gt; /home/nick/dev/projects/pinax07/appname/media/swf</pre>
<p>Launch the python fastcgi process:</p>
<pre> python ./manage.py runfcgi method=threaded host=127.0.0.1 port=8801</pre>
<p>Or:</p>
<pre>python ./manage.py runfcgi method=prefork host=127.0.0.1 port=8801</pre>
<p>Note that you might need to move your development environment to use a proper db like MySQL because otherwise the app will have problems finding your sqlite db file.</p>
<p>You should have now your app running on the blazing fast nginx.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fdurdn.com%2Fblog%2F2009%2F10%2F07%2Fhow-to-setup-pinax-with-nginx%2F';
  addthis_title  = 'how+to+setup+pinax+with+nginx';
  addthis_pub    = 'durdn';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://durdn.com/blog/2009/10/07/how-to-setup-pinax-with-nginx/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>my desktop during an intense coding session using xmonad</title>
		<link>http://durdn.com/blog/2009/07/01/my-desktop-during-an-intense-coding-session-using-xmonad/</link>
		<comments>http://durdn.com/blog/2009/07/01/my-desktop-during-an-intense-coding-session-using-xmonad/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 11:40:22 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[editors]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[pinax]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[tiling]]></category>
		<category><![CDATA[wm]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://durdn.com/blog/?p=42</guid>
		<description><![CDATA[Here is what a coding session of mine looks like when I am in full swing. This is specifically the coding screen. That&#8217;s a 1920&#215;1600 resolution screen-shot . I obviously also have a browsing screen not shown. In the image above I am immersed into integrating Compass into Pinax (full post on that will follow). [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here is what a coding session of mine looks like when I am in full swing. This is specifically the coding screen. That&#8217;s a 1920&#215;1600 resolution screen-shot <img src='http://durdn.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . I obviously also have a browsing screen not shown.</p>
<p style="text-align: left;"><img class="alignnone" title="coding session" src="http://durdn.com/coding-session-xmonad.png" alt="" width="500" height="250" /></p>
<p style="text-align: left;">In the image above I am immersed into integrating <a title="Compass" href="http://compass-style.org">Compass</a> into <a href="http://pinaxproject.com">Pinax</a> (full post on that will follow).</p>
<p style="text-align: left;">When developing under Linux (<a title="Ubuntu" href="http://ubuntu.com">Ubuntu 9.04</a> at the moment) I have settled for a long time now on the ultra-productive tiling window manager <a title="Xmonad" href="http://xmonad.org">Xmonad</a>. Nothing I tried beats it. My fingers and my brain now are one with the keyboard short-cuts and the concept of mouse-less zen.</p>
<p style="text-align: left;">Yes I use <a href="http://www.vim.org/">vim</a> extensively and yes I use <a href="http://en.wikipedia.org/wiki/GNU_Screen">screen</a> with the new ubuntu <a href="http://arstechnica.com/open-source/news/2009/04/ubuntu-brings-advanced-screen-features-to-the-masses.ars">screen-profiles</a>. It rocks.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fdurdn.com%2Fblog%2F2009%2F07%2F01%2Fmy-desktop-during-an-intense-coding-session-using-xmonad%2F';
  addthis_title  = 'my+desktop+during+an+intense+coding+session+using+xmonad';
  addthis_pub    = 'durdn';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://durdn.com/blog/2009/07/01/my-desktop-during-an-intense-coding-session-using-xmonad/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>idea for a useful tool for a web entrepreneur/developer</title>
		<link>http://durdn.com/blog/2008/11/21/idea-for-a-useful-tool-for-a-web-entrepreneurdeveloper/</link>
		<comments>http://durdn.com/blog/2008/11/21/idea-for-a-useful-tool-for-a-web-entrepreneurdeveloper/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 10:52:51 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[colinux]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://durdn.com/blog/?p=39</guid>
		<description><![CDATA[This is the scenario I was thinking about: I want to interact with a graphic designer remotely, who is very very good with Photoshop and HTML/CSS but who might have trouble setting up the Linux environment needed to run my web app. What I would like to build (or find if it already exists) is [...]]]></description>
			<content:encoded><![CDATA[<p>This is the scenario I was thinking about: I want to interact with a graphic designer remotely, who is very very good with Photoshop and HTML/CSS but who might have trouble setting up the Linux environment needed to run my web app.</p>
<p>What I would like to build (or find if it already exists) is a custom CD that when inserted into a Windows or Mac OSX box does the following:</p>
<ul>
<li>Start a virtualbox/vmware instance with my Linux distribution of choice.</li>
<li>Inside the virtual machine the web app is started automatically in debug mode.</li>
<li>Proper networking is in place so that the web app is accessible to the host operating system on a specified port.</li>
<li>The template/media folder of my web app is shared via SMB with the host OS.</li>
</ul>
<p>This way the graphic designer could work on the templates/design of the application having (almost) zero knowledge of the technology behind and no access to the code.</p>
<p>I have already developed a solution like this for myself using <a href="http://colinux.org/">colinux</a>. But the process required quite some fiddling and was all but automatic. <img src='http://durdn.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Automated is the keyword.</p>
<p>That&#8217;s it.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fdurdn.com%2Fblog%2F2008%2F11%2F21%2Fidea-for-a-useful-tool-for-a-web-entrepreneurdeveloper%2F';
  addthis_title  = 'idea+for+a+useful+tool+for+a+web+entrepreneur%2Fdeveloper';
  addthis_pub    = 'durdn';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://durdn.com/blog/2008/11/21/idea-for-a-useful-tool-for-a-web-entrepreneurdeveloper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux one liner to extract email addresses from a django log file</title>
		<link>http://durdn.com/blog/2008/11/12/linux-one-liner-to-extract-email-addresses-from-a-django-log-file/</link>
		<comments>http://durdn.com/blog/2008/11/12/linux-one-liner-to-extract-email-addresses-from-a-django-log-file/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 12:01:29 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[awk xargs linux uniq]]></category>

		<guid isPermaLink="false">http://durdn.com/blog/?p=35</guid>
		<description><![CDATA[Say something bad happened and your application sent emails that it shouldn&#8217;t have (ahem who? not me&#8230;) and you want to collect the emails to apologise. So you just copied the output of a log file in a text file (wrong.txt) like the following: sending message 'Confirm email address for example.com' to email1@test1.com sending message [...]]]></description>
			<content:encoded><![CDATA[<p>Say something bad happened and your application sent emails that it shouldn&#8217;t have (ahem who? not me&#8230;) and you want to collect the emails to apologise. So you just copied the output of a log file in a text file (wrong.txt) like the following:</p>
<p><code><br />
sending message 'Confirm email address for example.com' to email1@test1.com<br />
sending message 'Confirm email address for example.com' to email2@test2.com<br />
[...]<br />
sending message 'Confirm email address for example.com' to email3@test3.com<br />
</code></p>
<p>Unix command line tools can make the job of extracting those emails and make them ready to be used in a To (or BCC) field a one liner:</p>
<p><code>cat wrong.txt | awk {'print $9'} | uniq | xargs -I{} echo -n "{},"</code></p>
<p>The result is:</p>
<p><code>email1@test1.com, email2@test2.com, [...], email3@test3.com</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fdurdn.com%2Fblog%2F2008%2F11%2F12%2Flinux-one-liner-to-extract-email-addresses-from-a-django-log-file%2F';
  addthis_title  = 'linux+one+liner+to+extract+email+addresses+from+a+django+log+file';
  addthis_pub    = 'durdn';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://durdn.com/blog/2008/11/12/linux-one-liner-to-extract-email-addresses-from-a-django-log-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

