<?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>Klaus Kiwi's blog</title>
	<atom:link href="http://blog.klauskiwi.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.klauskiwi.com</link>
	<description>A lazy, sparsely populated web storage for brain dumps</description>
	<lastBuildDate>Thu, 02 Sep 2010 12:00:46 +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>My talk for LinuxCon Brazil 2010 (KVM Security)</title>
		<link>http://blog.klauskiwi.com/archives/91</link>
		<comments>http://blog.klauskiwi.com/archives/91#comments</comments>
		<pubDate>Thu, 02 Sep 2010 12:00:46 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linuxcon]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=91</guid>
		<description><![CDATA[I&#8217;m back from LinuxCon Brazil 2010. After spending two entire days off-line (interesting experience btw), I can finally upload the slide deck for my talk, &#8220;KVM Security &#8211; Where Are We At, Where Are We Going&#8221;, as promised. I can&#8217;t spend time reporting on the event right now, so I&#8217;ll just summarize that it was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m back from LinuxCon Brazil 2010. After spending two entire days off-line (interesting experience btw), I can finally upload the slide deck for my talk, <a href="http://blog.klauskiwi.com/wp-content/uploads/2010/08/KVM-Security_en.pdf">&#8220;KVM Security &#8211; Where Are We At, Where Are We Going&#8221;</a>, as promised.</p>
<p>I can&#8217;t spend time reporting on the event right now, so I&#8217;ll just summarize that it was in my opinion the best Linux-related even we had down here so far, with some good talks from both local and foreigner guys.</p>
<p>The funniest part, however, was seeing Linus having it&#8217;s own Justin Bieber moment, with girls freaking out and everything <img src='http://blog.klauskiwi.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Thanks for everyone who attended. I hope we can all meet again next year for an even better event.</p>
<p><em>PS.: I ended-up canceling the Linux Professional Development BoF, due to confusions with scheduling and a couple of other things &#8211; Sorry for everyone who planned to attend, but keep in touch (comment here or email me at klaus@klauskiwi.com) &#8211; I still have the idea of at least mapping the Linux professional development industry here in Brazil. We need better know each other, really!</em></p>
<p>-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/91/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New opencryptoki release available</title>
		<link>http://blog.klauskiwi.com/archives/89</link>
		<comments>http://blog.klauskiwi.com/archives/89#comments</comments>
		<pubDate>Wed, 18 Aug 2010 13:53:44 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[2.3.2]]></category>
		<category><![CDATA[opencryptoki]]></category>
		<category><![CDATA[pkcs#11]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=89</guid>
		<description><![CDATA[I just now found the time to write about the latest opencryptoki version, which was released just over two weeks ago. Opencryptoki version 2.3.2 was released roughly 6 months after 2.3.1, and brings a series or improvements and bug fixes: Improved performance when handling many sessions or many session objects. An inefficient walk through a [...]]]></description>
			<content:encoded><![CDATA[<p>I just now found the time to write about the latest <a href="http://sourceforge.net/projects/opencryptoki/">opencryptoki</a> version, which was released just over two weeks ago.</p>
<p><a href="http://sourceforge.net/projects/opencryptoki/files/opencryptoki/2.3.2/">Opencryptoki version 2.3.2</a> was released roughly 6 months after 2.3.1, and brings a series or improvements and bug fixes:</p>
<ul>
<li>Improved performance when handling many sessions or many session objects. An inefficient walk through a linked-list was part of the validation step for every operation involving session or object handles. While still lacking a more efficient data-structure, we where able to use the pointers themselves as handles, thus making the look-up in linear time as opposed to exponential time as it were. This improvement has significant impact for scenarios where a single process had more than 4000 sessions at once. Although we are still able to do some verification, this change may also expose buggy applications which may crash if trying to use invalid handles, so be advised.</li>
<li>Largely rewritten build scripts. This version went through a much needed refactor for the autoconf/automake build scripts, in the hope of having now a clearer and less error-prone build procedure.</li>
<li>New SPEC file for building RPM packages. The Opencryptoki binaries are now split into different sub-packages: the main <em>opencryptoki</em> package now brings only the slot daemon (pkcsslotd, initialization script) and administration utilities (pkcsconf, pkcs11_setup). The <em>opencryptoki-libs</em> package brings the PKCS#11 library itself. The packages <em>opencryptoki-swtok</em>, <em>opencryptoki-tpmtok</em>, <em>opencryptoki-icatok</em> and <em>opencryptoki-ccatok</em> bring token-specific plug-ins (aka STDLLs) that enables support for different kinds of crypto hardware. This way, the System Administrator can now choose to install only what&#8217;s necessary for his/her environment.</li>
<li>A nice addition by <em>Kent Yoder</em> that allows pkcsconf to display mechanisms names instead of only numeric identifiers</li>
<li><em>Kent</em> also provided a couple of fixes to the software token (inaccuracies in mechanism list) and testcases</li>
<li>A couple of useful additions/fixes related to init-scripts and pkcsconf by ﻿<em>Dan Horák</em></li>
<li>A number of RSA fixes and improvements by <em>Ramon de Carvalho Valle</em>, including an endianess bug in key-pair generation for the software token and improved PKCS#1 v1.5 padding functions.</li>
</ul>
<p>As for the next version, we&#8217;re having a strong focus on making the testsuite better. You can follow the development log <a href="http://opencryptoki.git.sourceforge.net/git/gitweb.cgi?p=opencryptoki/opencryptoki;a=log">here</a>.</p>
<p>-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/89/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apresentação FISL 11: Segurança em Virtualização utilizando o KVM</title>
		<link>http://blog.klauskiwi.com/archives/82</link>
		<comments>http://blog.klauskiwi.com/archives/82#comments</comments>
		<pubDate>Thu, 22 Jul 2010 02:58:17 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[apresentacao]]></category>
		<category><![CDATA[fisl11]]></category>
		<category><![CDATA[portugues]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=82</guid>
		<description><![CDATA[Abaixo está o link para o PDF da minha apresentação utilizada no FISL 11 sobre &#8220;Segurança em Virtualização utilizando o KVM&#8221;. Lembrando que eu devo abordar novamente este tópico na LinuxCon Brasil 2010, que acontecerá dia 31 de Agosto e 1° de Setembro deste ano &#8211; fique ligado na programação. Aproveito também para adiantar que [...]]]></description>
			<content:encoded><![CDATA[<p>Abaixo está o link para o PDF da minha apresentação utilizada no <a href="http://softwarelivre.org/fisl11/">FISL 11</a> sobre &#8220;Segurança em Virtualização utilizando o KVM&#8221;.</p>
<p>Lembrando que eu devo abordar novamente este tópico na <a href="http://events.linuxfoundation.org/events/linuxcon-brazil">LinuxCon Brasil 2010</a>, que acontecerá dia 31 de Agosto e 1° de Setembro deste ano &#8211; fique ligado na programação. Aproveito também para adiantar que eu devo conduzir um &#8220;Encontro de desenvolvedores profissionais de Linux&#8221; na mesma LinuxCon Brasil 2010. Deverá ser uma oportunidade para encontrar colegas das várias empresas que trabalham direamente com desenvolvimento do Sistema Operacional Linux, e debater sobre o mercado de trabalho, educação, e realizações. Entre em contato (klaus arroba klauskiwi.com) ou deixe um comentário se estiver interessado neste mini-summit.</p>
<p>Comentários, correções e dúvidas são sempre bem-vindas!</p>
<p>-Klaus</p>
<p><a href="http://blog.klauskiwi.com/wp-content/uploads/2010/07/SegurancaKVM-Oo.org_.pdf">Apresentação em PDF: SegurancaKVM-Oo.org</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/82/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Blueprint available: Securing KVM guests and the host system</title>
		<link>http://blog.klauskiwi.com/archives/69</link>
		<comments>http://blog.klauskiwi.com/archives/69#comments</comments>
		<pubDate>Thu, 08 Jul 2010 21:51:16 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=69</guid>
		<description><![CDATA[IBM recently made available another Blueprint of my authorship: Securing KVM guests and the host system. The text, which also has a PDF version, brings a couple of steps and some discussion around the theme of KVM Security for the Red Hat Enterprise Linux running on IBM System x with Virtualization capability. Those include remote [...]]]></description>
			<content:encoded><![CDATA[<p>IBM recently made available another Blueprint of my authorship: <a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaai/kvmsec/kvmsecstart.htm">Securing KVM guests and the host system</a>.</p>
<p>The text, which also has a <a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaai/kvmsec/kvmsecprint.htm">PDF</a> version, brings a couple of steps and some discussion around the theme of KVM Security for the <a href="http://www.redhat.com/rhel/server/">Red Hat Enterprise Linux</a> running on IBM System x with Virtualization capability. Those include remote management aspects, host and guest security, a few suggestions for auditing and why not some image-at-rest cryptography?</p>
<p>The complete index follows:</p>
<ul>
<li><em><strong> Introduction</strong></em></li>
<li><em><strong> Securing KVM guests and the host system</strong></em>
<ul>
<li><em>Secured KVM remote management</em></li>
<li><em>Setting up secure remote management</em></li>
<li><em>Remote management using SSH tunnels</em></li>
<li><em>Remote management using SASL authentication and encryption</em></li>
<li><em>Remote management using TLS</em></li>
</ul>
</li>
<li><em><strong> Guest virtual network isolation options</strong></em>
<ul>
<li><em>Network port sharing with Ethernet bridges</em></li>
<li><em>Network port sharing using 802.1q VLANs</em></li>
</ul>
</li>
<li><em><strong> Auditing the KVM virtualization host and guests</strong></em>
<ul>
<li><em>Audit rules file</em></li>
</ul>
</li>
<li><em><strong>KVM guest image encryption</strong></em>
<ul>
<li><em>Using encryption in KVM guest images</em></li>
<li><em>Migrating existing guests to encrypted storage</em></li>
<li><em>Installing a new KVM guest</em></li>
<li><em>Storing encrypted guest images</em></li>
</ul>
</li>
<li><em><strong>Appendix A. Sample audit rules file</strong></em></li>
<li><em><strong> Appendix B. Troubleshooting</strong></em></li>
</ul>
<p>Feedback, comments, corrections and suggestions are welcome as always, and we now have a way to provide them directly in the text. Questions can be answered in the developerWorks <a href="http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1271"><em>Linux Security Community Forum</em></a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/69/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reviewing patches</title>
		<link>http://blog.klauskiwi.com/archives/42</link>
		<comments>http://blog.klauskiwi.com/archives/42#comments</comments>
		<pubDate>Thu, 08 Jul 2010 19:29:51 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[claws]]></category>
		<category><![CDATA[patches]]></category>
		<category><![CDATA[reviewing]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=42</guid>
		<description><![CDATA[I always struggled at reviewing code. Specially when the code to be reviewed is in reality a patch inlined in some e-mail&#8230; I hate monospaced fonts in my e-mail reader, and with all the context switches I got in my daily work, I simply can&#8217;t concentrate properly in order to follow what&#8217;s been proposed with [...]]]></description>
			<content:encoded><![CDATA[<p>I always struggled at reviewing code.</p>
<p>Specially when the code to be reviewed is in reality a patch inlined in some e-mail&#8230; I hate monospaced fonts in my e-mail reader, and with all the context switches I got in my daily work, I simply can&#8217;t concentrate properly in order to follow what&#8217;s been proposed with that one patch out of many, in that long long patch series.</p>
<p>In the past, I used to apply them manually, then go over the code using <a href="http://sourcenav.berlios.de/">Source Navigator</a> and later <a href="http://cscope.sourceforge.net/">cscope</a>.</p>
<p>I still miss the ability to jump between symbol definition and use that cscope does the best, but I have a much more streamlined way of reviewing patches today, thanks to <a href="http://git-scm.com/">git</a>, <a href="http://meld.sourceforge.net/">meld</a>, and <a href="http://www.claws-mail.org/">claws-mail</a>.</p>
<p>The first thing is about <strong>git</strong>. Nowadays I use git in every coding project I use &#8211; even if the upstream project is not using git as SCM itself (I simply create a local repository and import). And this is not only for making reviewing patches easier, but all sorts of things, like fast branching and merging, easy cherry-picking, rebasing, commit amending, modern utilities et al. It&#8217;s really the 21st century version control system.</p>
<p>The second thing is meld. Meld is one good example of an intuitive interface that doesn&#8217;t get in the way. It can compare, merge and edit files (up to 3-way merge if needed). Supports all the major SCMs such as git, hg, cvs and svn (although I can&#8217;t find a reason why would anyone still use the last two, at least locally).</p>
<p style="text-align: center;">
<div id="attachment_46" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.klauskiwi.com/wp-content/uploads/2010/06/Screenshot-Meld1.png"><img class="size-medium wp-image-46 " title="Screenshot-Meld1" src="http://blog.klauskiwi.com/wp-content/uploads/2010/06/Screenshot-Meld1-300x196.png" alt="Meld side-by-side diff" width="300" height="196" /></a><p class="wp-caption-text">Meld side-by-side diff</p></div>
<p>The forth thing, and where actually everything makes sense, is Claws-mail, which has the very useful (and unique?) ability to create custom <em>actions</em> to process messages.</p>
<div id="attachment_54" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.klauskiwi.com/wp-content/uploads/2010/07/Screenshot-Claws-Mail1.png"><img class="size-medium wp-image-54 " title="Screenshot-Claws-Mail1" src="http://blog.klauskiwi.com/wp-content/uploads/2010/07/Screenshot-Claws-Mail1-300x196.png" alt="Claws-Mail Actions" width="300" height="196" /></a><p class="wp-caption-text">Claws-Mail Actions</p></div>
<p style="text-align: left;">Guess what happens when you combine Claws-Mail&#8217;s <em>actions</em> with a script that uses git and Meld? A very <em>point-and-click</em> way of reviewing patches:</p>
<p style="text-align: left;">
<div id="attachment_55" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.klauskiwi.com/wp-content/uploads/2010/07/Screenshot-Review1.png"><img class="size-medium wp-image-55" title="Screenshot-Review1" src="http://blog.klauskiwi.com/wp-content/uploads/2010/07/Screenshot-Review1-300x175.png" alt="Claws-Mail, git and Meld in action" width="300" height="175" /></a><p class="wp-caption-text">Claws-Mail, git and Meld in action</p></div>
<p style="text-align: left;">The trick is in configuring an <em>action</em> in Claws-Mail that opens a terminal and calls a script. The script uses <em>git-am</em> to apply the patch contained within the selected mail message to <em>some</em> branch in your local git repository. After applying, it calls <em>git-difftool</em> to show the differences. <em>git-difftool</em> then calls any diff tool you might like (my suggestion stays with Meld).</p>
<p style="text-align: left;">I&#8217;m attaching the script for reference below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">## git-review-step</span>
<span style="color: #666666; font-style: italic;">## (C) Copyright 2010 Klaus Heinrich Kiwi</span>
<span style="color: #666666; font-style: italic;">## Licensed under CreativeCommons Attribution-ShareAlike 3.0 Unsupported</span>
<span style="color: #666666; font-style: italic;">## http://creativecommons.org/licenses/by-sa/3.0/ for more info.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## dirname is where the git tree is located.</span>
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dirname</span></span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>sandbox<span style="color: #000000; font-weight: bold;">/</span>ock<span style="color: #000000; font-weight: bold;">/</span>sourceforge-git<span style="color: #000000; font-weight: bold;">/</span>opencryptoki
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$#&quot;</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Invalid number of parameters&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: <span style="color: #007800;">$(basename $0)</span> &lt;patch1&gt; [patch2] [patch3] [...]&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">messages</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>$<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$dirname</span>
<span style="color: #007800;">oldbranch</span>=<span style="color: #000000; font-weight: bold;">`</span>git branch <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'^* '</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Save any uncommitted changes in the working dir or index</span>
<span style="color: #000000; font-weight: bold;">if</span> git stash <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> HEAD; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #007800;">savedchanges</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> restore<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Reverting to original branch...&quot;</span>
  git checkout <span style="color: #660033;">--force</span> <span style="color: #007800;">$oldbranch</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$savedchanges</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Restoring un-committed changes...&quot;</span>
    git stash pop
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Get branch to apply to</span>
git branch
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Select branch to apply patches:&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Enter <span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;branchname&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span> to apply to an existing branch&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Enter <span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;newname&gt; [origref]<span style="color: #000099; font-weight: bold;">\&quot;</span> to create a new branch from <span style="color: #000099; font-weight: bold;">\&quot;</span>origref<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;    reference (use current branch and HEAD if left blank)&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Apply patch(es) to branch (default is current):&quot;</span> <span style="color: #660033;">-e</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$oldbranch</span> newbranch origbranch
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$newbranch</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #000000; font-weight: bold;">if</span> git branch <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\b<span style="color: #007800;">${newbranch}</span>$&quot;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Applying to existing branch <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$newbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
    <span style="color: #666666; font-style: italic;"># Checkout</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> git checkout <span style="color: #007800;">$newbranch</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error checkout out <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$newbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> - Aborting&quot;</span>
      restore
      <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$origbranch</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Applying to new branch <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$newbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> created from <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$origbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> branch...&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Applying to new branch <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$newbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> created from <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$oldbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> branch...&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> git checkout <span style="color: #660033;">-b</span> <span style="color: #007800;">$newbranch</span> <span style="color: #007800;">$origbranch</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error creating <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$newbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> from <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$oldbranch</span><span style="color: #000099; font-weight: bold;">\&quot;</span> - Aborting&quot;</span>
      restore
      <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>  <span style="color: #666666; font-style: italic;"># if ! git checkout ...</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">fi</span>    <span style="color: #666666; font-style: italic;"># if `git branch | grep ...</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>      <span style="color: #666666; font-style: italic;"># if [ -n $newbranch ...</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Apply patches to working dir using git-apply</span>
<span style="color: #007800;">amparams</span>=<span style="color: #ff0000;">&quot;--whitespace=error-all&quot;</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #000000; font-weight: bold;">!</span> git am <span style="color: #007800;">$amparams</span> <span style="color: #800000;">${messages[@]}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  git am <span style="color: #660033;">--abort</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;git-am failed. Retry (the whole chunk) with additional parameters?&quot;</span>
  <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;git-am parameters (empty aborts):&quot;</span> <span style="color: #660033;">-e</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$amparams</span> amparams
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$amparams</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Aborting...&quot;</span>
    restore
    <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">i</span>=<span style="color: #800000;">${#messages[@]}</span>; i <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">0</span>; i-- <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #007800;">PAGER</span>=<span style="color: #ff0000;">''</span> git log <span style="color: #660033;">--stat</span> HEAD~<span style="color: #800000;">${i}</span>..HEAD~$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i-<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">if</span> git <span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #660033;">--check</span> HEAD~<span style="color: #800000;">${i}</span>..HEAD~$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i-<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;WARNING: Commit introduces whitespace or indenting errors&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  git difftool HEAD~<span style="color: #800000;">${i}</span>..HEAD~$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i-<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Restoring working tree to original state&quot;</span>
restore
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span></pre></div></div>

<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img style="border-width: 0;" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" alt="Creative Commons License" /></a><br />
<span>git-review-step</span> by <a rel="cc:attributionURL" href="http://blog.klauskiwi.com">Klaus Heinrich Kiwi</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br />
Based on a work at <a rel="dc:source" href="http://blog.klauskiwi.com/archives/42">blog.klauskiwi.com</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/42/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>xcryptolinz RPMs</title>
		<link>http://blog.klauskiwi.com/archives/40</link>
		<comments>http://blog.klauskiwi.com/archives/40#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:54:19 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux crypto cca hardware]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=40</guid>
		<description><![CDATA[In case anyone is looking for the xcryptolinz RPMs to support IBM cryptographic hardware in Secure Key mode (among other things) through the CCA API, they are actually placed in IBM&#8217;s software support page for cryptocards (link) As of this posting, current version is 3.28-rc8, and only supported in the s390x architecture (System z). Update: [...]]]></description>
			<content:encoded><![CDATA[<p>In case anyone is looking for the xcryptolinz RPMs to support IBM cryptographic hardware in Secure Key mode (among other things) through the CCA API, they are actually placed in IBM&#8217;s software support page for cryptocards (<a href="http://www-03.ibm.com/security/cryptocards/pcixcc/ordersoftware.shtml" target="_blank">link</a>)</p>
<p>As of this posting, current version is <a href="http://www-03.ibm.com/security/cryptocards/dwnlds/xcryptolinzGA-3.28-rc08.s390x.rpm" target="_blank">3.28-rc8</a>, and only supported in the s390x architecture (System z).</p>
<p><em><span style="text-decoration: underline;">Update:</span></em></p>
<p><em>IBM has released a <a href="http://www-03.ibm.com/security/cryptocards/pciecc/ordersoftware.shtml">new CCA library</a> (ver. 4.0), supporting the newer IBM <a href="http://www-03.ibm.com/security/cryptocards/pciecc/overview.shtml">PCIe Cryptographic Coprocessor</a> (aka CEX3C aka 4765) card.  The library now supports SHA-2 AES and RSA with modulus size up to 4096 bits (for capable hardware), besides other Secure-Key operations such as DES, 3DES and SHA-1.</em></p>
<p><em>Opencryptoki starting from version <a href="https://sourceforge.net/projects/opencryptoki/files/opencryptoki/">2.3</a> supports (and in fact requires) this library in order to use the CCA token type.<br />
</em></p>
<p>If time permits, I&#8217;ll post more here about CCA support in <a href="http://sourceforge.net/projects/opencryptoki/" target="_blank">openCryptoki</a> in the future.</p>
<p>-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/40/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www-03.ibm.com/security/cryptocards/dwnlds/xcryptolinzGA-3.28-rc08.s390x.rpm" length="367925" type="audio/x-pn-realaudio-plugin" />
		</item>
		<item>
		<title>test libraries without &#8216;make install&#8217;</title>
		<link>http://blog.klauskiwi.com/archives/34</link>
		<comments>http://blog.klauskiwi.com/archives/34#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:05:54 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[LD_LIBRARY_PATH]]></category>
		<category><![CDATA[oneliner]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=34</guid>
		<description><![CDATA[Quick oneliner to export LD_LIBRARY_PATH containing all the pathnames that brings a shared library (.so) file in, so the lazy ones like myself can sometimes risk running/testing software that uses these libraries without issuing a &#8216;make install&#8217;. There are probably more clever/elegant ways to do that, but whatever: export LD_LIBRARY_PATH=$(for j in \ $(for i [...]]]></description>
			<content:encoded><![CDATA[<p>Quick oneliner to export LD_LIBRARY_PATH containing all the pathnames that brings a shared library (.so) file in, so the lazy ones like myself can sometimes risk running/testing software that uses these libraries without issuing a &#8216;make install&#8217;.</p>
<p>There are probably more clever/elegant ways to do that, but whatever:</p>
<blockquote>
<pre>export LD_LIBRARY_PATH=$(for j in \
  $(for i in \
    $(find . -name '*.so'); \
    do dirname $i; done | sort | uniq);\
  do readlink -f $j; done |\
  awk '{ printf "%s:", $0 }')</pre>
</blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fglrx problems with Jaunty</title>
		<link>http://blog.klauskiwi.com/archives/24</link>
		<comments>http://blog.klauskiwi.com/archives/24#comments</comments>
		<pubDate>Sat, 09 May 2009 04:19:15 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fglrx radeon compiz hang]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=24</guid>
		<description><![CDATA[Problems getting compiz (or any other 3D acceleration app) working with your ATI Radeon graphics card on the latest Ubuntu release, Jaunty Jackalope (9.04)? Or better yet: you figured out that you were missing ATI&#8217;s proprietary driver, fglrx, and installed it on your own (since the Hardware Drivers wasn&#8217;t giving you the option to enable [...]]]></description>
			<content:encoded><![CDATA[<p>Problems getting compiz (or any other 3D acceleration app) working with your ATI Radeon graphics card on the latest Ubuntu release, Jaunty Jackalope (9.04)?</p>
<p>Or better yet: you figured out that you were missing ATI&#8217;s proprietary driver, fglrx, and installed it on your own (since the <em>Hardware Drivers</em> wasn&#8217;t giving you the option to enable it in the first place)?</p>
<p>If that was the case, I think you already know that the reason why you&#8217;d get a <em>hard freeze</em> everytime the X server was comming up is that you were wrong, and Ubuntu and the <em>Hardware Drivers</em> app were right!</p>
<p>ATI&#8217;s Catalyst drivers (also known as fglrx drivers), in the default version shipped with Jaunty, are incompatible with some features from Xserver 1.6, which was introduced with Jaunty. Catalyst drivers up to version 9.3 <strong>will not work</strong> with Xorg version 7.4 or beyond.</p>
<p>The good news is that AMD has already released a 9.4 version that is compatible with the new server. You can get the new version, for Linux x86 and Linux 86_64 here: <a href="http://support.amd.com/us/gpudownload/Pages/index.aspx">http://support.amd.com/us/gpudownload/Pages/index.aspx</a></p>
<p>The bad news is (or better, are):</p>
<ul>
<li>Ubuntu&#8217;s packages haven&#8217;t been updated to include this version yet (as of the time of this writing) &#8211; so yes, you&#8217;d need to install them the manual way (see below for some tips)</li>
<li>Seems like the new driver still has some instabilities, notably when trying to use compiz with video overlay (try using totem to play a video while running a composite desktop &#8211; AT YOUR OWN RISK <img src='http://blog.klauskiwi.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p>Oh wait! I actually have another piece of &#8216;good news&#8217;: Despite not having official packages for Ubuntu yet, I just found out how easy it&#8217;s to create those packages using ATI&#8217;s own binary:</p>
<pre>
<pre># ./ati-driver-installer-9-4-x86.x86_64.run --buildpkg Ubuntu/9.04</pre>
</pre>
<p>Yep, that&#8217;s pretty much it. Install the generated <em>.deb</em> files and reboot the system. You may want to run <em>aticonfig &#8211;initial</em> if you are not confident that Xorg will automatically detect your driver.</p>
<p>Having a proper package installed instead of just files laying around will allow the system to reconfigure itself when needed (i.e., upon kernel updates) and it also allows you to keep your files tracked, smooth upgrades, etc &#8211; generally a Good Thing™to do.</p>
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/24/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Guest blogging on Emily&#8217;s &#8220;Open Source Security&#8221; blog</title>
		<link>http://blog.klauskiwi.com/archives/21</link>
		<comments>http://blog.klauskiwi.com/archives/21#comments</comments>
		<pubDate>Wed, 29 Apr 2009 13:36:48 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IBM LTC kerberos ldap guest blogging]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=21</guid>
		<description><![CDATA[Starting from today I am a proud contributor to Emily Ratliff&#8217;s Open Source Security blog. The blog brings information, news, discussions and opinions mainly about Linux and Open Source security in general, and, besides Emily and myself, has other members from the IBM&#8217;s Linux Technology Center Security Team as contributors. My first post brings a [...]]]></description>
			<content:encoded><![CDATA[<p>Starting from today I am a proud contributor to Emily Ratliff&#8217;s <a href="http://www.ratliff.net/blog/" target="_blank">Open Source Security</a> blog. The blog brings information, news, discussions and opinions mainly about Linux and Open Source security in general, and, besides Emily and myself, has other members from the IBM&#8217;s <a href="http://www.ratliff.net/blog/" target="_blank">Linux Technology Center</a> Security Team as <a href="http://www.ratliff.net/blog/guest-bloggers/" target="_blank">contributors</a>.</p>
<p>My <a href="http://www.ratliff.net/blog/2009/04/29/kerberos_and_itds/" target="_blank">first post</a> brings a little introduction to concepts such as authentication and authorization, and how Kerberos and LDAP can be used to perform those important roles, to later introduce the &#8220;<a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaai/kerberos/liaaikerberos1.htm" target="_blank">Using MIT-Kerberos fo IBM Tivoli Directory Server backend</a>&#8221; Blueprint which I authored by the end of last year.</p>
<p>Please go <a href="http://www.ratliff.net/blog/2009/04/29/kerberos_and_itds/">check it out</a>. Comments are always welcome.</p>
<p><span style="text-decoration: underline;"><em>Update:</em></span><em> blueprint link fixed</em></p>
<p>-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/21/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cedilla (ç) symbol using American Keyboards in Linux</title>
		<link>http://blog.klauskiwi.com/archives/13</link>
		<comments>http://blog.klauskiwi.com/archives/13#comments</comments>
		<pubDate>Wed, 05 Nov 2008 14:10:13 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cedilha]]></category>
		<category><![CDATA[cedilla]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[pt-br]]></category>
		<category><![CDATA[xkb]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://blog.klauskiwi.com/?p=13</guid>
		<description><![CDATA[Disclaimer: this article refers to using Linux with an American keyboard to type Portuguese (pt-br) text, using the &#8216;us-intl&#8217; keyboard layout. One of the things that bothered me when upgrading between Ubuntu versions a while back (Feisty for Gutsy? Hardy? I can&#8217;t remember) is the changed behavior for inputting the Cedilla &#8216;ç&#8217; symbol using American [...]]]></description>
			<content:encoded><![CDATA[<p><em>Disclaimer: this article refers to using Linux with an American keyboard to type Portuguese (pt-br) text, using the &#8216;us-intl&#8217; keyboard layout.</em></p>
<p>One of the things that bothered me when upgrading between Ubuntu versions a while back (Feisty for Gutsy? Hardy? I can&#8217;t remember) is the changed behavior for inputting the Cedilla &#8216;ç&#8217; symbol using American keyboards.</p>
<p>Ok, in fact, this behavior changed twice over the time, so I can remember at least three ways of doing that:</p>
<ol>
<li><strong>Press the the single-quote (&#8216;) key, then letter &#8216;c&#8217; (<code>'</code> then <code>c</code>).</strong> In the us-intl keyboard layout, the single quote is a <em>dead-key</em> commonly used to insert an acute sign over vowels: á, é, í, ó, ú. Pressing the single-quote twice produces the single quote itself. A few years ago, the Cedilla sign was inputted by combining the single-quote dead key with the letter &#8216;c&#8217; itself. This behavior changed: now, <code>'</code> then <code>c</code> produces ć &#8211; maybe to support languages that require this symbol (after all we&#8217;re abusing the us-<em>international</em> layout) or simply a question of consistency.</li>
<li><strong>Combining the Right-Alt key with the comma (,) symbol (<code>Ralt</code>+<code>,</code>).</strong> After the change in the above item was introduced, the us-intl layout was tuned to allow many other types of symbols (Can you say UTF-8?). The <em>Right-Alt</em> key came to be what is called a <em>Level-3</em> modifier (that is, a key modifier that works just like Shift, Ctrl and Alt/Meta &#8211; that is <em>not</em> a dead-key). With this modifier, one could produce several other symbols commonly used in western languages other than English itself, i.e.: ¡, ß, æ, ñ, ø etc. Also, the <em>Level-3 modifier</em> also allow us to input commonly used symbols that are outside the English alphabet: ², ³, ©, ®, ¢, § etc.</li>
<li><strong>Combining Right-Alt with the comma (,) symbol as dead-key, then pressing letter &#8216;c&#8217; (<code>Ralt</code>+<code>,</code> then <code>c</code>). </strong>This is the the behavior introduced with newer versions of the us-intl keyboard layout. Just like before, you use the <em>Right-Alt</em> key as a <em>Level-3</em> modifier, but instead of inserting the symbol directly, this key combination acts like a <em>dead-key</em>, waiting for the next key-press to determine what symbol is being inputted. In fact, this behavior was introduced with the &#8216;alt-intl&#8217; layout which is said to mimic the previous behavior of us-intl (first item above) &#8211; well, at least for me it doesn&#8217;t <em>exactly</em> mimics the former behavior, and I personally prefer the second option.</li>
</ol>
<p>Choosing between the second and the third options above is pretty straightforward if you&#8217;re using a relatively recent Linux distribution with Gnome 2.x and Xorg. Just use <strong>gnome-keyboard-properties</strong> to choose between <em>USA International (with dead keys)</em> or <em>USA Alternative International (former us_intl)</em> for the behavior found in item 2 and 3 above respectively. You can also have both configured and change between layouts using the <em>Keyboard Indicator</em> gnome applet:</p>
<div id="attachment_14" class="wp-caption aligncenter" style="width: 278px"><a href="http://blog.klauskiwi.com/wp-content/uploads/2008/11/screenshot-keyboard-preferences.png"><img class="size-medium wp-image-14" title="screenshot-keyboard-preferences" src="http://blog.klauskiwi.com/wp-content/uploads/2008/11/screenshot-keyboard-preferences-268x300.png" alt="gnome-keyboard-properties screenshot" width="268" height="300" /></a><p class="wp-caption-text">gnome-keyboard-properties screenshot</p></div>
<p>In case you are not using Gnome and prefer to configure it directly in Xorg&#8217;s configuration, edit the <em>InputDevice</em> section at the X.org server configuration file, usually <em>/etc/X11/xorg.conf</em>, to look like below:</p>
<ul>
<li>Cedilla <strong>not</strong> as dead-key (behavior 2 above):
<pre>Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"us"
	Option		"XkbVariant"	"intl"
#	Option		"XkbOptions"	"lv3:ralt_switch"
EndSection</pre>
</li>
<li>Cedilla <strong>as dead-key</strong> (behavior 3 above):
<pre>Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"us"
	Option		"XkbVariant"	"alt-intl"
#	Option		"XkbOptions"	"lv3:ralt_switch"
EndSection</pre>
</li>
</ul>
<p>The line with <em>&#8220;XkbOptions&#8221;	&#8220;lv3:ralt_switch&#8221;</em> was indifferent to (at least) the Cedilla behavior, thus I commented it (I have a feeling that the <em>ralt_switch</em> behavior is included anyway for both variants).</p>
<h3>Troubleshooting</h3>
<p>If even after doing the above you can&#8217;t get the desired behavior, check the following:</p>
<ul>
<li>Your window manager configuration usually precedes your X server configuration &#8211; That is, if you configured your keyboard layout using Gnome or KDE tools, the settings in your <em>xorg.conf</em> are probably being ignored. Within gnome, you can use <strong>gconf-editor</strong> and browse to <em>/desktop/gnome/peripherals/keyboard/kdb</em> to check the current effective configuration. <span style="text-decoration: underline;">Leave a comment</span> if you know how to override this.</li>
<li>Your X server may have been <em>automagically configured</em> by <a href="http://www.freedesktop.org/wiki/Software/hal" target="_blank">HAL</a> and friends. You can check that by opening the X server log (usually <em>/var/log/Xorg.0.log</em>) and looking for the <em>evdev</em> module. There should be a couple of messages showing which model/layout/variant was chosen:
<pre>(**) Option "xkb_rules" "evdev"
(**) AT Translated Set 2 keyboard: xkb_rules: "evdev"
(**) Option "xkb_model" "pc102"
(**) AT Translated Set 2 keyboard: xkb_model: "pc102"
(**) Option "xkb_layout" "us"
(**) AT Translated Set 2 keyboard: xkb_layout: "us"
(**) Option "xkb_variant" "alt-intl"
(**) AT Translated Set 2 keyboard: xkb_variant: "alt-intl"
(**) Option "xkb_options" "lv3:ralt_switch"
(**) AT Translated Set 2 keyboard: xkb_options: "lv3:ralt_switch"</pre>
<p>In this case, you can either:</p>
<ul>
<li>Disable auto-detection from the X.org side, adding an <em>&#8220;AutoAddDevices&#8221; &#8220;off&#8221;</em> option to your <em>ServerLayout</em> section (at the <em>xorg.conf</em> file):
<pre>Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Synaptics Touchpad"
	Option		"AutoAddDevices" "off"
EndSection</pre>
</li>
<li>Create a <em>policy</em> at the HAL side, by creating a <em>.fdi</em> file, e.g.: <em>/etc/hal/fdi/policy/10-keyboard.fdi</em>, that reads:
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;deviceinfo version="0.2"&gt;
    &lt;device&gt;
      &lt;match key="info.capabilities" contains="input.keys"&gt;
        &lt;merge key="input.x11_options.XkbVariant" type="string"&gt;intl&lt;/merge&gt;
        &lt;merge key="input.xkb.variant" type="string"&gt;intl&lt;/merge&gt;
      &lt;/match&gt;
    &lt;/device&gt;
  &lt;/deviceinfo&gt;</pre>
<p>(Change the variant from <em>intl</em> for <em>alt-intl</em> according to your choice). Remember to restart the HAL daemon (<em>hald</em>) for the changes to take effect</li>
</ul>
</li>
<li>More information about HAL and the <em>evdev</em> module can be found at <a href="http://who-t.blogspot.com/2008/07/input-configuration-in-nutshell.html" target="_blank">this</a> blog post.</li>
</ul>
<p>I hope this post was useful to shed some light into this (somewhat common) problem among pt-br users that don&#8217;t necessarily use Brazilian keyboards or run their systems in that locale. Leave a comment if you find this post useful, have questions, comments, corrections, <em>anything</em> <img src='http://blog.klauskiwi.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>-Klaus</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.klauskiwi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.klauskiwi.com/archives/13/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.768 seconds -->
