<?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>/kb</title>
	<atom:link href="http://grx.no/kb/feed/" rel="self" type="application/rss+xml" />
	<link>http://grx.no/kb</link>
	<description>personal knowledgebase</description>
	<lastBuildDate>Wed, 15 Jun 2011 07:07:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Google Data API: Unsupported browser.  Continue at your own risk.</title>
		<link>http://grx.no/kb/2011/06/13/google-data-api-unsupported-browser-continue-at-your-own-risk/</link>
		<comments>http://grx.no/kb/2011/06/13/google-data-api-unsupported-browser-continue-at-your-own-risk/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 10:42:48 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gdata]]></category>
		<category><![CDATA[google data api]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=210</guid>
		<description><![CDATA[Opera is not officially supported in the Google Data API and the following error message is thrown as an alert(!) when loading the API: Unsupported browser. Continue at your own risk. Remove the error message by sending an empty anonymous function to the init method: google.gdata.client.init(function() {}); var service = new google.gdata.calendar.CalendarService('my-calendar'); Ref. Google Data [...]]]></description>
			<content:encoded><![CDATA[<p>Opera is not officially supported in the Google Data API and the following error message is thrown as an alert(!) when loading the API: <code>Unsupported browser.  Continue at your own risk. </code></p>
<p>Remove the error message by sending an empty anonymous function to the init method:</p>
<pre>
<strong>google.gdata.client.init(function() {});</strong>
var service = new google.gdata.calendar.CalendarService('my-calendar');
</pre>
<p>Ref. <a href="http://code.google.com/apis/gdata/docs/js.html#Request_Feed_Unauthenticated">Google Data API Documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2011/06/13/google-data-api-unsupported-browser-continue-at-your-own-risk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Translation of Django Core</title>
		<link>http://grx.no/kb/2010/08/07/translation-of-django-core/</link>
		<comments>http://grx.no/kb/2010/08/07/translation-of-django-core/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 19:31:27 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=202</guid>
		<description><![CDATA[cd django_trunk svn update # Generate .po files: bin/django-admin.py makemessages -l nn bin/django-admin.py makemessages -d djangojs -l nn cd conf/locale/nn/LC_MESSAGES Edit .po files. Search for text string fuzzy and empty double quotes (&#8220;&#8221;) to find untranslated strings. Finally, create diffs: svn diff django.po &#62; nn-django-translation-update.diff svn diff djangojs.po &#62; nn-djangojs-translation-update.diff]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> django_trunk
<span style="color: #c20cb9; font-weight: bold;">svn</span> update
<span style="color: #666666; font-style: italic;"># Generate .po files:</span>
bin<span style="color: #000000; font-weight: bold;">/</span>django-admin.py makemessages <span style="color: #660033;">-l</span> nn 
bin<span style="color: #000000; font-weight: bold;">/</span>django-admin.py makemessages <span style="color: #660033;">-d</span> djangojs <span style="color: #660033;">-l</span> nn
<span style="color: #7a0874; font-weight: bold;">cd</span> conf<span style="color: #000000; font-weight: bold;">/</span>locale<span style="color: #000000; font-weight: bold;">/</span>nn<span style="color: #000000; font-weight: bold;">/</span>LC_MESSAGES</pre></div></div>

<p>Edit .po files. Search for text string fuzzy and empty double quotes (&#8220;&#8221;) to find untranslated strings.</p>
<p>Finally, create diffs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">diff</span> django.po <span style="color: #000000; font-weight: bold;">&gt;</span> nn-django-translation-update.diff
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">diff</span> djangojs.po <span style="color: #000000; font-weight: bold;">&gt;</span> nn-djangojs-translation-update.diff</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/08/07/translation-of-django-core/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH aliases</title>
		<link>http://grx.no/kb/2010/06/18/ssh-aliases/</link>
		<comments>http://grx.no/kb/2010/06/18/ssh-aliases/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:02:56 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=198</guid>
		<description><![CDATA[In ~/.ssh/config add the following: Host ALIAS HostName DOMAIN User USERNAME Port PORT_NUMBER]]></description>
			<content:encoded><![CDATA[<p>In <code>~/.ssh/config</code> add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">Host ALIAS
HostName DOMAIN
User USERNAME
Port PORT_NUMBER</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/06/18/ssh-aliases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile Vim in Snow Leopard</title>
		<link>http://grx.no/kb/2010/04/28/compile-vim-in-snow-leopard/</link>
		<comments>http://grx.no/kb/2010/04/28/compile-vim-in-snow-leopard/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 09:01:58 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Editors]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=196</guid>
		<description><![CDATA[./configure &#8211;enable-pythoninterp &#8211;with-macsdk=10.6 via Chris Moyer: OSX, Vim, and Python.]]></description>
			<content:encoded><![CDATA[<p>./configure &#8211;enable-pythoninterp &#8211;with-macsdk=10.6</p>
<p>via <a href="http://blog.coredumped.org/2010/01/osx-vim-and-python.html">Chris Moyer: OSX, Vim, and Python</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/04/28/compile-vim-in-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git: Start a new branch after making changes</title>
		<link>http://grx.no/kb/2010/04/23/git-start-a-new-branch-after-making-changes/</link>
		<comments>http://grx.no/kb/2010/04/23/git-start-a-new-branch-after-making-changes/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 10:39:39 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=189</guid>
		<description><![CDATA[Sometimes I realize that my latest changes actually should belong to another branch than the one I&#8217;m currently working on. The easy way to add the changes to a new branch is to use the stash command. &#91;… changes …&#93; git stash git stash branch name_of_new_branch git commit &#91;…&#93; git push origin name_of_new_branch Ref. git [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I realize that my latest changes actually should belong to another branch than the one I&#8217;m currently working on. The easy way to add the changes to a new branch is to use the <code>stash</code> command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>… changes …<span style="color: #7a0874; font-weight: bold;">&#93;</span>
git stash
git stash branch name_of_new_branch
git commit <span style="color: #7a0874; font-weight: bold;">&#91;</span>…<span style="color: #7a0874; font-weight: bold;">&#93;</span>
git push origin name_of_new_branch</pre></div></div>

<p>Ref. <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html"><code>git stash</code></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/04/23/git-start-a-new-branch-after-making-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Translation of Django Apps</title>
		<link>http://grx.no/kb/2010/03/04/translation-of-django-apps/</link>
		<comments>http://grx.no/kb/2010/03/04/translation-of-django-apps/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:50:43 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=178</guid>
		<description><![CDATA[I recently created a Django app that needed translation of the Django administration. It took some googling and messing around to make it work, so this quick and dirty walkthrough will hopefully be helpful for others. Here&#8217;s how I did it: Add translations for all model fields: class Stuff&#40;models.Model&#41;: title = models.CharField&#40;_&#40;'title'&#41;, max_length=255&#41; the_other_model = [...]]]></description>
			<content:encoded><![CDATA[<p>I recently created a Django app that needed translation of the Django administration. It took some googling and messing around to make it work, so this quick and dirty walkthrough will hopefully be helpful for others. </p>
<p>Here&#8217;s how I did it:</p>
<p>Add translations for all model fields:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Stuff<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    title = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>_<span style="color: black;">&#40;</span><span style="color: #483d8b;">'title'</span><span style="color: black;">&#41;</span>, max_length=<span style="color: #ff4500;">255</span><span style="color: black;">&#41;</span>
    the_other_model = model.<span style="color: black;">ForeignKey</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'othermodel'</span>, verbose_name=_<span style="color: black;">&#40;</span><span style="color: #483d8b;">'the other model'</span><span style="color: black;">&#41;</span>, verbose_name_plural=_<span style="color: black;">&#40;</span><span style="color: #483d8b;">'the other models'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">class</span> Meta:
      verbose_name = _<span style="color: black;">&#40;</span><span style="color: #483d8b;">'stuff'</span><span style="color: black;">&#41;</span>
      verbose_name_plural = _<span style="color: black;">&#40;</span><span style="color: #483d8b;">'stuffs'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Then the language (.po) files must be created:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> locale
python manage.py makemessages <span style="color: #660033;">-l</span> LANG_CODE</pre></div></div>

<p>Then edit your language files in <code>locale/<strong>_LANGUAGE_</strong>/LC_MESSAGES/django.po</code>.  When you&#8217;ve finished editing the language file must be compiled:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python manage.py compilemessages</pre></div></div>

<p>If you want to translate app names as well, you can add something like this to your project <code>__init__.py</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">utils</span>.<span style="color: black;">translation</span> <span style="color: #ff7700;font-weight:bold;">import</span> ugettext_lazy <span style="color: #ff7700;font-weight:bold;">as</span> _
&nbsp;
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'auth'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'configuration'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'sites'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'appname'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Auth'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Configuration'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Sites'</span><span style="color: black;">&#41;</span>
_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Appname'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This feels like a dirty hack but I couldn&#8217;t find any other way to do it.</p>
<p>Source: <a href="http://docs.djangoproject.com/en/dev/topics/i18n/">Django documentation &#8211; Internationalization and localization</a>, and some Google Groups thread that I can&#8217;t find right now, for the app name translation.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/03/04/translation-of-django-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install PIL (Python Imaging Library) in Leopard</title>
		<link>http://grx.no/kb/2010/02/07/install-pil-python-imaging-library-in-leopard/</link>
		<comments>http://grx.no/kb/2010/02/07/install-pil-python-imaging-library-in-leopard/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 11:09:32 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac os]]></category>
		<category><![CDATA[pil]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=175</guid>
		<description><![CDATA[Installing modules when using pip, virtualenv and virtualenvwrapper is a breeze, but it took some time before I realized what was the easiest way to install PIL. I do it this way: pip -E PATH_TO_VIRTUALENV install http://dist.repoze.org/PIL-1.1.6.tar.gz This installs a slightly repackaged version of PIL. The latest PIL version is 1.1.7, but as far as [...]]]></description>
			<content:encoded><![CDATA[<p>Installing modules when using pip, virtualenv and virtualenvwrapper is a breeze, but it took some time before I realized what was the easiest way to install PIL.</p>
<p>I do it this way:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pip <span style="color: #660033;">-E</span> PATH_TO_VIRTUALENV <span style="color: #c20cb9; font-weight: bold;">install</span> http:<span style="color: #000000; font-weight: bold;">//</span>dist.repoze.org<span style="color: #000000; font-weight: bold;">/</span>PIL-1.1.6.tar.gz</pre></div></div>

<p>This installs <a href="http://pypi.python.org/pypi/PIL/1.1.6">a slightly repackaged</a> version of PIL. The latest PIL version is 1.1.7, but as far as I know it&#8217;s not available in this form.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/02/07/install-pil-python-imaging-library-in-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exclude several files or directories from tar</title>
		<link>http://grx.no/kb/2009/08/09/exclude-several-files-or-directories-from-tar/</link>
		<comments>http://grx.no/kb/2009/08/09/exclude-several-files-or-directories-from-tar/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 14:08:34 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=172</guid>
		<description><![CDATA[It&#8217;s very useful to be able to exclude certain files or directories when using tar. Here&#8217;s how I did in Leopard: tar czvf FILENAME.tgz --exclude=&#123;.svn,wiki*,static&#125; FILES_OR_DIRS_TO_TAR]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very useful to be able to exclude certain files or directories when using tar. Here&#8217;s how I did in Leopard:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> czvf FILENAME.tgz <span style="color: #660033;">--exclude</span>=<span style="color: #7a0874; font-weight: bold;">&#123;</span>.svn,wiki<span style="color: #000000; font-weight: bold;">*</span>,static<span style="color: #7a0874; font-weight: bold;">&#125;</span> FILES_OR_DIRS_TO_TAR</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2009/08/09/exclude-several-files-or-directories-from-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passwordless login with MacFusion</title>
		<link>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/</link>
		<comments>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:28:22 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macfusion]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=169</guid>
		<description><![CDATA[Put a reference to the private key file in ~/.ssh/config, for example: IdentityFile ~/.ssh/id_rsa Source: FAQS.org]]></description>
			<content:encoded><![CDATA[<p>Put a reference to the private key file in <code>~/.ssh/config</code>, for example:</p>
<pre>
IdentityFile ~/.ssh/id_rsa
</pre>
<p>Source: <a href="http://www.faqs.org/docs/securing/chap15sec121.html">FAQS.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make SSHKeychain work in Leopard</title>
		<link>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/</link>
		<comments>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:43:03 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac os]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshkeychain]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=164</guid>
		<description><![CDATA[Here&#8217;s how I set up SSHKeychain on my Mac: Modify the package content as described Add stuff to .bashrc/.profile Add keys to SSHKeychain: Preferences > SSH Keys Check Manage (and modify) global environment variables (this probably has no effect, ref 2.)]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I set up <a href="http://www.sshkeychain.org/">SSHKeychain</a> on my Mac:</p>
<ol>
<li><a href="http://samj.net/2008/06/sshkeychain-082-post-install-problem-on.html">Modify the package content as described<br />
</a></li>
<li><a href="http://sportsdaft.blogspot.com/2008/04/getting-sshkeychain-to-work-on-leopard.html">Add stuff to .bashrc/.profile</a></li>
<li>Add keys to SSHKeychain: Preferences > SSH Keys</li>
<li>Check Manage (and modify) global environment variables (this probably has no effect, ref 2.)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

