<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<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/"
	>

<channel>
	<title>Barnoid's Knowledge Base</title>
	<link>http://kb.barnoid.com</link>
	<description>Bits of Collected Wisdom</description>
	<pubDate>Tue, 27 Mar 2012 01:48:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>Disposable E-Mail Addresses (Address Tagging with Postfix)</title>
		<link>http://kb.barnoid.com/?p=31</link>
		<comments>http://kb.barnoid.com/?p=31#comments</comments>
		<pubDate>Tue, 27 Mar 2012 00:59:22 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=31</guid>
		<description><![CDATA[Since &#8220;+&#8221; (&#8221;-&#8221; and many more for that matter, see RFC 3696 or Wikipedia for an overview) are valid characters in an email address, it is possible to tag incoming mail by using a suffix of the form &#8220;+tag&#8221; (or &#8220;-tag&#8221;) after your username. This is especially useful when you want to categorize incoming mail [...]]]></description>
			<content:encoded><![CDATA[<p>Since &#8220;+&#8221; (&#8221;-&#8221; and many more for that matter, see <a href="http://tools.ietf.org/html/rfc3696">RFC 3696</a> or <a href="http://en.wikipedia.org/wiki/Email_address#Syntax">Wikipedia</a> for an overview) are valid characters in an email address, it is possible to tag incoming mail by using a suffix of the form &#8220;+tag&#8221; (or &#8220;-tag&#8221;) after your username. This is especially useful when you want to categorize incoming mail automatically. Instead of giving your normal email address to some random website, you can use &#8220;me+website@mydomain.com&#8221;. Postfix delivers the mail to &#8220;me@mydomain.com&#8221; and you can have your email program automatically classify mails to that address.</p>
<p>To have postfix support address tagging, simply enable the recipient_delimiter option in main.cf and reload postfix:</p>
<pre>$ vi /etc/postfix/main.cf
...
# ADDRESS EXTENSIONS (e.g., user+foo)
#
# The recipient_delimiter parameter specifies the separator between
# user names and address extensions (user+foo). See canonical(5),
...
recipient_delimiter = +
...
$ /etc/init.d/postfix reload</pre>
<p>Tip: many websites filter out email addresses containing the &#8220;+&#8221; character. To use the &#8220;-&#8221; sign as the delimiter modify the line above to</p>
<pre>recipient_delimiter = -</pre>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=31</wfw:commentRSS>
		</item>
		<item>
		<title>Removing Evolution and Epiphany from Gnome</title>
		<link>http://kb.barnoid.com/?p=30</link>
		<comments>http://kb.barnoid.com/?p=30#comments</comments>
		<pubDate>Sun, 27 Mar 2011 06:48:01 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
	<category>portage</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=30</guid>
		<description><![CDATA[The Gnome herd will not provide us with a full gnome ebuild that allows conditional installation of Evolution and Epiphany based on USE flags. Luckily, it&#8217;s easy to do it yourself.
First, enable the portage overlay in make.conf:
# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
#     concern that they [...]]]></description>
			<content:encoded><![CDATA[<p>The Gnome herd will not provide us with a full gnome ebuild that allows conditional installation of Evolution and Epiphany based on USE flags. Luckily, it&#8217;s easy to do it yourself.</p>
<p>First, enable the portage overlay in make.conf:</p>
<pre># PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
#     concern that they will be deleted by rsync updates. Default is not
#     defined.
PORTDIR_OVERLAY=/usr/local/portage</pre>
<p>Next, copy the Gnome ebuild into our portage overlay structure while maintaining the same directory structure.<br />
First, find out where the gnome ebuild is located:</p>
<pre># find /usr/portage -name gnome-*.ebuild
/usr/portage/gnome-base/gnome/gnome-2.32.1.ebuild</pre>
<p>Second, create the same directory structure in our overlay:</p>
<pre># mkdir -p /usr/local/portage/gnome-base/gnome</pre>
<p>Then, copy over the original ebuild into our overlay:</p>
<pre># cd /usr/local/portage/gnome-base/gnome
# cp /usr/portage/gnome-base/gnome/gnome-2.32.1.ebuild .</pre>
<p>Currently, there are no patches for Gnome (there is no &#8216;files&#8217; directory in /usr/portage/gnome-base/gnome/) hence we do not need to symlink that directory into our overlay.<br />
Now, edit the ebuild in the overlay and delete all references to Evolution and/or Epiphany (bold lines):</p>
<pre>    ...
    >=media-gfx/eog-2.32.1:1

    <b>>=www-client/epiphany-2.30.6</b>
    >=app-arch/file-roller-2.32.1
    &#8230;
    >=gnome-extra/gtkhtml-3.32.1:3.14
    <b>>=mail-client/evolution-2.32.1-r1:2.0
    >=gnome-extra/evolution-data-server-2.32.1-r1
    >=gnome-extra/evolution-webcal-2.32.0</b>
    &#8230;
</pre>
<p>Save and exit, then create the manifest:</p>
<pre># ebuild gnome-2.32.1.ebuild manifest</pre>
<p>Done. Emerging gnome now will not pull in Evolution/Epiphany.</p>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=30</wfw:commentRSS>
		</item>
		<item>
		<title>Gentoo: Installing Fonts</title>
		<link>http://kb.barnoid.com/?p=29</link>
		<comments>http://kb.barnoid.com/?p=29#comments</comments>
		<pubDate>Mon, 18 Jan 2010 03:00:44 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=29</guid>
		<description><![CDATA[Lots of howtos are out there, here&#8217;s mine:
Install the fonts somewhere in the /usr/share/fonts/ directory. For Type1 fonts (only .pfb and .pfm files are present, but no .afm files), you need to run the type1afm command first to generate the necessary .afm files (otherwise the fonts won&#8217;t show up in OpenOffice, for example). Then generate [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of howtos are out there, here&#8217;s mine:<br />
Install the fonts somewhere in the /usr/share/fonts/ directory. For Type1 fonts (only .pfb and .pfm files are present, but no .afm files), you need to run the type1afm command first to generate the necessary .afm files (otherwise the fonts won&#8217;t show up in OpenOffice, for example). Then generate the font directory and scale files and register the new font directory in the system. In shell-speak:</p>
<pre># cd /usr/share/fonts
# mkdir myfont
# cd myfont
# cp <em>font files, i.e., *.afm *.pfb *.pfm</em> .
# type1afm `ls *.pfb`
# mkfontdir /usr/share/fonts/myfont
# mkfontscale /usr/share/fonts/myfont
# xset fp+ /usr/share/fonts/myfont
# xset fp rehash
# fc-cache</pre>
<p>If you get an error saying &#8216;type1afm: command not found&#8217;, you may need to install the t1lib package:</p>
<pre>emerge -av media-libs/t1lib</pre>
<p>Check whether the new font shows up in the font list:</p>
<pre># fc-list | grep -i &lt;fontname&gt;</pre>
<p>Done. Restart the application (restarting the X server is not necessary)</p>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=29</wfw:commentRSS>
		</item>
		<item>
		<title>1001 reasons why C/C++ is evil</title>
		<link>http://kb.barnoid.com/?p=27</link>
		<comments>http://kb.barnoid.com/?p=27#comments</comments>
		<pubDate>Wed, 05 Nov 2008 02:04:36 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Programming</category>
	<category>C/C++</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=27</guid>
		<description><![CDATA[Consider the following C++ code:
class A
{
int do(string key, bool b)         { cout ]]></description>
			<content:encoded><![CDATA[<p>Consider the following C++ code:</p>
<pre>class A
{
int do(string key, bool b)         { cout << "do('" << key << "', " << (b ? "true" : "false") << ")" << endl; };
int do(string key, string value) { cout << "do('" << key << "', '" << value << "')" << endl; };
};

...

A *a = new A();
a->do(&#8221;do&#8221;, &#8220;something&#8221;);</pre>
<p>What is printed? Well, not what I expected:</p>
<pre># ./reason1
do('do', true)</pre>
<p>Intuitively, the second method, do(string string), should be executed, but gcc (4.1) executes the first method, do(string, bool). This is because the second &#8217;string&#8217;, &#8220;something&#8221;, is interpreted as &#8216;char *&#8217;.</p>
<p>One down, 1000 more reasons to come.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=27</wfw:commentRSS>
		</item>
		<item>
		<title>Ebuild for nslookup / dig?</title>
		<link>http://kb.barnoid.com/?p=26</link>
		<comments>http://kb.barnoid.com/?p=26#comments</comments>
		<pubDate>Wed, 10 Sep 2008 01:44:09 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=26</guid>
		<description><![CDATA[Can&#8217;t find the ebuild containing nslookup or digg? Install the bind-tools:
# emerge -avD net-dns/bind-tools
and you&#8217;re all set:
# nslookup 127.0.0.1

Server:        xxx.yyy.zzz.1
Address:    xxx.yyy.zzz.1#53

1.0.0.127.in-addr.arpa    name = localhost.
]]></description>
			<content:encoded><![CDATA[<p>Can&#8217;t find the ebuild containing nslookup or digg? Install the bind-tools:</p>
<pre># emerge -avD net-dns/bind-tools</pre>
<p>and you&#8217;re all set:</p>
<pre># nslookup 127.0.0.1

Server:        xxx.yyy.zzz.1
Address:    xxx.yyy.zzz.1#53

1.0.0.127.in-addr.arpa    name = localhost.</pre>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=26</wfw:commentRSS>
		</item>
		<item>
		<title>Thunderbird + Lightning: Layout Messed Up?</title>
		<link>http://kb.barnoid.com/?p=25</link>
		<comments>http://kb.barnoid.com/?p=25#comments</comments>
		<pubDate>Mon, 01 Sep 2008 02:39:39 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=25</guid>
		<description><![CDATA[If Thunderbird&#8217;s Lightning calendar extension messes with your Thunderbird layout and doesn&#8217;t work as expected, make sure to install libstdc++5 and then re-install Lightning.
# emerge -av libstdc++
[ebuild  N    ] virtual/libstdc++-3.3

]]></description>
			<content:encoded><![CDATA[<p>If Thunderbird&#8217;s Lightning calendar extension messes with your Thunderbird layout and doesn&#8217;t work as expected, make sure to install libstdc++5 and then re-install Lightning.</p>
<p><code># emerge -av libstdc++</code></p>
<p>[ebuild  N    ] virtual/libstdc++-3.3
</p>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=25</wfw:commentRSS>
		</item>
		<item>
		<title>VIM: Search for selection</title>
		<link>http://kb.barnoid.com/?p=24</link>
		<comments>http://kb.barnoid.com/?p=24#comments</comments>
		<pubDate>Mon, 01 Sep 2008 02:36:07 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
	<category>vi</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=24</guid>
		<description><![CDATA[After yanking a piece of text into the buffer, you can search for it by pressing &#60;ctrl&#62;-&#60;r&#62; &#8221; (that is: control-r double quotes) in search mode (&#8221;/&#8221;).

]]></description>
			<content:encoded><![CDATA[<p>After yanking a piece of text into the buffer, you can search for it by pressing &lt;ctrl&gt;-&lt;r&gt; &#8221; (that is: control-r double quotes) in search mode (&#8221;/&#8221;).
</p>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=24</wfw:commentRSS>
		</item>
		<item>
		<title>VIM  X11 middle-mouse copy/paste</title>
		<link>http://kb.barnoid.com/?p=23</link>
		<comments>http://kb.barnoid.com/?p=23#comments</comments>
		<pubDate>Mon, 01 Sep 2008 02:33:37 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
	<category>vi</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=23</guid>
		<description><![CDATA[That one is easy: just enable the &#8220;vim-with-x&#8221; USE flag and recompile vim:
# echo "app-editors/vim vim-with-x" >> /etc/portage/packages.use

# emerge -av vim

[ebuild   R   ] app-editors/vim-7.2  USE="acl gpm nls perl python vim-with-x -bash-completion -cscope -minimal -ruby -vim-pager&#8221;
]]></description>
			<content:encoded><![CDATA[<p>That one is easy: just enable the &#8220;vim-with-x&#8221; USE flag and recompile vim:</p>
<pre># echo "app-editors/vim vim-with-x" >> /etc/portage/packages.use

# emerge -av vim

[ebuild   R   ] app-editors/vim-7.2  USE="acl gpm nls perl python <strong>vim-with-x</strong> -bash-completion -cscope -minimal -ruby -vim-pager&#8221;</pre>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=23</wfw:commentRSS>
		</item>
		<item>
		<title>Generating a Self-Signed, Unencrypted SSL Certificate</title>
		<link>http://kb.barnoid.com/?p=22</link>
		<comments>http://kb.barnoid.com/?p=22#comments</comments>
		<pubDate>Sun, 20 Apr 2008 03:27:29 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=22</guid>
		<description><![CDATA[Generate an RSA private key:
# openssl genrsa -des3 -out server.key.encrypted 1024
Create a self-signed certificate (make sure to enter the FQDN for the &#8216;Common Name&#8217;)
# openssl req -new -x509 -nodes -sha1 -days 365 -key server.key.encrypted -out server.crt
Remove the password from the encrypted key
# openssl rsa -in server.key.encrypted -out server.key
# chmod 400 server.key
]]></description>
			<content:encoded><![CDATA[<p>Generate an RSA private key:</p>
<pre># openssl genrsa -des3 -out server.key.encrypted 1024</pre>
<p>Create a self-signed certificate (make sure to enter the FQDN for the &#8216;Common Name&#8217;)</p>
<pre># openssl req -new -x509 -nodes -sha1 -days 365 -key server.key.encrypted -out server.crt</pre>
<p>Remove the password from the encrypted key</p>
<pre># openssl rsa -in server.key.encrypted -out server.key
# chmod 400 server.key</pre>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=22</wfw:commentRSS>
		</item>
		<item>
		<title>ALSA Sound Problems (e.g. in Firefox when watching Videos)</title>
		<link>http://kb.barnoid.com/?p=21</link>
		<comments>http://kb.barnoid.com/?p=21#comments</comments>
		<pubDate>Sun, 14 Oct 2007 14:27:22 +0000</pubDate>
		<dc:creator>Barnoid</dc:creator>
		
	<category>Gentoo</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://kb.barnoid.com/?p=21</guid>
		<description><![CDATA[Recent sound problems (for example no sound when watching Youtube videos in Firefox or Thunderbird crashes whenever it pops up a calendar alarm) are probably caused by missing plugins. ALSA_PCM_PLUGINS controls which plugins are built; by default, it should build all of them, but apparently a recent update does not set the variable.
Symptoms are, for [...]]]></description>
			<content:encoded><![CDATA[<p>Recent sound problems (for example no sound when watching Youtube videos in Firefox or Thunderbird crashes whenever it pops up a calendar alarm) are probably caused by missing plugins. ALSA_PCM_PLUGINS controls which plugins are built; by default, it should build all of them, but apparently a recent update does not set the variable.</p>
<p>Symptoms are, for example, no sound from flash videos within Firefox. When started from a shell various error messages are printed, such as:</p>
<pre>ALSA lib pcm_misc.c:740:(snd_pcm_parse_control_id) Cannot get index for 0
ALSA lib pcm_dmix.c:914:(snd_pcm_dmix_open) unable to open slave
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib pcm_hw.c:1351:(_snd_pcm_hw_open) Invalid value for card
ALSA lib confmisc.c:769:(parse_card) cannot find card ''</pre>
<p>Try</p>
<pre># echo 'ALSA_PCM_PLUGINS="adpcm alaw copy dshare dsnoop extplug file hooks ladspa lfloat linear meter mulaw multi null rate route share shm"' >> /etc/make.conf
# emerge --oneshot alsa-lib
# /etc/init.d/alsasound restart</pre>
]]></content:encoded>
			<wfw:commentRSS>http://kb.barnoid.com/?feed=rss2&amp;p=21</wfw:commentRSS>
		</item>
	</channel>
</rss>

