<?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>Raim</title>
	<atom:link href="http://raim.codingfarm.de/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://raim.codingfarm.de/blog</link>
	<description>My personal front yard on the web</description>
	<lastBuildDate>Sat, 03 Jul 2010 20:31:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Checking expiry dates of SSL certificates</title>
		<link>http://raim.codingfarm.de/blog/2010/07/03/checking-expiry-dates-of-ssl-certificates/</link>
		<comments>http://raim.codingfarm.de/blog/2010/07/03/checking-expiry-dates-of-ssl-certificates/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 20:31:21 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[cronjob]]></category>
		<category><![CDATA[expiry]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[x509]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=220</guid>
		<description><![CDATA[Once again I missed the expiry date of one of the SSL certificates on my server. Therefore I am now using a cronjob to warn me early enough that a certificate is about to expire. This is the script /usr/local/bin/ssl-cert-check which checks the expiry date of the certificate files passed as arguments: #!/bin/bash DAYS=30 for [...]]]></description>
			<content:encoded><![CDATA[<p>Once again I missed the expiry date of one of the <acronym title="Secure Sockets Layer">SSL</acronym> certificates on my server. Therefore I am now using a cronjob to warn me early enough that a certificate is about to expire.</p>
<p>This is the script <code>/usr/local/bin/ssl-cert-check</code> which checks the expiry date of the certificate files passed as arguments:</p>
<pre>
#!/bin/bash

DAYS=30

for file in "$@"; do
    openssl x509 -checkend $(( 86400 * $DAYS )) -in "$file" > /dev/null
    if [ $? != 0 ]; then
        echo "==> Certificate $file is about to expire soon:"
        openssl x509 -enddate -in "$file" -noout
    fi
done
</pre>
<p>And the corresponding cronjob entry checking <acronym title="Secure Sockets Layer">SSL</acronym> certificates once a day:</p>
<pre>
6       6    * * *   root   /usr/local/bin/ssl-cert-check /etc/apache2/ssl/*.crt /etc/ssl/certs/dovecot.pem
</pre>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2010/07/03/checking-expiry-dates-of-ssl-certificates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bitlbee over SSL using stunnel</title>
		<link>http://raim.codingfarm.de/blog/2010/07/02/bitlbee-over-ssl-using-stunnel/</link>
		<comments>http://raim.codingfarm.de/blog/2010/07/02/bitlbee-over-ssl-using-stunnel/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:52:41 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bitlbee]]></category>
		<category><![CDATA[im]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[stunnel]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=155</guid>
		<description><![CDATA[What is this? I prefer IRC as communication protocol for multi-user chat and instant messaging. To keep in contact with users of other protocols/clients I use BitlBee which is a gateway connecting other chat networks like Jabber/XMPP and ICQ to your own IRC server. IRC is a well-established open protocol, but unfortunately it lacks encryption [...]]]></description>
			<content:encoded><![CDATA[<h3>What is this?</h3>
<p>I prefer <acronym title="Internet Relay Chat">IRC</acronym> as communication protocol for multi-user chat and instant messaging. To keep in contact with users of other protocols/clients I use <a href="http://bitlbee.org">BitlBee</a> which is a gateway connecting other chat networks like Jabber/<acronym title="Extensible Messaging and Presence Protocol">XMPP</acronym> and ICQ to your own <acronym title="Internet Relay Chat">IRC</acronym> server.</p>
<p><span id="more-155"></span></p>
<p><acronym title="Internet Relay Chat">IRC</acronym> is a well-established <a href="http://www.ietf.org/rfc/rfc1459.txt">open</a> protocol, but unfortunately it lacks encryption or other measures to secure the transmission of information. I don&#8217;t want to run an open BitlBee server, but password protection in plaintext is quite useless if you are in an untrusted network. Authentication should be done with a challenge-response method to avoid leaking passwords, but <acronym title="Internet Relay Chat">IRC</acronym> as a very old protocol does not offer anything like this. And again communication itself would still be unencrypted.</p>
<p>Many people use their terminal-based <acronym title="Internet Relay Chat">IRC</acronym> client <code>irssi</code> over <abbr title="Secure Shell">SSH</abbr>. This way the client runs on the same machine as <code>bitlbee</code>, so a very simple solution would be to bind the server socket to <code>localhost</code> only in this case. For me this is not an option as I am using a <abbr title="Graphical User Interface">GUI</abbr>-based <acronym title="Internet Relay Chat">IRC</acronym> client <code>xchat</code> locally.</p>
<p>Fortunately it&#8217;s possible to secure any <acronym title="Transmission Control Protocol">TCP</acronym> connection using <acronym title="Secure Sockets Layer">SSL</acronym>!</p>
<p>Unfortunately BitlBee itself does not have builtin <acronym title="Secure Sockets Layer">SSL</acronym> support for the server. But a general solution for this problem exists: <a href="http://stunnel.mirt.net/"><code>stunnel</code></a>. This program acts as a general wrapper around any stream socket based program and is often in use for <code>inetd</code> based services.</p>
<h3>Setup instructions</h3>
<p>The following instructions are for setting up <code>bitlbee</code> over <code>xinetd</code> with <code>stunnel</code> to secure the connections. Be aware that this <code>inetd</code> approach will spawn a new process for each incoming connection. This setup is not meant to serve many users at once, but works fine for personal use.</p>
<p>First we have to generate and self-sign a new certificate to be used with <acronym title="Secure Sockets Layer">SSL</acronym>:</p>
<pre>
# openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout /etc/stunnel/bitlbee.pem -out /etc/stunnel/bitlbee.pem
</pre>
<p>Usually you need to be root to write to <code>/etc/stunnel</code>. Of course you can also use a pre-existing certificate signed by a well-known <abbr title="Certificate Authority">CA</abbr> or request a new one.</p>
<p>Only <code>stunnel</code> for BitlBee needs to read the certificate file, so we will need a new user <code>bitlbee</code> for this purpose. On my Debian system the package management already added such a user, so your mileage may vary.</p>
<pre>
# adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
# chmod 700 /var/lib/bitlbee/
# chown bitlbee:bitlbee /etc/stunnel/bitlbee.pem
</pre>
<p>Then we need to set up <code>xinetd</code> to secure the connection using <code>stunnel</code>. I modified the <a href="http://bugs.bitlbee.org/bitlbee/browser/devel/doc/bitlbee.xinetd?rev=devel%2C134">basic configuration file</a> provided with the BitlBee source for this; changes are marked in bold text below. The following file should be saved as <code>/etc/xinetd.d/bitlbee</code>:</p>
<pre>
## xinetd file for BitlBee. Please check this file before using it, the
## user, port and/or binary location might be wrong.

## This file assumes you have ircd somewhere in your /etc/services, if things
## don't work, check that file first.
service ircd
{
        socket_type     = stream
        protocol        = tcp
        wait            = no

        ## You most likely want to change these two
        <strong>user            = bitlbee</strong>
        <strong>server          = /usr/bin/stunnel</strong>
        <strong>server_args     = -p /etc/stunnel/bitlbee.pem -l /usr/local/sbin/bitlbee</strong>

        ## You might want to limit access to localhost only:
        # bind            = 127.0.0.1

        ## Thanks a lot to friedman@splode.com for telling us about the type
        ## argument, so now this file can be used without having to edit
        ## /etc/services too.
        type            = UNLISTED
        port            = 6667
}
</pre>
<p>After the file is in place, <code>xinetd</code> configuration files need to be read again:</p>
<pre>
# /etc/init.d/xinetd reload
</pre>
<p>Now you should be able to connect to <code>bitlbee</code> using your favorite IRC client! Make sure you enable <acronym title="Secure Sockets Layer">SSL</acronym> for this connection. If you are using a self-signed certificate you will have to verify it, of course.</p>
<p>For bitlbee usage, you should refer to the <a href="http://www.bitlbee.org/main.php/extdoc.html">official documentation</a>. And maybe I will also write down some basic setup instructions for a closed server in the near future&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2010/07/02/bitlbee-over-ssl-using-stunnel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pastie.org shell script</title>
		<link>http://raim.codingfarm.de/blog/2010/04/06/pastie-org-shell-script/</link>
		<comments>http://raim.codingfarm.de/blog/2010/04/06/pastie-org-shell-script/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 00:53:15 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[pastie]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=148</guid>
		<description><![CDATA[I wrote a bash script to create new pastes on pastie.org. It features automatic source language selection based on the file extension and has a switch to make a private paste. $ pastie --help Usage: pastie [options] [files...] Options: -h, --help display this help -l, --lang set language of the paste -p, --private make paste [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a bash script to create new pastes on <a href="http://pastie.org">pastie.org</a>. It features automatic source language selection based on the file extension and has a switch to make a private paste.</p>
<pre>
$ pastie --help
Usage: pastie [options] [files...]

Options:
    -h, --help          display this help
    -l, --lang <lang>   set language of the paste
    -p, --private       make paste private

If --lang is not specified, this script will try to determine the type of each
file automatically based on the extension. If no files are given on the
command line it reads from standard input.
</pre>
<p>You can download it here:<br />
<a href="http://pastie.org/904797">http://pastie.org/904797</a></p>
<p>The script is public domain, so do whatever you want with it.</p>
<p>Although this is the initial release, I bumped the version number to 1.6 already. During testing the script I pasted itself several times to <a href="http://pastie.org">pastie.org</a>. I set a arbitrary higher version number to avoid confusion in case the previous pastes ever turn up in Google or wherever.</p>
<p><strong>Update:</strong><br />
Seems like their parser for shell is a bit broken and doubles the heredoc starting and ending sequences in the output. For whatever reason it appears as &#8220;&lt;&lt;END&lt;&lt;END&#8221;. Please use the <a href="http://pastie.org/904797.txt">raw version</a> for download instead of copy &#038; paste.</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2010/04/06/pastie-org-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating sum of numbers in the shell</title>
		<link>http://raim.codingfarm.de/blog/2010/03/12/calculating-sum-of-numbers-in-the-shell/</link>
		<comments>http://raim.codingfarm.de/blog/2010/03/12/calculating-sum-of-numbers-in-the-shell/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 23:13:28 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=131</guid>
		<description><![CDATA[More than one time I wanted to sum up numbers in the shell. Imagine a command producing a list of numbers like this: $ ... 42 23 966 1764 529 4711 Now calculating the sum of these numbers is not trivial. Using tools like bc or calc directly is not possible because you would need [...]]]></description>
			<content:encoded><![CDATA[<p>More than one time I wanted to sum up numbers in the shell. </p>
<p>Imagine a command producing a list of numbers like this:</p>
<blockquote><p>
<code><br />
$ ...<br />
42<br />
23<br />
966<br />
1764<br />
529<br />
4711<br />
</code>
</p></blockquote>
<p>Now calculating the sum of these numbers is not trivial. Using tools like <code>bc</code> or <code>calc</code> directly is not possible because you would need to put plus signs between the numbers first. So you could probably replace all &#8216;\n&#8217; with &#8216;+&#8217; with <code>tr</code> &mdash; but not the last one as that would lead to a syntax error later. Or as an alternative you could write a long shell construct with <code>while read ...</code> etc. In short this is just getting way too complicated for such a simple task.</p>
<p>Here is the simple solution in <code>awk</code>:</p>
<blockquote><p>
<code><br />
$ ... | awk 'BEGIN {total = 0} {total += $1} END {print total}'<br />
8035<br />
</code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2010/03/12/calculating-sum-of-numbers-in-the-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bzr shelve improved in 2.1.0</title>
		<link>http://raim.codingfarm.de/blog/2010/02/27/bzr-shelve-improved-in-2-1-0/</link>
		<comments>http://raim.codingfarm.de/blog/2010/02/27/bzr-shelve-improved-in-2-1-0/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 01:27:56 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[bzr]]></category>
		<category><![CDATA[shelve]]></category>
		<category><![CDATA[vimdiff]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=101</guid>
		<description><![CDATA[Sometimes I was a bit frustrated that bzr does not support hunk splitting during selection changes with bzr shelve, as does git commit --interactive. Now with bzr 2.1.0 there is a new option available to launch an external editor to shelve changes as you like. Just add the option change_editor to your ~/.bazaar/bazaar.conf in the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I was a bit frustrated that bzr does not support hunk splitting during selection changes with <code>bzr shelve</code>, as does <code>git commit --interactive</code>. Now with bzr 2.1.0 there is a new option available to launch an external editor to shelve changes as you like.</p>
<p>Just add the option <code>change_editor</code> to your ~/.bazaar/bazaar.conf in the <code>[DEFAULT]</code> section.</p>
<p>For example:</p>
<blockquote><p><code><br />
[DEFAULT]<br />
change_editor = vimdiff -f @new_path @old_path</code></p></blockquote>
<p>Alternatively, you can of course use <code>meld</code> or <code>kdiff3</code> as well as <code>change_editor</code>, which will be a lot easier to use for beginners.</p>
<p>The placeholder @new_path will automatically be replaced with the path of the new version and @old_path with the path of the old version. With this configuration, there will be a new choice &#8220;<code>e</code>&#8221; during shelve:</p>
<blockquote><p><code>...<br />
Shelve? [yN<strong>e</strong>fq?]</code></p></blockquote>
<p>Entering &#8220;<code>e</code>&#8221; will start vimdiff in a two column view with the new version to the left and the old version to the right. You should read <code>:help diff</code> in vim to get more information about this mode. Basically you can obtain changes from the other buffer using <code><strong>do</strong></code> (&#8220;diff obtain&#8221;) and put changes to the other buffer using <code><strong>dp</strong></code> (&#8220;diff put&#8221;). Note that the old version on the right will be read-only and you are not supposed to change it. Also do not make unrelated changes or introduce new differences as that will result in conflicts on <code>bzr unshelve</code> later.</p>
<p>When you are fine with the changes exit the editor with <code>:wqa</code>. After confirming the shelve once more, you will see the left file as the new version in the working tree and every difference to the right file will be shelved.</p>
<p>Unfortunately this is <a href="https://bugs.launchpad.net/bzr/+bug/517660">not yet documented</a> in bzr itself at the time of this writing.</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2010/02/27/bzr-shelve-improved-in-2-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I like bzr better than git</title>
		<link>http://raim.codingfarm.de/blog/2009/09/02/why-i-like-bzr-better-than-git/</link>
		<comments>http://raim.codingfarm.de/blog/2009/09/02/why-i-like-bzr-better-than-git/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 22:20:29 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[bzr]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=57</guid>
		<description><![CDATA[Many people I know are using git as VCS and like it a lot. Although I used git in the past and still use it from time for time for some open source stuff, I was never a part of the hype on promoting git and bashing bzr. Instead, after too much struggling with git, [...]]]></description>
			<content:encoded><![CDATA[<p>Many people I know are using git as VCS and like it a lot. Although I used git in the past and still use it from time for time for some open source stuff, I was never a part of the hype on <a href="http://whygitisbetterthanx.com/">promoting git</a> and <a href="http://whybzrisbetterthanx.github.com/">bashing bzr</a>.</p>
<p>Instead, after too much struggling with <a href="http://git-scm.com">git,</a> I totally turned to <a href="http://bazaar-vcs.org/">bzr</a> now. Why? Now that&#8217;s what this post is about.</p>
<p><span id="more-57"></span></p>
<h3>Supporting multiple workflows</h3>
<p>One cannot deny that git is very successful in what it does. But let&#8217;s take a look back in the history how git has been started all. At first it has been written as a management tool for the Linux kernel development. The first goal was to create a fast distributed version control system, which was met very early. Back then it was only usable for technical aware people (see the man page, it still calls git <em>the stupid content tracker</em>).</p>
<p>Later on, git has been improved a lot and became easier to use. But what stayed was the Linux centric view of development. Therefore, git has good support for a distributed workflow as it is used in Linux kernel development, but nothing more. So if you want to use git productively in a team you have to adopt this workflow, which is entirely based on a hierarchy of pull operations. The main developer pulls from fellow developers, those again pull from below and so on.</p>
<p>With bzr instead, you have the choice how you want to work. There is more than one workflow and it is possible to use them all. Of course you can do the same with bzr as with git, setting up a pull-based distributed system. But bzr also supports working in centralized ways. You can bind your local <a href="http://bazaar-vcs.org/Branch">branch</a> to another remote branch. Every time you commit, it will automatically be submitted to the <a href="http://bazaar-vcs.org/BzrUsingBoundBranches">bound branch</a>. This is also sometimes called a <a href="http://bazaar-vcs.org/Checkout">checkout</a>. A branch contains the full history which will be available for local operations after pulling from remote. Additionally there are lightweight checkouts, where the branch is not in the same location as the checkout and therefore requires access to the branch for almost all operations. But compared with branching a lightweight checkout is a very fast operation and requires less network traffic.</p>
<p>Supporting centralized workflows makes it easier to convert existing projects and infrastructures from CVS/SVN to bzr. There is not much training required for the developers as it works nearly the same as their old system after initial setup.</p>
<h3>Each branch has its own tree</h3>
<p>As we are talking about workflows this is the next point. A <code> git clone</code> can fetch a lot of different branches. All live in the same directory and if you want to view another one you need to use <code>git checkout &lt;branchname&gt;</code>. You cannot compare files in branches in a simple way with external tools, you always have to use <code>git diff</pre>
<p> (or rather <code>git difftool</code>) which operates on temporary files which means you are unable to edit files right there.</p>
<p>Always seeing only one branch at a time is quite a limited view on the code management infrastructure. Also, if you already made local changes on a branch it might be impossible to switch to another as the changes do not apply there. Therefore you need to hide your changes with <code>git stash</code>before switching the branch.</p>
<p>With bzr this is totally different. The main point is that bzr only operates on branches. So you only get one branch when you use the <code>bzr branch</code> command. If you want to also have another branch, use the command again on another branch URL. By default, every branch has its own history storage and associated checkout. If you want to save some disk space, you can create a shared repository with <code>bzr init-repo</code> in the directory which is supposed to hold the branches. If applicable, all branches will share the same storage in this directory.</p>
<p>Having the branches side-by-side makes it a lot easier to compare branches and make edits based on diff reviews. As branches will always be available, you never have to switch between them. Therefore, you do not have to <code>stash</code> changes in bzr  just to view another branch and you will never forget to apply stashed changes after you switched around.</p>
<h3>Semantic revision IDs</h3>
<p>With git, revisions are identified with a SHA1 checksum. I totally dislike this approach, as it takes all semantics out of the identifier. First of all, the revision id is very long. Yes, you can shorten it to the relevant part only. But still this is not human-readable and cumbersome to type. Bzr just uses incrementing numbers, which is much easier to recognize and remember.</p>
<p>With checksums as revision identifiers you loose any time information. For example if a developer using git tells you, a bug has been fixed in <em>df3b2e</em>, the latest release is <em>f9a4c2</em> and HEAD is <em>6ec4b8</em> you have no idea at all if this revision would be in this release or how long this has been fixed. Now, with bzr this would be: a bug has been fixed in <em>r367</em>, the latest release is <em>r314</em> and HEAD is <em>r371</em>. So you know immediately that this fix cannot be part of the latest release and is relatively new on the branch.</p>
<p>For more information read on at <a href="http://doc.bazaar-vcs.org/bzr.dev/en/user-guide/index.html#understanding-revision-numbers">Understanding revision numbers</a> in the Bazaar User Guide.</p>
<h3>Hierarchical history</h3>
<p>With git, all your history is flat. If you do a merge you see a message in the log that you did a merge and which HEADs where merged. But you cannot see what exactly has been merged.</p>
<p>Using bzr, merges always create a hierarchy. That means if you work on a feature in a seperate branch and you finally merge it, you will see the merge message in the log, and below that all the commit you did on the other branch. Your history is a hierarchy of changes  This means you have all the changes for this feature grouped together which makes it a lot easier to figure out why a specific commit has been done.</p>
<p>There is also a <a href="http://doc.bazaar-vcs.org/bzr.dev/en/user-guide/index.html#hierarchical-history-is-good">nice example</a> in the Bazaar User Guide.</p>
<h3>Serving a branch is uncomplicated</h3>
<p>Did you every try to let others pull from your git branch? Either you need to run git-daemon or run a even more complicated setup using ssh. As a side note, I believe that's why github became so popular, sharing a repository with git is just too difficult to set it up yourself...</p>
<p>With bzr, just drop the branch in your htdocs directory of the webserver and give others a HTTP URL. No special configuration required, no extra daemon. Bzr only needs to transfer regular files for read-only access. Also works the same with FTP. Easy as 1,2,3. But of course you can still run a standalone bzr server or ssh-based setups for better performance and to allow others to write as well.</p>
<h3>Plugins and Aliases</h3>
<p>One of the most powerful features of bzr is the modularization. Plugins can define new commands and or extend existing commands with new functionality. And there are lots of plugins available, e.g. graphical user interfaces using GTK+ or Qt, import/export to other VCS systems, statistic tools and <a href="http://bazaar-vcs.org/BzrPlugins">more</a>. This keeps the main codebase small and clean, but still you can get all the functionality and features you want.</p>
<p>Additionally, you can redefine the meaning of every command in bzr using a simple configuration file. Want always to see the diff in the log message editor? Just add <em>ci = ci --show-diff</em>. You can also add new commands that way. Customize it the way you like so it fits in your workflow.</p>
<h3>Library Interfaces</h3>
<p>As we talk about custom commands and aliases, we have a main problem of git. The main interface of git is the command line interface. It is used both for user interaction and automation which is why you have to cut back on that and cannot customize it the way you are able with bzr.</p>
<p>As bzr is written in python it offers a module named <em>bzrlib</em>, which can be used for integration into IDEs, Editors and other tools. Bindings for other languages exist as well.</p>
<h3>Gun safety</h3>
<p>Most important for me is safety of the commands I am executing. With git I got several times to the point where I just deleted the repository to start over. Happened a lot of times as I tried to merge stuff together, as git assumes by default it did the right thing and implicitly commits merges without user review. Maybe I am just not experienced enough with git, but with bzr it is way more harder to shot yourself in the foot.</p>
<h3>Conclusion</h3>
<p>So much for my experiences and the things I like about bzr. I know that some of you will now comment that I could this and that in various ways with git... But the point for me is: if I obviously couldn't figure out how to do it with git and I had the <strong>just works</strong> experience with bzr, why should I ever go back?</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2009/09/02/why-i-like-bzr-better-than-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hiding MOTD on bash startup</title>
		<link>http://raim.codingfarm.de/blog/2009/05/03/hiding-motd-on-bash-startup/</link>
		<comments>http://raim.codingfarm.de/blog/2009/05/03/hiding-motd-on-bash-startup/#comments</comments>
		<pubDate>Sun, 03 May 2009 16:08:33 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[motd]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=49</guid>
		<description><![CDATA[Usually bash displays /etc/motd at the time of last login on opening a new shell. I do not find that information very useful, as I am opening new shells a lot, so the time does not really mean anything for me. Also, the MOTD rarely changes. There is a feature in bash to hide these [...]]]></description>
			<content:encoded><![CDATA[<p>Usually bash displays <code>/etc/motd</code> at the time of last login on opening a new shell. I do not find that information very useful, as I am opening new shells a lot, so the time does not really mean anything for me. Also, the MOTD rarely changes.</p>
<p>There is a feature in bash to hide these messages by creating a file <code>~/.hushlogin</code>. This will make bash jump right to the first prompt without any output before.</p>
<p>But just in case the MOTD changes and includes important messages, I enhanced this setup a little bit. Instead of just touching the <code>.hushlogin</code> file, I am storing the old MOTD in it. At startup the old and current MOTD is compared against each other and will be displayed only if it differs. To avoid accidentally missing the MOTD, bash will also ask for my confirmation that I have read it.</p>
<p>Here is the snippet from my <code>~/.bashrc</code>:</p>
<pre>
# Show motd only if necessary
cmp -s $HOME/.hushlogin /etc/motd
if [ $? != 0 ]; then
    echo -e "\n==> !!! IMPORTANT: /etc/motd changed !!! <==\n"
    cat /etc/motd
    echo -e "\n==> !!! IMPORTANT: /etc/motd changed !!! <==\n"
    read -e -n 1 -p "Show again? (Y/n) " ans
    if [ "$ans" == "n" ]; then
        cat /etc/motd > $HOME/.hushlogin
    fi
fi
</pre>
<p><strong>Please note:</strong> If you are going to use this, make sure it will not get executed on non-interactive shells. Otherwise it can break tools like scp, sftp or rsync. To ensure this will not be used on non-interactive shells, I am using this conditional at the top of my <code>~/.bashrc</code>:</p>
<pre>
if [[ $- != *i* ]] ; then
    # Shell is non-interactive.  Be done now!
    return
fi
</pre>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2009/05/03/hiding-motd-on-bash-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion diff commands</title>
		<link>http://raim.codingfarm.de/blog/2009/03/17/subversion-diff-commands/</link>
		<comments>http://raim.codingfarm.de/blog/2009/03/17/subversion-diff-commands/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 10:58:36 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=28</guid>
		<description><![CDATA[Subversion allows to use a custom command for displaying diffs using svn diff --diff-cmd &#60;cmd&#62;. I have been using diff-cmd=colordiff in my ~/.subversion/config for quite some time now. This is really useful, but occasionally I would also like to use vimdiff to get a nice side-by-side diff. Although this sounds quite easy at first, there [...]]]></description>
			<content:encoded><![CDATA[<p>Subversion allows to use a custom command for displaying diffs using <code>svn diff --diff-cmd &lt;cmd&gt;</code>. I have been using <code>diff-cmd=colordiff</code> in my <i>~/.subversion/config</i> for quite some time now. This is really useful, but occasionally I would also like to use vimdiff to get a nice side-by-side diff.</p>
<p>Although this sounds quite easy at first, there are some hurdles. Subversion expects the given command to adhere to the GNU diff parameters, that means it expects it to understand and parse the labels it passes before the actual filenames. This works fine for colordiff, but not vimdiff which only wants the old and new filenames.</p>
<p>For a better diff experience with svn, I set up the following shell function which let&#8217;s me choose the program I want to use for diffing.</p>
<p>First, I need a new wrapper script at <i>~/libexec/svndiff</i> which takes the actual diff program as first option, ignores the GNU diff labels and calls that program passing old and new filename.</p>
<pre>
#!/bin/bash
BIN=$1
shift 5
$BIN "$@"
</pre>
<p>Then I define this shell alias in my <i>~/.bashrc</i> to extend the functionality of the svn command:</p>
<pre>
function svn() {
    case "$1" in
        diff-plain)
            shift;
            `which svn` diff --diff-cmd diff $@
            ;;
        diff-color)
            shift;
            `which svn` diff --diff-cmd colordiff $@
            ;;
        diff-vim)
            shift;
            `which svn` diff --diff-cmd $HOME/libexec/svndiff -x vimdiff $@
            ;;
        diff-filemerge)
            shift;
            `which svn` diff --diff-cmd $HOME/libexec/svndiff -x opendiff $@
            ;;
        *)
            `which svn` $@
            ;;
    esac
}
</pre>
<p>Now I can choose the program I find best suited for the current task in a very simplified manner, for example <code>svn diff-vim -c1337</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2009/03/17/subversion-diff-commands/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>X-Chat Aqua for Mac OS X</title>
		<link>http://raim.codingfarm.de/blog/2009/01/21/x-chat-aqua-for-mac-os-x/</link>
		<comments>http://raim.codingfarm.de/blog/2009/01/21/x-chat-aqua-for-mac-os-x/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 15:14:35 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[xchat]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=6</guid>
		<description><![CDATA[X-Chat Aqua is a very nice IRC client for Mac OS X, but the latest version for download on their website is way out of date and a few years old. A while ago libc volunteered to import the old CVS into a new SVN repository and started development on it again. So the version [...]]]></description>
			<content:encoded><![CDATA[<p>X-Chat Aqua is a very nice IRC client for Mac OS X, but the latest version for download on <a href="http://xchataqua.sourceforge.net/">their website</a> is way out of date and a few years old.</p>
<div id="attachment_15" class="wp-caption alignright" style="width: 310px"><a href="http://raim.codingfarm.de/blog/wp-content/uploads/2009/01/xchataqua-2009-01-21.png"><img class="size-medium wp-image-15" title="xchataqua-2009-01-21" src="http://raim.codingfarm.de/blog/wp-content/uploads/2009/01/xchataqua-2009-01-21-300x190.png" alt="X-Chat Aqua screenshot" width="300" height="190" /></a><p class="wp-caption-text">X-Chat Aqua screenshot</p></div>
<p>A while ago <a href="http://sourceforge.net/users/libc/">libc</a> volunteered to import the old CVS into a new SVN repository and started development on it again. So the version in SVN is now based on xchat 2.8.x, but there are still no binaries available.</p>
<p>Therefore I just put together my own build and I am also offering it as a <a href="http://raim.codingfarm.de/downloads/xchataqua-2009-01-21.tar.gz">download</a> for everyone. The application bundle contains an Universal binary for both PowerPC and x86, while I was only able to test them on Leopard.</p>
<p>Additionally, I also replaced the default X-Chat icon with <a href="http://www.rmfernandez.com/Xchat/xchat.html">a modern one</a> provided by <a href="http://sourceforge.net/users/ernande/">Ryan Fernandez</a>.</p>
<p>Download X-Chat Aqua: <a href="http://raim.codingfarm.de/downloads/xchataqua-2009-01-21.tar.gz">xchataqua-2009-01-21.tar.gz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2009/01/21/x-chat-aqua-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>History meme (2)</title>
		<link>http://raim.codingfarm.de/blog/2008/06/09/history-meme-2/</link>
		<comments>http://raim.codingfarm.de/blog/2008/06/09/history-meme-2/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:29:26 +0000</pubDate>
		<dc:creator>Rainer Müller</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[history meme]]></category>

		<guid isPermaLink="false">http://raim.codingfarm.de/blog/?p=5</guid>
		<description><![CDATA[$ history&#124;awk '{print $2}'&#124;sort &#124;uniq -c&#124;sort -rn&#124;head 1134 vim 791 make 516 port 508 svn 305 sudo 283 cd 127 la 124 man 116 wcgrep 103 ./lcs-bottom-up Some explanations: lcs-bottom-up is an implementation of LCS I needed for a talk For other explanations follow the history-meme tag.]]></description>
			<content:encoded><![CDATA[<p><code>$ history|awk '{print $2}'|sort |uniq -c|sort -rn|head<br />
1134 vim<br />
791 make<br />
516 port<br />
508 svn<br />
305 sudo<br />
283 cd<br />
127 la<br />
124 man<br />
116 wcgrep<br />
103 ./lcs-bottom-up</code></p>
<p><span id="more-5"></span>Some explanations:</p>
<ul>
<li><strong>lcs-bottom-up</strong> is an implementation of <a href="http://en.wikipedia.org/wiki/Longest_common_subsequence_problem">LCS</a> I needed for a talk</li>
</ul>
<p>For other explanations follow the <a href="/blog/tag/history-meme/">history-meme</a> tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://raim.codingfarm.de/blog/2008/06/09/history-meme-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
