<?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>pcfe&#039;s blog</title>
	<atom:link href="http://www.pcfe.net/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pcfe.net/wordpress</link>
	<description>Never attribute to malice that which is adequately explained by stupidity.</description>
	<lastBuildDate>Fri, 18 May 2012 08:11:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>disabling print job complete notifications in gnome3</title>
		<link>http://www.pcfe.net/wordpress/2012/05/disabling-print-job-complete-notifications-in-gnome3/</link>
		<comments>http://www.pcfe.net/wordpress/2012/05/disabling-print-job-complete-notifications-in-gnome3/#comments</comments>
		<pubDate>Fri, 18 May 2012 08:11:46 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[braindump]]></category>
		<category><![CDATA[F16]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gnome3]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=1082</guid>
		<description><![CDATA[In Fedora 16 (and I presume other distributions using gnome3), each print job generates a notification. If one prints a lot, this ends up cluttering the notification bar. mkasik kindly pointed out how to make these notifications stop. But this will also turn off &#8220;gsd-printer&#8221; which is used for installation of newly plugged printers. At [...]]]></description>
			<content:encoded><![CDATA[<p>In Fedora 16 (and I presume other distributions using gnome3), each print job generates a notification. If one prints a lot, this ends up cluttering the notification bar.</p>
<p><em>mkasik</em> kindly pointed out how to make these notifications stop.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
gsettings set org.gnome.settings-daemon.plugins.print-notifications active false
</pre>
<p>But this will also turn off &#8220;gsd-printer&#8221; which is used for installation of newly plugged printers.</p>
<p>At the time of writing this (2012-05-18) there is no finer grained control, so you have to choose which you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2012/05/disabling-print-job-complete-notifications-in-gnome3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: roomshare?</title>
		<link>http://www.pcfe.net/wordpress/2012/04/roomshare/</link>
		<comments>http://www.pcfe.net/wordpress/2012/04/roomshare/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 17:40:19 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[Helsinki]]></category>
		<category><![CDATA[temp]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=935</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.pcfe.net/wordpress/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-935">Password:<br />
<input name="post_password" id="pwbox-935" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2012/04/roomshare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: summer 2012</title>
		<link>http://www.pcfe.net/wordpress/2012/03/summer-2012/</link>
		<comments>http://www.pcfe.net/wordpress/2012/03/summer-2012/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 11:43:24 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[Berlin]]></category>
		<category><![CDATA[Helsinki]]></category>

		<guid isPermaLink="false">https://www.pcfe.net/wordpress/?p=903</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.pcfe.net/wordpress/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-903">Password:<br />
<input name="post_password" id="pwbox-903" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2012/03/summer-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tanks at work</title>
		<link>http://www.pcfe.net/wordpress/2011/11/tanks-at-work/</link>
		<comments>http://www.pcfe.net/wordpress/2011/11/tanks-at-work/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 14:41:36 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[pictures]]></category>
		<category><![CDATA[Helsinki]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=810</guid>
		<description><![CDATA[no, no, not what you think. The Finnish army is just running an exercise. Never seen one of their Finnish made toys from up close.]]></description>
			<content:encoded><![CDATA[<p>no, no, not what you think. The Finnish army is just running an exercise.</p>
<p>Never seen one of their Finnish made toys from up close.</p>

<a href='http://www.pcfe.net/wordpress/2011/11/tanks-at-work/20111110_003/' title='20111110_003'><img width="150" height="84" src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/11/20111110_003.jpg" class="attachment-thumbnail" alt="20111110_003" title="20111110_003" /></a>
<a href='http://www.pcfe.net/wordpress/2011/11/tanks-at-work/20111110_005/' title='20111110_005'><img width="150" height="84" src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/11/20111110_005.jpg" class="attachment-thumbnail" alt="20111110_005" title="20111110_005" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/11/tanks-at-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TPM to feed random number generator</title>
		<link>http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/</link>
		<comments>http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 07:00:41 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[F14]]></category>
		<category><![CDATA[F15]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[RHEL5]]></category>
		<category><![CDATA[RHEL6]]></category>
		<category><![CDATA[TPM]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=673</guid>
		<description><![CDATA[One of the uses of a TPM is to feed /dev/random on your linux box. I will not go into the political implications of TPM. See also Matt Domsch&#8217;s blog. Those still running RHEL5/CentOS5, be sure to have rng-utils-2.0-4 or later and kernel-2.6.18-238.el5 or later. Some of the following steps are specific to my HP [...]]]></description>
			<content:encoded><![CDATA[<p>One of the uses of a TPM is to feed /dev/random on your linux box. I will <strong>not</strong> go into the political implications of TPM.</p>
<p>See also <a href="http://domsch.com/blog/?p=107">Matt Domsch&#8217;s blog</a>.</p>
<p>Those still running RHEL5/CentOS5, be sure to have <a href="http://rhn.redhat.com/errata/RHBA-2011-0116.html">rng-utils-2.0-4</a> or later and <a href="http://rhn.redhat.com/errata/RHSA-2011-0017.html">kernel-2.6.18-238.el5</a> or later.</p>
<p>Some of the following steps are specific to my HP ProLiant MicroServer, but most will apply to any modern linux and HW (one would prefer the TPM to be an integral part of the motherboard as opposed to a module).</p>
<h3>Physical installation in HP ProLiant MicroServer</h3>
<p>This step will not be necessary on boards which come with a built-in TPM. Security wise, built-in is much preferred but for RNG use it does not really matter. Other motherboards will have a similar procedure.</p>
<p>Follow HP&#8217;s instructions in the manual that came with the MicroServer. Remember to not only remove all cables before trying to pull the board out fully, but you also, on the back, remove the screw of any PCIe cards you installed before the tray can be moved at all.</p>
<h3>Enabling in the BIOS</h3>
<p>All this is done with BIOS 041. I did not test if older versions of the BIOS work.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# dmidecode |grep -A 3 ^BIOS
BIOS Information
	Vendor: HP
	Version: O41
	Release Date: 07/29/2011
</pre>
<p>enter BIOS with F10 during POST. Enable it under <em>Advanced</em>, <em>Trusted Computing</em>.<br />
<a href="http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/tpm-01/" rel="attachment wp-att-677"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/10/TPM-01.png" alt="" title="TPM-01" width="649" height="535" class="alignnone size-full wp-image-677" /></a><br />
<a href="http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/tpm-03/" rel="attachment wp-att-675"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/10/TPM-03.png" alt="" title="TPM-03" width="649" height="535" class="alignnone size-full wp-image-675" /></a></p>
<p>Next time you enter the BIOS, you should see the Status as &#8216;Enabled&#8217;. If not, power cycle your box (the documentation is not 100% clear on this being needed or not).<em><br />
TPM Owner Status</em> must be <em>UnOwned</em> when you get the TPM. After YOU took ownership, it will show up in the BIOS. If you are the owner of a machine, and just installed a TPM that shows it&#8217;s owned, you have other problems than getting your random number generator fed. Go find out what happened with the TPM you have before you. Keep in mind that on certain machines you will be the user but not the ownwer (e.g.: a machine supplied by your employer). If this is not clear to you, please <a href="http://www.schneier.com/blog/archives/2005/08/trusted_computi.html">read up</a> on <a href="http://en.wikipedia.org/wiki/Trusted_Platform_Module">TPM</a>.</p>
<p><a href="http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/tpm-04/" rel="attachment wp-att-674"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/10/TPM-04.png" alt="" title="TPM-04" width="649" height="535" class="alignnone size-full wp-image-674" /></a></p>
<h3>taking onership of the TPM within linux</h3>
<p>While I did all this under RHEL6, any modern distro should support this. FWIW, I did the same under Fedora a while ago on my ThinkPad x60.<br />
Install needed software:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# yum install tpm-tools rng-tools
</pre>
<p>The vendor manual only speaks about Windows software and how to take ownership of the TPM with it. HP does recommend reading the <em>HP Trusted Platform Module Best Practices White Paper</em>, but I somehow fail to locate that document on HP&#8217;s site. Do leave a comment if you know where it can be obtained.</p>
<p>After the machine boots, you should see <code>/dev/tpm0</code>, if not, verify your BIOS settings.</p>
<p>It is imperative that you read and understand <em>tpm_takeownership(8)</em> before continuing.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# man tpm_takeownership
</pre>
<p>Now claim ownership of your TPM.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# service tcsd status
tcsd is stopped
# tpm_version
Tspi_Context_Connect failed: 0x00003011 - layer=tsp, code=0011 (17), Communication failure
# /etc/init.d/tcsd start
Starting tcsd:                                             [  OK  ]
# tpm_version
  TPM 1.2 Version Info:
  Chip Version:        1.2.3.17
  Spec Level:          2
  Errata Revision:     2
  TPM Vendor ID:       IFX
  Vendor Specific data: 03110008 00
  TPM Version:         01010000
  Manufacturer Info:   49465800
# tpm_takeownership
Enter owner password:
Confirm password:
Enter SRK password:
Confirm password:
</pre>
<p>For the aim of feeding <code>/dev/random</code>, we could also take the well known passwords. You did read the man page, right? But why set well known ones when you can have your own?</p>
<p>If you plan to use software that expects the passwords to be in unicode, use the <code>--unicode</code> flag. Read <code>/usr/share/doc/trousers-*/README</code> for details.</p>
<p>While we did activate tcsd to be able to take ownership, &#8220;<em>tcsd is a user space daemon that should be (according to the TSS spec) the only portal to the TPM device driver.</em>&#8221; from tcsd(8). As such, you have to choose between rngd and tcsd. We only use the TPM to feed the entropy pool and disable tcsd.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# chkconfig tcsd --list
tcsd           	0:off	1:off	2:off	3:off	4:off	5:off	6:off
# service tcsd stop
Stopping tcsd:                                             [  OK  ]
</pre>
<p>After taking ownership, your BIOS will show;<br />
<a href="http://www.pcfe.net/wordpress/?attachment_id=701"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/10/TPM-05.png" alt="" title="TPM-05" width="649" height="535" class="alignnone size-full wp-image-701" /></a></p>
<h3>using the TPM to feed the RNG</h3>
<p>Now, first get a baseline when rngd is not on.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# cat /dev/random | rngtest -c 1
</pre>
<p>As this will be very slow, we check only 1 block. But ideally you&#8217;d check 100.</p>
<p>Now manually launch rhgd (in background mode) and check the rngtest results against your baseline.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# /sbin/rngd -b -t 1
# cat /dev/random | rngtest -c 100
</pre>
<p>It&#8217;s OK to test 100 blocks now.<br />
If you do not get dramatically better values for <em>input channel speed</em>, something went wrong.<br />
to be sure rngd uses <code>/dev/tpm0</code>, strace it and look at the open calls with <code>-etrace=open</code></p>
<p>Do keep in mind that a TPM is no speed daemon, expect to see an <em>input channel speed</em> in the <strong>Kibits/s</strong> range. Mine gives about 90</p>
<h3>enabling at boot</h3>
<p><a href="https://bugzilla.redhat.com/show_bug.cgi?id=215371">Bug 215371</a> being closed, I just enabled this in rc.local. N.b. the init script attached to that bug is not TPM specific, so do not blindly use that.<br />
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=130350#c8">Comment 8 in bug 130350</a> explains why this is not enabled by default.<br />
Anyway, if your distro of choice also does not run rngd at boot, do something along these lines;</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
cat &lt;&lt;EOF &gt;&gt;/etc/rc.local
# rng-tools has no init script
# c.f. RHBZ 215371 and RHBZ 130350
#  launching now to feed the RNG via the TPM
/sbin/rngd -b -t 1
EOF
</pre>
<h3>available entropy</h3>
<p>You can check how much entropy is available with </p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
# cat /proc/sys/kernel/random/entropy_avail
</pre>
<h3>use for KVM guests</h3>
<p>kernel 2.6.25 or later has virtio-rng.ko but all my guest machines run older kernels, so I can not test this. See <a href="http://www.linux-kvm.org/page/Choose_the_right_kvm_%26_kernel_version">here</a>.</p>
<h3>addendum</h3>
<h4>on the quality of the generated random numbers and the overall security assessment of TPMs</h4>
<p>I got this from a colleague, who is more knowledgeable in this field than me, in response to the question &#8220;My only concern how is how secure these black boxes really are.. perhaps /dev/urandom is more secure, given it’s at least been peer-reviewed and scrutinised.&#8221;</p>
<blockquote><p>
As with all HSMs, its owner cannot directly check the HSM&#8217;s firmware and chip-design.  BTW, the latter applies to almost all hardware, e.g. also all hardware-RNGs in CPUs or southbridges.</p>
<p>As manufacturer-documentation can be deemed to be not very trustworthy (even without any conspiracy-theory, it is clear that their marketing always intends to state that the delivered entropy is &#8220;perfect&#8221;), although some docu is quite extensive and comprehensible (e.g for VIA&#8217;s Padlock), that is what Common-Criteria evaluations are for:</p>
<p>1. A Protection-Profile (PP) is written, which defines &#8230;<br />
1a. the Target-of-Evaluation (TOE): Which parts of the whole security-system are evaluated (here: the TPM, but not its hardware-interface or any host-side hardware or software, e.g. host-firmware or -driver talking to the TPM).<br />
1b. the security targets: Which kind of attacks to protect against.<br />
1c. the security functions: which specific functions of the TOE are inspected.<br />
1d. the methods and depth of the evaluation by choosing an EAL-level defined by Common-Criteria.org (here: EAL4 with three additional methods from EAL5, hence EAL4+)</p>
<p>For the TPM 1.2 the TCG has written the PP and published it on their web-site, as it must be accesible for TPM-owners in order to comprehend the details of the security asessments provided by a CC-evaluation.</p>
<p>2. Manufacturers submit their TOE (here: a specific TPM-model) along with evaluation-documentation (at anything higher than EAL4, basically the complete hardware- and software-design) to an independent, CC-accredited test-lab, which evaluates the TOE according to the PP and writes an evaluation-report.</p>
<p>3. A certification-authority for CC-evaluations (e.g. NIST, the german BSI, the french ANSSI, chosen by the TOE-manufaturer) checks the evaluation-report for correctness (formal and technical) and results, and publishes a CC-certificate.</p>
<p>In short: Yes, the HW-RNG in a TPM 1.2 part of the TPM-PP&#8217;s TOE, and its security-target (i.e. quality of entropy) is defined there.  There are CC-certified TPMs (with the TCG-PP, and in case of STM also with a different PP @EAL5+), e.g. by Infineon.
</p></blockquote>
<h3>kudos</h3>
<ul>
<li>dcleal for pointing out this feature</li>
<li>Florian for explaining how the TPM works in depth</li>
<li>Dell for writing the upstream patches that <a href="http://sourceforge.net/tracker/index.php?func=detail&#038;aid=2261605&#038;group_id=3242&#038;atid=303242">add tpm rng support to rngtools</a></li>
<li>the unnamed colleague who provided more info on the security evaluation</li>
</ul>
<h3>to do</h3>
<ul>
<li>find out how to get rngd to read via trousers&#8217; tcsd</li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/11/tpm-to-feed-random-number-generator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Logitech Illuminated Ultrathin Keyboard with Backlighting</title>
		<link>http://www.pcfe.net/wordpress/2011/10/logitech-illuminated-ultrathin-keyboard-with-backlighting/</link>
		<comments>http://www.pcfe.net/wordpress/2011/10/logitech-illuminated-ultrathin-keyboard-with-backlighting/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 18:00:52 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[gizmo]]></category>
		<category><![CDATA[F15]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gnome3]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[logitech]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=329</guid>
		<description><![CDATA[While for my VDR I got the the wireless version a few days earlier, the USB version arrived late last week and is attached to the machine where I use a keyboard most. As always, I got myself a US layout. The good: tactile feel is very much to my liking. backlight is controlled directly [...]]]></description>
			<content:encoded><![CDATA[<p>While for my <a href="http://www.vdr-portal.de/" target="_blank">VDR</a> I got the the <a href="http://www.logitech.com/en-us/keyboards/keyboard/devices/7288" target="_blank">wireless version</a> a few days earlier, the <a href="http://www.logitech.com/en-us/keyboards/keyboard/devices/4740" target="_blank">USB version</a> arrived late last week and is attached to the machine where I use a keyboard most. As always, I got myself a US layout.</p>
<h3>The good:</h3>
<ul>
<li>tactile feel is very much to my liking.</li>
<li>backlight is controlled directly on the keyboard, with a single button that switches through 100, 50, 25 and 0% light intensity.</li>
<li>most of the <em>FN keys</em> work out of the box under a modern Linux distribution (e.g. F15&#8242;s gnome3 allows you reassigning easily under the <code>System Settings, Keyboard, Shortcuts</code>). While an entertaining feature, I have no use for it and did not bother investigating why FN-F4, FN-F5 and FN-F6 did not trigger in the reassign phase while the others worked fine, nor why FN-F9 reports as a key named <em>Tools</em> instead of some music related name (the icon is a note).</li>
</ul>
<h3>The bad:</h3>
<ul>
<li>the USB cord could be 10 cm longer, then again my machine is further than usual from the keyboard.</li>
<li>the last row of keys (ctrl, win key, alt, &#8230;) is less bright than the other keys. No biggie but at this price, for a wired keyboard, I expect even lighting.</li>
<li>the block above the arrow keys has a layout unfamiliar to me.</li>
<li>the F1-F12 keys have their FN function lit (e.g. <em>Eject</em> as opposed to F8), I&#8217;d like F1-F12 lit. But well, I know most buyers will not share my preference (no, SetPoint does not run on my <a href="http://fedoraproject.org/" target="_blank">OS of choice</a>).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/10/logitech-illuminated-ultrathin-keyboard-with-backlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nervous tense tired</title>
		<link>http://www.pcfe.net/wordpress/2011/10/nervous_tense_tired/</link>
		<comments>http://www.pcfe.net/wordpress/2011/10/nervous_tense_tired/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 08:01:42 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[jokes]]></category>
		<category><![CDATA[pictures]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=650</guid>
		<description><![CDATA[An old joke but I still like it. Write your text, apply a 30 pixel motion blur at 90°. Took me 3 minutes in GIMP. Print it, hang it on a wall, see people getting confused.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pcfe.net/wordpress/2011/10/nervous_tense_tired/nervous-tense-tired/" rel="attachment wp-att-649"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2011/10/nervous-tense-tired.png" alt="" title="nervous tense tired" width="3508" height="2480" class="alignnone size-full wp-image-649" /></a></p>
<p>An old joke but I still like it. Write your text, apply a 30 pixel motion blur at 90°. Took me 3 minutes in <a href="http://www.gimp.org/">GIMP</a>. Print it, hang it on a wall, see people getting confused.</p>
<p><a href="http://www.pcfe.net/wordpress/2011/10/nervous_tense_tired/qrcode/" rel="attachment wp-att-930"><img src="http://www.pcfe.net/wordpress/wp-content/uploads/2012/04/QRcode.png" alt="" title="QRcode" width="183" height="183" class="alignnone size-full wp-image-930" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/10/nervous_tense_tired/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git server setup</title>
		<link>http://www.pcfe.net/wordpress/2011/10/git-server-setup/</link>
		<comments>http://www.pcfe.net/wordpress/2011/10/git-server-setup/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 12:43:12 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[braindump]]></category>
		<category><![CDATA[F14]]></category>
		<category><![CDATA[F15]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[RHEL6]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=239</guid>
		<description><![CDATA[For the last decade, I have been using cvs at home to have version control over documents (mostly LaTeX) and config files. The original cvs server has been since migrated to a virtual machine. Note; this is a braindump, the examples below are taken from my bash history and then hand-edited. So do use your [...]]]></description>
			<content:encoded><![CDATA[<p>For the last decade, I have been using <strong>cvs</strong> at home to have version control over documents (mostly <em>LaTeX</em>) and config files. The original cvs server has been since migrated to a virtual machine.</p>
<p><b>Note; this is a braindump, the examples below are taken from my bash history and then hand-edited. So do use your own brain when following these steps and leave a comment if you see any editing mistakes</b></p>
<p>It was about time to move my VCS to <strong>git</strong>. I bought <em><a href='http://openlibrary.org/books/OL24480420M/Version_control_with_Git' title='View this title in Open Library' >Version control with Git: powerful techniques for centralized and distributed project management</a>, ISBN  9780596520120, published by O&#039;Reilly</em> and went for it. A braindump of what I did on my RHEL6 server follows. (Big kudos to dgrift for helping me find the mess with git&#8217;s homedirectory being set to <em>/var/lib/git</em>, see <a href="https://bugzilla.redhat.com/show_bug.cgi?id=732196" target="_blank">RHBZ #732196</a> for the problems I had.)</p>
<h2>Set up a centralised git server:</h2>
<ol>
<li><code>[root@server]# yum install git-daemon</code></li>
<li><code>[root@server]# useradd -U -Z git_shell_u mygituser -s /usr/libexec/git-core/git-shell git</code> # do NOT set the homedirectory of this user to /var/lib/git if you want to be able to log in with ssh keys.</li>
<li>dump <code>~git/.ssh/authorized_keys</code> with the usual chmod, chown and restorecon</li>
<li>make a test repo:
<ul>
<li><code>[root@server]# cd /var/lib/git</code></li>
<li><code>[root@server]# mkdir test.git</code></li>
<li><code>[root@server]# cd test.git</code></li>
<li><code>[root@server]# git init --bare</code></li>
<li><code>[root@server]# chown -R git:git /var/lib/git/test.git</code></li>
<li><code>[root@server]# restorecon -rv /var/lib/git/test.git</code></li>
</ul>
</li>
<li>try working with with it from another box:
<ul>
<li>[user@machine]$ git clone git+ssh://git@server.example.com/var/lib/git/test.git</li>
<li>[user@machine]$ cd test/</li>
<li>[user@machine]$ vi README</li>
<li>[user@machine]$ git commit README</li>
<li>[user@machine]$ git push origin master</li>
</ul>
</li>
</ol>
<h2>Migrate from cvs:</h2>
<p>Read <a href="http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html">gitcvs-migration</a> and repeat the steps below for all your CVS repos</p>
<ul>
<li>[user@server]$ mkdir -p ~/tmp/cvs/documents&#8221;</li>
<li>[user@server]$ mkdir -p ~/tmp/git/documents&#8221;</li>
<li>[user@server]$ cd ~/tmp/cvs/&#8221;</li>
<li>[user@server]$ export CVSROOT=&#8221;:ext:oldcvsuser@old-server:/old/cvs/location/cvsroot&#8221;</li>
<li>[user@server]$ export CVS_RSH=ssh #only if you also used ssh before</li>
<li>[user@server]$ cvs -d $CVSROOT checkout documents</li>
<li>[user@server]$ git cvsimport -C /home/pcfe/work/git/documents documents</li>
<li><code>[root@server]# cd /var/lib/git</code></li>
<li><code>[root@server]# mkdir documents-repo.git</code></li>
<li><code>[root@server]# cd documents-repo.git</code></li>
<li><code>[root@server]# git init --bare</code></li>
<li><code>[root@server]# chown -R git:git /var/lib/git/documents-repo.git/</code></li>
<li><code>[root@server]# restorecon -rv /var/lib/git/documents-repo.git</code></li>
<li>[root@server]# git &#8211;bare fetch /home/user/tmp/git/documents/ master:master</li>
<li>and now for each remaining repo</li>
<li>[user@server]$ mkdir -p ~/tmp/cvs/documents&#8221;</li>
<li>[user@server]$ mkdir -p ~/tmp/git/documents&#8221;</li>
<li>[user@server]$ cd ~/tmp/cvs/&#8221;</li>
<li>[user@server]$ cvs -d $CVSROOT checkout SPECS</li>
<li>[user@server]$ git cvsimport -C /home/pcfe/work/git/SPECS SPECS</li>
<li>[root@server]# cd /var/lib/git/</li>
<li>[root@server]# mkdir SPECS-repo.git</li>
<li>[root@server]# chown git.git SPECS-repo.git</li>
<li>[root@server]# cd SPECS-repo.git</li>
<li>[root@server]# git &#8211;bare fetch /home/pcfe/work/git/SPECS/ master:master</li>
<li>[root@server]# restorecon -rv /var/lib/git</li>
</ul>
<h2>Verify your backups</h2>
<p>Those who do not have a tested backup shall be laughed at. So take this moment to insert a break of a couple days and verify that all your newly created repos in <code>/var/lib/git/</code> end up on your regular backups. And make sure you can successfully restore.</p>
<h2>Work with the centralised git repo</h2>
<p>Depending on your needs, you might want to <a href="http://fclose.com/b/linux/366/set-up-git-server-through-ssh-connection/">Set Up a Git Server through SSH Connection</a>.</p>
<p>To pull it all to your various work machines;</p>
<ul>
<li>[user@machine]$ mkdir -p ~/work/git/CentralisedRepo</li>
<li>[user@machine]$ cd ~/work/git/CentralisedRepo</li>
<li>[user@machine]$ git clone git+ssh://git@server.example.com/var/lib/git/documents-repo.git</li>
<li>[user@machine]$ git clone git+ssh://git@server.example.com/var/lib/git/SPECS-repo.git</li>
<li>clone for each repo in turn
	</li>
<li>[user@machine]$ cd SPECS-repo.git</li>
<li>[user@machine]$ vi somefile</li>
<li>[user@machine]$ git commit somefile</li>
<li>[user@machine]$ git push origin</li>
</ul>
<h2>Other things to do with your git server</h2>
<h3>Sparkleshare</h3>
<p><a href="http://blog.linuxgrrl.com/">Máirín Duffy</a> has an <a href="http://blog.linuxgrrl.com/2011/05/25/fedora-sparkleshare-howto/">excellent writeup</a> on how to use Sparkleshare with Fedora. That the git server runs on RHEL6 is not relevant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/10/git-server-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apcupsd on RHEL5 / CentOS5</title>
		<link>http://www.pcfe.net/wordpress/2011/09/apcupsd-on-rhel5-centos5/</link>
		<comments>http://www.pcfe.net/wordpress/2011/09/apcupsd-on-rhel5-centos5/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 12:50:25 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[braindump]]></category>
		<category><![CDATA[apcupsd]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[RHEL5]]></category>
		<category><![CDATA[UPS]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=531</guid>
		<description><![CDATA[While the current Smart-UPS (aka SMT) range of UPS from APC has much fewer variables exposed in a way that is useful for fancy apcupsd usage (you&#8217;ll find apcupsd in EPEL), they are still amply sufficient for home use. Basically, the UPS gives an estimated time left at current load and the remaining battery level. [...]]]></description>
			<content:encoded><![CDATA[<p>While the current Smart-UPS (aka SMT) range of UPS from <a href="http://www.apc.com/">APC</a> has much fewer variables exposed in a way that is useful for fancy <a href="http://www.apcupsd.com/">apcupsd</a> usage (you&#8217;ll find apcupsd in <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>), they are still amply sufficient for home use. Basically, the UPS gives an estimated time left at current load and the remaining battery level. At home these are anyway the only two readings I want to trigger scripts on.</p>
<h2>On the machine that has a USB connection to the UPS</h2>
<p>Connect the UPS via USB to your server. Then install apcupsd</p>
<pre class="brush: plain; title: ; notranslate">
# yum install apcupsd
</pre>
<p>and adjust <code>/etc/apcupsd/apcupsd.conf</code>. I changed the following from defaults to be a bit more conservative;</p>
<pre class="brush: plain; title: ; notranslate">
BATTERYLEVEL 10
MINUTES 7
</pre>
<p>Be sure to set an email address you read often in the scripts that are run on events (e.g.: <code>/etc/apcupsd/onbattery</code> ), ideally using an email to SMS gateway. For USB based SMT series, no further changes are necessary as that type of connection is the default.</p>
<p>For the next step to work, you&#8217;ll want to allow access to the daemon through the local firewall. Something along the lines of</p>
<pre class="brush: plain; title: ; notranslate">
# iptables -I defaults 1 -i eth0 -p tcp -m tcp --dport 3551 -j ACCEPT
</pre>
<p>Or use system-config-firewall to allow 3551 TCP.</p>
<h2>On machines that get power from the same UPS and can reach the main box over the network</h2>
<p>Install and configure <code>/etc/apcupsd/apcupsd.conf</code> as before, but this time point it at a machine called server. Additionally, I shut down most of these boxes earlier.</p>
<pre class="brush: plain; title: ; notranslate">
UPSCABLE ether
DEVICE server:3551
BATTERYLEVEL 15
MINUTES 10
</pre>
<p>And you may want to take more drastic action in the <code>/etc/acpupsd/commfailure</code> script if you want to react to network outages.</p>
<p>All the other options are sane if all you want is your machines to shut down cleanly before the UPS runs fully out of juice.</p>
<p>Unimportant things (e.g. the WLAN AP) get plugged into the secondary ports (caveat the SMT750I does not have these) and the behaviour of these ports configured on the UPS front panel.</p>
<p>Mind <a href="https://bugzilla.redhat.com/show_bug.cgi?id=661304">bug 661304</a>, as RHEL5 is still using SysV init, my <code>/etc/init.d/halt</code> reads near the bottom:</p>
<pre class="brush: plain; title: ; notranslate">
...
# Now halt or reboot.
echo $&quot;$message&quot;
if [ -f /fastboot ]; then
 echo $&quot;On the next boot fsck will be skipped.&quot;
elif [ -f /forcefsck ]; then
 echo $&quot;On the next boot fsck will be forced.&quot;
fi

if [ &quot;$command&quot; = /sbin/halt -a -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
        . /etc/sysconfig/ups
        if [ &quot;$SERVER&quot; = &quot;yes&quot; -a &quot;$MODEL&quot; = &quot;upsdrvctl&quot; ] ; then
                /sbin/upsdrvctl shutdown
        elif [ &quot;$SERVER&quot; = &quot;yes&quot; -a &quot;$MODEL&quot; != &quot;NONE&quot; -a -n &quot;$MODEL&quot; -a -n &quot;$DEVICE&quot; ] ; then
                $MODEL $OPTIONS_HALT -k $DEVICE
        fi
fi

# First, try kexec. If that fails, fall back to rebooting the old way.
[ -n &quot;$kexec_command&quot; ] &amp;&amp; $kexec_command -e -x &gt;&amp; /dev/null
...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/09/apcupsd-on-rhel5-centos5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure dynamic DNS howto notes for RHEL5</title>
		<link>http://www.pcfe.net/wordpress/2011/09/secure-dynamic-dns-howto-notes-for-rhel5/</link>
		<comments>http://www.pcfe.net/wordpress/2011/09/secure-dynamic-dns-howto-notes-for-rhel5/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 01:00:58 +0000</pubDate>
		<dc:creator>pcfe</dc:creator>
				<category><![CDATA[braindump]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[RHEL5]]></category>

		<guid isPermaLink="false">http://www.pcfe.net/wordpress/?p=457</guid>
		<description><![CDATA[The must read Secure dynamic DNS howto has all the steps you need to set up DDNS updates with BIND. What follows are some very terse notes for RHEL5, highlighting steps not directly obvious from that howto. name of the key Whenever you need to choose a keyname, take the fqdn of the DHCP server, [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>must read</strong> <a href="http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html">Secure dynamic DNS howto</a> has all the steps you need to set up DDNS updates with BIND.</p>
<p>What follows are some very terse notes for RHEL5, highlighting steps not directly obvious from that howto.</p>
<h2>name of the key</h2>
<p>Whenever you need to choose a keyname, take the fqdn of the DHCP server, with a trainign dot! e.g dhcp-server.example.com.</p>
<h2>allowing the dhcp server to not update more than expected</h2>
<p>If my reading of  <em><a href='http://openlibrary.org/books/OL7581276M/DNS_and_BIND_(5th_Edition)' title='View this title in Open Library' >DNS and BIND (5th Edition)</a>, ISBN  9780596100575, published by O&#039;Reilly Media, Inc.</em> was correct, then the following update policies are as tight as can be. Obviously, somewhere earlier in /etc/named.conf there is a section defining the key <em>dhcp-server.example.com.</em> which I will not paste here.<br />
For the forward zone I used this</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
zone &quot;wlan.example.com.&quot; {
    type master;
    file &quot;named.wlan.example.com&quot;;
    update-policy {
        grant dhcp-server.example.com. wildcard *.wlan.example.com. A TXT;
    };
};
</pre>
<p>While for the reverse zone I used</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
zone &quot;2.168.192.in-addr.arpa.&quot; {
    type master;
    file &quot;named.192.168.2&quot;;
    update-policy {
        grant dhcp-server.example.com. wildcard *.2.168.192.in-addr.arpa. PTR;
    };
};
</pre>
<h2>SELinux</h2>
<p>As BIND will now be modifying it&#8217;s own files, you need to allow this</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
setsebool -P named_write_master_zones 1
</pre>
<p>see the <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-BIND-Booleans.html">RHEL6 documentation</a> for more details. </p>
<h2>logging</h2>
<p>logfile should go to the data subdirectory</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
logging {
        // for logging see
        // from: http://www.netadmintools.com/part233.html
        // and:  http://www.netadmintools.com/html/5named.conf.man.html
        channel default_debug {
                file &quot;data/named.run&quot;;
                severity dynamic;
        };
        category dnssec   { security_log; };
        category update   { security_log; };
        category security { security_log; };

        channel security_log {
            file &quot;data/dns-security.log&quot; versions 5 size 20m;
                // every time the log grows over 20 Mbyte, it will
                // backup and rollover. Maximum 5 backups will be kept.
            print-time yes;
            print-category yes;
            print-severity yes;
            severity info;
        };
</pre>
<p>Yes, all of the above is not sufficient for you to copypasta a config together, that is intended. Read the <a href="http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html">Secure dynamic DNS howto</a>, it is much better written and has more depth than I could ever provide in a quick braindump.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcfe.net/wordpress/2011/09/secure-dynamic-dns-howto-notes-for-rhel5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

