<?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>Sysadmin Ramblings</title>
	<atom:link href="http://ramblings.narrabilis.com/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://ramblings.narrabilis.com/wp</link>
	<description>Scripts, settings, and fixes...</description>
	<lastBuildDate>Fri, 29 Jan 2010 18:58:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>using rsync with ssh keys via authorized_keys and command=&#8221;rsync &#8230;&#8221;</title>
		<link>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/</link>
		<comments>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 18:58:18 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=275</guid>
		<description><![CDATA[Scenario I
Backup directory /mnt/one from server pris to client directory /home/user/two on client deckard by initiating the the copy from the client deckard. (i.e. send files from the server to the client)


create ssh keys using ssh-keygen

[user@deckard ~]$ cd .ssh
[user@deckard .ssh]$ ssh-keygen -t dsa -f deckard
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase): 
Enter [...]]]></description>
			<content:encoded><![CDATA[<h1>Scenario I</h1>
Backup directory <tt>/mnt/one</tt> from server <tt>pris</tt> to client directory <tt>/home/user/two</tt> on client <tt>deckard</tt> by initiating the the copy from the client deckard. (i.e. send files from the server to the client)
<p>
<ul>
<li>create ssh keys using ssh-keygen
<blockquote><code><br />
[user@deckard ~]$ cd .ssh<br />
[user@deckard .ssh]$ ssh-keygen -t dsa -f deckard<br />
Generating public/private dsa key pair.<br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in deckard.<br />
Your public key has been saved in deckard.pub.<br />
The key fingerprint is:<br />
17:f4:69:30:6c:67:5a:73:2e:6f:ba:4b:8b:94:2a:f9 user@deckard.example.com<br />
The key&#039;s randomart image is:<br />
+&#45;-[ DSA 1024]&#45;&#45;&#45;-+<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .o+=..&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..=++&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.o. .&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S .&nbsp;&nbsp;o&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . .&nbsp;&nbsp;o&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp;o .o&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;&nbsp;o o..&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oE . +o&nbsp;&nbsp; |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+<br />
&nbsp;<br />
</code></blockquote>
<li>create a new user for the sync operation and copy the public key you just created to pris
<blockquote><code><br />
[root@pris ~]# useradd deckardsync<br />
[root@pris ~]# su - deckardsync<br />
[deckardsync@pris ~]$ mkdir .ssh<br />
[deckardsync@pris ~]$ cd .ssh<br />
[deckardsync@pris .ssh]$ scp user@deckard:.ssh/deckard.pub authorized_keys<br />
deckard.pub&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100% 1194&nbsp;&nbsp;&nbsp;&nbsp; 1.2KB/s&nbsp;&nbsp; 00:00<br />
</code></blockquote>
<li>make the <tt>/mnt/one</tt> directory accessible to deckardsync (or ideally owned by this user)
<blockquote><code><br />
[root@pris ~]# chown deckardsync /mnt/one<br />
</code></blockquote>
<li>edit authorized_keys and add the commands for rsync into the key
<blockquote><code><br />
command=&quot;rsync &#45;-server&nbsp;&nbsp;&#45;-sender -vlogDtprCz . /mnt/one/&quot; ssh-dss AAAAB3NzaC1kc3MAAACBANbyPA4Vkem1tXrBcmkc9+SHeBrgHKbeBdS2MZKMBT/CsPWPSwMFQGg3GzX2KFrIVlZW/+OfkFcrZabMxtLb4CfvFgZsK18hcyYWZobhtpzqfsoolVnWbHdcmxFqyUq9fIK5iPA2UnvLoLRCDuklQNZ+V8o7fiCiPzXw5sqw3weRAAAAFQDKbAINhyt3OzJhP680PqrA9vHNFwAAAIB0mmnu9rfUKnSAH8UV068H28NEaNuIvSzQchvsPpBZmLpN/yr0mUbWdUJtVfFO72fbhQW+gQmEydCoPgehAGCx0g5jcs+0J7nhDlCqCqYAluD/79jJvEr7Tc33u0QTJSEX9My5X6OVtKByGfGPIyeLdhdsM2s70xbXKpfV4j8KpgAAAIEAnbxqsdbxpZ/vKZMJCW4TuHzOk76By5HHHHRb6XIUTsImQmoHrH1T2ioVil6eNp+V02hbYzbs8OuMqj6ne3gLzIyPqIP1OHuusisrLKgtWTC74lZnZ48d9QCyUHI48yZyoISs0HvEvC08LHYqsq1z1ntCHAde4iszE2TAMsYBat4= user@deckard.example.com<br />
</code></blockquote>
Note: there are no line breaks in the above key&#8230; the file has only one line.
<li>copy something into /mnt/one on pris
<blockquote><code><br />
[root@pris ~]# cd /mnt/one<br />
[root@pris one]# cp -a /usr/share/doc/rsync-2.6.8 .<br />
</code></blockquote>
<li> start rsync on deckard using the ssh key
<blockquote><code><br />
[user@deckard .ssh]$ rsync -e &#039;ssh -i deckard -l deckardsync&#039; -Cavz pris:/mnt/one /home/user/two/<br />
receiving file list &#46;.. done<br />
./<br />
rsync-2.6.8/<br />
rsync-2.6.8/COPYING<br />
rsync-2.6.8/README<br />
rsync-2.6.8/tech_report.tex<br />
&nbsp;<br />
sent 98 bytes&nbsp;&nbsp;received 14416 bytes&nbsp;&nbsp;29028.00 bytes/sec<br />
total size is 36507&nbsp;&nbsp;speedup is 2.52<br />
[user@deckard .ssh]$ ls ~/two<br />
rsync-2.6.8<br />
</code></blockquote>
</ul>

<h1>Scenario II</h1>
Backup directory <tt>/home/user/two</tt> from client <tt>deckard</tt> to server directory <tt>/mnt/three</tt> on server <tt>pris</tt>
<p>
The steps involved here are essentially the same with only one small change in the authorized_keys, drop the &#8212;sender option to rsync (since pris is no longer the sender)
<ul>
<li>create new ssh key for the transfer in this direction.
<blockquote><code><br />
[user@deckard .ssh]$ ssh-keygen -t dsa -f pris<br />
Generating public/private dsa key pair.<br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in pris.<br />
Your public key has been saved in pris.pub.<br />
The key fingerprint is:<br />
75:67:7a:ca:2f:b2:11:f4:83:50:27:07:50:0b:55:a3 user@deckard.math.ias.edu<br />
The key&#039;s randomart image is:<br />
+&#45;-[ DSA 1024]&#45;&#45;&#45;-+<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o+*o=&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o * .&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. E . o&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + + +&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S o + .&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o +&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. o&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#46;...&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.o ..&nbsp;&nbsp;|<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+<br />
</code></blockquote>
<li>copy the key to pris and append it to authorized_keys
<blockquote><code><br />
[root@pris .ssh]# scp user@deckard:.ssh/pris.pub .<br />
user@deckard&#039;s password: <br />
pris.pub&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100%&nbsp;&nbsp;617&nbsp;&nbsp;&nbsp;&nbsp; 0.6KB/s&nbsp;&nbsp; 00:00&nbsp;&nbsp;&nbsp;&nbsp;<br />
[root@pris .ssh]# echo -n &#039;command=&quot;rsync &#45;-server -vlogDtprCz . /mnt/three&quot; &#039; &gt;&gt;authorized_keys<br />
[root@pris .ssh]# cat pris.pub &gt;&gt;authorized_keys<br />
</code></blockquote>
<li>initiate the transfer from deckard, this time acting as the sender not the receiver (flip sender for receiver)
<blockquote><code><br />
[user@deckard .ssh]$ rsync -e &#039;ssh -i pris -l deckardsync&#039; -Cavz /home/user/two/ pris:/mnt/three<br />
building file list &#46;.. done<br />
./<br />
rsync-2.6.8/<br />
rsync-2.6.8/COPYING<br />
rsync-2.6.8/README<br />
rsync-2.6.8/tech_report.tex<br />
&nbsp;<br />
sent 14422 bytes&nbsp;&nbsp;received 98 bytes&nbsp;&nbsp;29040.00 bytes/sec<br />
total size is 36507&nbsp;&nbsp;speedup is 2.51<br />
</code></blockquote>
</ul>

Now you just need to put that rsync line in a cronjob and you&#8217;ll have automatic syncing.  (if you do, remember to use the full path for the ssh-keys you generated).  The nice thing here is that if the key should be discovered, the only thing the attacker can do is run rsync.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>puppetserver certificates being signed in the future</title>
		<link>http://ramblings.narrabilis.com/wp/puppetserver-something/</link>
		<comments>http://ramblings.narrabilis.com/wp/puppetserver-something/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:37:11 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=270</guid>
		<description><![CDATA[We had a problem where new clients couldn&#8217;t get their keys signed properly by the puppetmaster.  Both the client and the server were in perfect sync with our ntp server.  date on both machines returned the expected results.  We are running mongrel so I went down the wrong path of thinking apache [...]]]></description>
			<content:encoded><![CDATA[We had a problem where new clients couldn&#8217;t get their keys signed properly by the puppetmaster.  Both the client and the server were in perfect sync with our ntp server.  date on both machines returned the expected results.  We are running mongrel so I went down the wrong path of thinking apache was to blame for the time problem.  It wasn&#8217;t until I started going through the certificate_factory stuff that I found the problem.
<span id="more-270"></span>
We&#8217;d errors on the certs like this:
<blockquote><code><br />
[root@puppet ~]# cd /var/lib/puppet/ssl<br />
[root@puppet ssl]# openssl verify<br />
&gt; -CAfile ./certs/ca.pem ./certs/client.example.com.pem<br />
&gt; ./certs/client.example.com.pem: /CN= client.example.com<br />
&gt; error 9 at 1 depth lookup:certificate is not yet valid<br />
&lt;/blockquote&gt;</code>

Outputing the certificate showed that the cert was being signed for a future date, even though the time on the machines is correct.
<blockquote><code><br />
[root@puppet ssl]# date<br />
Fri Jan 29 11:31:32 EST 2010<br />
[root@puppet ssl]# openssl x509 -text -in ca/signed/client.example.com.pem&nbsp;&nbsp;|grep -A2 Valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Validity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Not Before: Feb 17 13:28:04 2010 GMT<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Not After : Feb 16 13:28:04 2015 GMT<br />
&lt;/blockquote&gt;</code>

Going through the code I found that the date was being set in certificate_factory.rb
<blockquote><code><br />
def set_ttl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make the certificate valid as of yesterday, because<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# so many people&#039;s clocks are out of sync.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from = Time.now - (60*60*24)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@cert.not_before = from<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@cert.not_after = from + ttl<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
</code></blockquote>

Just for fun I ran the command through interactive ruby (irb) and discovered the source of the problem.
<blockquote><code><br />
[root@puppet ~]# ntpdate time.example.com<br />
29 Jan 09:02:45 ntpdate[9117]: step time server 192.168.0.1 offset -6377207.794727 sec<br />
[root@puppet ~]# irb<br />
irb(main):001:0&gt; Time.now<br />
=&gt; Tue Apr 13 05:25:50 -0400 2010<br />
irb(main):002:0&gt; quit<br />
[root@puppet ~]# date<br />
Fri Jan 29 08:59:07 EST 2010<br />
&lt;/blockquote&gt;</code>

I still don&#8217;t know why this happened, it&#8217;s not a puppet bug, it&#8217;s a ruby bug.  date was returning the expected results.  I checked Timezones, everything, all were good.  It was time for a kernel upgrade, so I did the upgrade and rebooted.  I haven&#8217;t seen the problem since :-/  The machine in question is a kvm running on version 88, I know there are some clock skew problems with earlier kvm&#8217;s but this is not really a skew, it&#8217;s far in the future&#8230;and the date was still being show as correct.  So ruby must&#8217;ve been calculating the date wrong somehow, it doesn&#8217;t really make sense&#8230;comments welcome.

Anyway, if this happens to you, maybe try irb and see if ruby thinks the date is wrong.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/puppetserver-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>extract private key and cert from pkcs12 (cert8.db/key3.db)</title>
		<link>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/</link>
		<comments>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 18:55:41 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=267</guid>
		<description><![CDATA[using fedora-ds/redhat-ds it creates cert8.db and key3.db to store the certs.   I wanted to extract the private key as PEM so I could import it elsewhere.


[root@ldap] cd /etc/dirsrv/slapd-ldap
[root@ldap] pk12util -o cert.p12 -n &#039;server-cert&#039; -d .
Enter Password or Pin for &#34;NSS Certificate DB&#34;:
Enter password for PKCS12 file: 
Re-enter password: 
pk12util: PKCS12 EXPORT SUCCESSFUL
[root@ldap] openssl [...]]]></description>
			<content:encoded><![CDATA[using fedora-ds/redhat-ds it creates cert8.db and key3.db to store the certs.   I wanted to extract the private key as PEM so I could import it elsewhere.
<span id="more-267"></span>
<blockquote><code><br />
[root@ldap] cd /etc/dirsrv/slapd-ldap<br />
[root@ldap] pk12util -o cert.p12 -n &#039;server-cert&#039; -d .<br />
Enter Password or Pin for &quot;NSS Certificate DB&quot;:<br />
Enter password for PKCS12 file: <br />
Re-enter password: <br />
pk12util: PKCS12 EXPORT SUCCESSFUL<br />
[root@ldap] openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts<br />
Enter Import Password:<br />
MAC verified OK<br />
[root@ldap] cat cert.pem<br />
Bag Attributes<br />
&nbsp;&nbsp;&nbsp;&nbsp;friendlyName: server-cert<br />
&nbsp;&nbsp;&nbsp;&nbsp;localKeyID: 10 F4 C2 F6 01 3C 66 AA 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 <br />
Key Attributes: &lt;No Attributes&gt;<br />
&#45;&#45;&#45;--BEGIN PRIVATE KEY&#45;&#45;&#45;--<br />
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALA7rSWdSk4CVHef<br />
&#46;..<br />
BnevX/uQwZ3L1Qo=<br />
&#45;&#45;&#45;--END PRIVATE KEY&#45;&#45;&#45;--<br />
Bag Attributes<br />
&nbsp;&nbsp;&nbsp;&nbsp;friendlyName: server-cert<br />
&nbsp;&nbsp;&nbsp;&nbsp;localKeyID: 10 DD CC EE BB 3C 33 AC 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 <br />
subject=/C=US/ST=Any State/L=Any Town/O=Example/CN=ldap.example.com<br />
issuer=/C=US/ST=Any State/L=Any Town/O=Example/CN=certmaster.example.com<br />
&#45;&#45;&#45;--BEGIN CERTIFICATE&#45;&#45;&#45;--<br />
ChMcSW5zdGl0dXRlIGZvciBBZHZhbmNlZCBTdHVkeTEeMBwGA1UECxMVU2Nob29s<br />
&#46;..<br />
gIP23WbaOw4DygMwXfbJwF5K0xxv+NALlpoaZw==<br />
&#45;&#45;&#45;--END CERTIFICATE&#45;&#45;&#45;--<br />
&nbsp;<br />
</code></blockquote>

I couldn&#8217;t figure out how to do it with pk12util and certutil alone, the key was using openssl after exporting with pk12util&#8230;]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>puppetmaster Error 400 on SERVER: Too many connections</title>
		<link>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/</link>
		<comments>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 19:30:52 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=263</guid>
		<description><![CDATA[Was getting this error on our puppetmaster that only had a few clients.
Turns out it&#8217;s just an error from mysql being passed down the line.  We share our mysql for puppet with multiple servers.  Restarting mysql saved the day&#8230;
Read http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html for instructions on increasing the limit&#8230;


mysql&#62; show variables like &#039;max_connections&#039;;
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+
&#124; Variable_name&#160;&#160; &#124; Value [...]]]></description>
			<content:encoded><![CDATA[Was getting this error on our puppetmaster that only had a few clients.<span id="more-263"></span>
Turns out it&#8217;s just an error from mysql being passed down the line.  We share our mysql for puppet with multiple servers.  Restarting mysql saved the day&#8230;
Read <a href="http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html">http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html</a> for instructions on increasing the limit&#8230;

<blockquote><code><br />
mysql&gt; show variables like &#039;max_connections&#039;;<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| Variable_name&nbsp;&nbsp; | Value |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| max_connections | 100&nbsp;&nbsp; | <br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
1 row in set (0.00 sec)<br />
&nbsp;<br />
mysql&gt; <br />
</code></blockquote>

increasing the limit in /etc/my.cnf
<blockquote><code><br />
[mysqld]<br />
datadir=/var/lib/mysql<br />
&#46;..<br />
max_connections=200<br />
mysql&gt; show variables like &#039;max_connections&#039;;<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| Variable_name&nbsp;&nbsp; | Value |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| max_connections | 200&nbsp;&nbsp; | <br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
1 row in set (0.00 sec)<br />
&nbsp;<br />
mysql&gt;<br />
</code></blockquote>]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>weird device names like devXXXXX with ifconfig on Fedora/RHEL</title>
		<link>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/</link>
		<comments>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 20:44:46 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=261</guid>
		<description><![CDATA[We had a machine that would keep coming up with devXXXXX where XXXXX is a seemingly random number.
We tried ifrename to no avail, modprobe -r didn&#8217;t help, modules.conf didn&#8217;t help.  It turned out that the HWADDR line in the ifcfg-ethX file was wrong. After fixing the line we were able to do ifup ethX [...]]]></description>
			<content:encoded><![CDATA[We had a machine that would keep coming up with devXXXXX where XXXXX is a seemingly random number.<span id="more-261"></span>
We tried ifrename to no avail, modprobe -r didn&#8217;t help, modules.conf didn&#8217;t help.  It turned out that the HWADDR line in the ifcfg-ethX file was wrong. After fixing the line we were able to do ifup ethX and the devXXXXX went away.
]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rooting the droid (Motorola A855) rooted</title>
		<link>http://ramblings.narrabilis.com/wp/rooting-the-droid/</link>
		<comments>http://ramblings.narrabilis.com/wp/rooting-the-droid/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 15:56:40 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[droid]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=253</guid>
		<description><![CDATA[This is my first android phone, so I thought I&#8217;d share my experience of rooting the phone.
All credit to Zinx Verituse over on Alldroid.org

Note: I just updated to the update released December 10th for the droid and was able to reapply the update.zip.

The instructions are here


Download this file and rename it update.zip on the sdcard.
turn [...]]]></description>
			<content:encoded><![CDATA[This is my first android phone, so I thought I&#8217;d share my experience of rooting the phone.
<b>All credit to Zinx Verituse over on Alldroid.org</b>
<p>
Note: I just updated to the update released December 10th for the droid and was able to reapply the update.zip.
<p>
The instructions are <a href="http://phandroid.com/2009/12/08/motorola-droid-rooted/">here</a>
<p>
<ul>
<li>Download this <a href="/droid/update.zip">file</a> and rename it update.zip on the sdcard.
<li>turn off the phone
<li>turn on the phone holding down the x key on the keyboard
<li>When you see the Motorola symbol, press Vol+ and Camera buttons together.
<li>An onscreen menu will appear, use the d-pad to navigate to update.zip and type return to apply
<li>After the phone reboots, Go to Settings -> Applications -> Development and enable USB Debugging
<li>Connect the droid to your desktop, download the <a href="http://developer.android.com/sdk/index.html">sdk</a>
<li>unpack the sdk and navigate to tools directory
<li>as root/administrator run <tt>adb start-server</tt>
<li>next run <tt>adb shell</tt>
<li>su to root <tt>/system/bin/su</tt>
<li>remount the root filesystem rw
<blockquote><code><br />
# mount<br />
rootfs / rootfs ro 0 0<br />
tmpfs /dev tmpfs rw,mode=755 0 0<br />
devpts /dev/pts devpts rw,mode=600 0 0<br />
proc /proc proc rw 0 0<br />
sysfs /sys sysfs rw 0 0<br />
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0<br />
none /dev/cpuctl cgroup rw,cpu 0 0<br />
/dev/block/mtdblock4 /system yaffs2 ro 0 0<br />
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0<br />
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0<br />
/dev/block/mtdblock0 /config yaffs2 ro 0 0<br />
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0<br />
# mount -o remount -o rw -t yaffs2 /dev/block/mtdblock4 /system<br />
</code></blockquote>
I don&#8217;t know if the device will always be the same (/dev/block/mtdblock4), best to check first.
<li>now make a copy of sh and call it su-something or replace su
<blockquote><code><br />
# cd /system/bin<br />
# cat sh &gt; su<br />
or<br />
# cat sh &gt;su-fake<br />
# chmod 4775 su<br />
or<br />
# chmod 4775 su-fake<br />
# exit<br />
</code></blockquote>
</ul>
You now have either su or su-fake that you can run from terminal emulator on the phone and become root.  To start using your new privileges, install <a href="/droid/busybox.zip">busybox</a> and symlink to it for all the tools that are missing&#8230;]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/rooting-the-droid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>puppet upgrade problem 0.25 &#8220;could not convert from pson&#8221;</title>
		<link>http://ramblings.narrabilis.com/wp/puppet-upgrade-problem-0-25-could-not-convert-from-pson/</link>
		<comments>http://ramblings.narrabilis.com/wp/puppet-upgrade-problem-0-25-could-not-convert-from-pson/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:35:56 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=248</guid>
		<description><![CDATA[After upgrading to 0.25, the following error occurs:

Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson: Could not find relationship target &#8221;


This turned out to be because of recipes using exec without naming the exec.  Example

exec { &#34;cat /that/file&#34;:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unless =&#62; &#34;something&#34;,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;path =&#62; &#34;/bin&#34;,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;refreshonly =&#62; false
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}


should be [...]]]></description>
			<content:encoded><![CDATA[After upgrading to 0.25, the following error occurs:
<blockquote>
Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson: Could not find relationship target &#8221;
</blockquote>
<span id="more-248"></span>
This turned out to be because of recipes using exec without naming the exec.  Example
<blockquote><code><br />
exec { &quot;cat /that/file&quot;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless =&gt; &quot;something&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path =&gt; &quot;/bin&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refreshonly =&gt; false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
</code></blockquote>

should be rewritten as

<blockquote><code><br />
exec { &quot;cat that file&quot;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command =&gt; &quot;cat /that/file&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless =&gt; &quot;something&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path =&gt; &quot;/bin&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refreshonly =&gt; false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
</code></blockquote>

The error goes away after making the change and all is well.

</code></blockquote>]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/puppet-upgrade-problem-0-25-could-not-convert-from-pson/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>no more adsense</title>
		<link>http://ramblings.narrabilis.com/wp/no-more-adsense/</link>
		<comments>http://ramblings.narrabilis.com/wp/no-more-adsense/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 11:44:53 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=246</guid>
		<description><![CDATA[I don&#8217;t really see the benefit of using adsense anymore.  Everyone knows they&#8217;re ads, no one clicks.  It doesn&#8217;t pay my isp bills anymore, so I&#8217;m dropping it.  They were only annoying anyway.]]></description>
			<content:encoded><![CDATA[I don&#8217;t really see the benefit of using adsense anymore.  Everyone knows they&#8217;re ads, no one clicks.  It doesn&#8217;t pay my isp bills anymore, so I&#8217;m dropping it.  They were only annoying anyway.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/no-more-adsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hard coding a library path into an executable while building an rpm</title>
		<link>http://ramblings.narrabilis.com/wp/hard-coding-a-library-path-into-an-executable-while-building-an-rpm/</link>
		<comments>http://ramblings.narrabilis.com/wp/hard-coding-a-library-path-into-an-executable-while-building-an-rpm/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:03:18 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=237</guid>
		<description><![CDATA[The problem I was trying to fix here was that I had a package that required a much newer version of a library than the system had installed on it.  I didn&#8217;t want to ruin the stability of the system by updating the library so I build it and placed it in a non [...]]]></description>
			<content:encoded><![CDATA[The problem I was trying to fix here was that I had a package that required a much newer version of a library than the system had installed on it.  I didn&#8217;t want to ruin the stability of the system by updating the library so I build it and placed it in a non standard location (harkening back to the solaris days I guess).  If you can&#8217;t guess what the problem was, I called the library package qt4-vlc&#8230;hint hint.
<span id="more-237"></span><p>
That part went fine, but whenever I tried to build my package that was supposed to use qt4-vlc, it would use the system libs in %{_libdir}/qt4&#8230;I tried to use rpath as a solution but couldn&#8217;t get the syntax right.  I looked at the gnu <a href="http://gcc.gnu.org/faq.html#rpath">documentation</a> but that didn&#8217;t work because gcc kept complaining that it didn&#8217;t know what the -rpath option meant.
<p>
The solution was to escape all the -rpath options that are for the linker (ld) and not gcc.  Using -Wl, passes arguments to the linker and ignores them in the compiler.  The final line I arrived at is:
<blockquote><code>LDFLAGS=&#039;-Wl,-rpath -Wl,%{_libdir}/qt4-vlc&#039; $LDFLAGS<br />
export LDFLAGS<br />
</code></blockquote>
I put this in the %build and the %install stages.  In %build I put it before %configure and in %install it&#8217;s before %makeinstall.
How to read this is that the -Wl, just says, pass the next argument to ld, so
<blockquote><code>-Wl,-rpath -Wl,%{_libdir}/qt4-vlc<br />
</code></blockquote>
is sent to the linker as
<blockquote><code>-rpath %{_libdir}/qt4-vlc<br />
</code></blockquote>
Once I figured that out, it was all good. But it seems a bit silly to have two of the -Wl, clauses, since you can just put in another comma.  In the end I just used this:
<blockquote><code>-Wl,-rpath,%{_libdir}/qt4-vlc<br />
</code></blockquote>
It&#8217;s not only more compact, it&#8217;s easier to read..]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/hard-coding-a-library-path-into-an-executable-while-building-an-rpm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>building rpms, spec files, rpmbuild, simple tutorial on making rpms by example</title>
		<link>http://ramblings.narrabilis.com/wp/building-rpms/</link>
		<comments>http://ramblings.narrabilis.com/wp/building-rpms/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 15:04:56 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=234</guid>
		<description><![CDATA[I posted some additional material on building rpms in the appendix of the book.  I cover how to build an example spec file from scratch.  This is similar to what I did in my presentation, just with a lot more detail.  I hope to expand this section to cover nested packages and [...]]]></description>
			<content:encoded><![CDATA[I posted some additional material on building rpms in the appendix of the <a href="http://narrabilis.com/mybook/appendices/packages">book</a>.  I cover how to build an example spec file from scratch.  This is similar to what I did in my presentation, just with a lot more detail.  I hope to expand this section to cover nested packages and kernel modules.  Those sections are not done yet&#8230;read it <a href="http://narrabilis.com/mybook/appendices/packages">here</a>.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/building-rpms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
