<?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>nathanpowell.org &#187; sysadmin</title>
	<atom:link href="http://nathanpowell.org/blog/archives/category/sysadmin/feed" rel="self" type="application/rss+xml" />
	<link>http://nathanpowell.org/blog</link>
	<description>Bad running advice, boring family stuff, and technology few find interesting</description>
	<lastBuildDate>Thu, 26 Jan 2012 01:25:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting into a box when virt-manager is sucking</title>
		<link>http://nathanpowell.org/blog/archives/763</link>
		<comments>http://nathanpowell.org/blog/archives/763#comments</comments>
		<pubDate>Thu, 07 May 2009 20:25:06 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/763</guid>
		<description><![CDATA[Sometimes virt-manager (over a less than optimal link) will be unusable. Never fear, it&#8217;s simply creating an ssh tunnel, and then connecting you to vnc. No reason to let it have all the fun. First find out what port the &#8230; <a href="http://nathanpowell.org/blog/archives/763">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes virt-manager (over a less than optimal link) will be unusable.  Never fear, it&#8217;s simply creating an ssh tunnel, and then connecting you to vnc.  No reason to let it have all the fun.</p>
<p>First find out what port the vnc server you want to talk to is listening on<br />
<code><br />
  root@vm.foo.com:~# virsh dumpxml dns | grep graph<br />
    Connecting to uri: qemu:///system<br />
    <graphics type='vnc' port='5904' listen='127.0.0.1'/><br />
</code></p>
<p>There we see it&#8217;s port 5904, now tunnel that port over ssh<br />
<code><br />
  ssh -L 5904:localhost:5904 root@vm.foo.com<br />
</code><br />
Then open the vnc session in a viewer<br />
<code><br />
  npowell@malaise:~$ vncviewer localhost::5904<br />
</code></p>
<p>Cibatta bing.  You in!</p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/763/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenDS</title>
		<link>http://nathanpowell.org/blog/archives/756</link>
		<comments>http://nathanpowell.org/blog/archives/756#comments</comments>
		<pubDate>Tue, 17 Feb 2009 01:22:35 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/756</guid>
		<description><![CDATA[Lately I have taken a small personal interest in LDAP, and OpenDS in particular. The Directory concept is startlingly easy to grasp, while the finer points of actually working with a directory are a little harder. I decided it might &#8230; <a href="http://nathanpowell.org/blog/archives/756">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lately I have taken a small personal interest in <a href="http://en.wikipedia.org/wiki/Ldap">LDAP</a>, and OpenDS in particular.</p>
<p>The Directory concept is startlingly easy to grasp, while the finer points of actually working with a directory are a little harder.  I decided it might be cool to toss together a little rails app to work with LDAP.  First though, I have been getting a little more familiar with the command line tools.</p>
<p>If you install OpenDS as a regular user in Linux, it makes the default port 1389, instead of the typical 389.</p>
<p>To change that, use dsconfig to change the port.<br />
<code><br />
  dsconfig -h directory.urcompany.com -D cn=Directory\ Manager -w password -X -n \<br />
     set-connection-handler-prop --handler-name "LDAP Connection Handler" --set listen-port:389<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/756/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vim Tip I always forget</title>
		<link>http://nathanpowell.org/blog/archives/737</link>
		<comments>http://nathanpowell.org/blog/archives/737#comments</comments>
		<pubDate>Tue, 28 Oct 2008 15:44:40 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/737</guid>
		<description><![CDATA[To get rid of all the crazy ^M&#8217;s that appear in files from windows boxes. In vim: :%s/C-vC-m//g (That&#8217;s Control-v, Control-m).]]></description>
			<content:encoded><![CDATA[<p>To get rid of all the crazy ^M&#8217;s that appear in files from windows boxes.  In vim:</p>
<p><code><br />
:%s/C-vC-m//g<br />
</code></p>
<p>(That&#8217;s Control-v, Control-m).</p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/737/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Ubuntu is coming.</title>
		<link>http://nathanpowell.org/blog/archives/731</link>
		<comments>http://nathanpowell.org/blog/archives/731#comments</comments>
		<pubDate>Tue, 07 Oct 2008 12:59:38 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/731</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://www.ubuntu.com/files/countdown/display.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/731/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Highlight specific messages in Mutt</title>
		<link>http://nathanpowell.org/blog/archives/720</link>
		<comments>http://nathanpowell.org/blog/archives/720#comments</comments>
		<pubDate>Thu, 21 Aug 2008 13:19:57 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/720</guid>
		<description><![CDATA[Let&#8217;s say you belong to some high volume lists and generally get a load of email everyday. You need a way to highlight important message. Using PATTERNS in your muttrc is an easy way to make that happen. This pattern &#8230; <a href="http://nathanpowell.org/blog/archives/720">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you belong to some high volume lists and generally get a load of email everyday.</p>
<p>You need a way to highlight important message.  Using PATTERNS in your muttrc is an easy way to make that happen.</p>
<p>This pattern says if the message is (~f) from her@herdomain.com, AND it&#8217;s (~N) new, make it appear brightcyan in color in your index.<br />
<code><br />
  color index brightcyan black '~f her@herdomain.com ~N'<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/720/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Secure Move</title>
		<link>http://nathanpowell.org/blog/archives/695</link>
		<comments>http://nathanpowell.org/blog/archives/695#comments</comments>
		<pubDate>Fri, 27 Jun 2008 13:02:03 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/695</guid>
		<description><![CDATA[function smv(){ scp $1 $2 &#038;&#038; rm $1; }]]></description>
			<content:encoded><![CDATA[<p><code><br />
function smv(){<br />
  scp $1 $2 &#038;&#038; rm $1;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/695/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Bind on Ubuntu</title>
		<link>http://nathanpowell.org/blog/archives/655</link>
		<comments>http://nathanpowell.org/blog/archives/655#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:31:41 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/655</guid>
		<description><![CDATA[Oddly, when restarting Bind 9 on Ubuntu I noticed it would tell me it restarted OK, but in fact wouldn&#8217;t be running. npowell@chihiro:~$ sudo /etc/init.d/bind9 restart * Stopping domain name service... [ ok ] * Starting domain name service... [ &#8230; <a href="http://nathanpowell.org/blog/archives/655">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Oddly, when restarting Bind 9 on Ubuntu I noticed it would tell me it restarted OK, but in fact wouldn&#8217;t be running.<br />
<code><br />
npowell@chihiro:~$ sudo /etc/init.d/bind9 restart<br />
* Stopping domain name service...                              [ ok ]<br />
* Starting domain name service...                              [ ok ]<br />
npowell@chihiro:~$ ps aux | grep bind<br />
npowell  23418  0.0  0.0   2880   800 pts/1    S+   09:16   0:00 grep bind<br />
</code></p>
<p>Also, Ubuntu&#8217;s penchant for breaking up absolutely ALL the logs is a little annoying (maybe they got this from Debian, I dunno).  Nonetheless, if you look in the daemon.log, you will see the error<br />
<code><br />
root@chihiro:/var/log# tail -n 9 /var/log/daemon.log<br />
Apr 28 09:16:06 chihiro named[23411]: starting BIND 9.3.2 -u bind<br />
Apr 28 09:16:06 chihiro named[23411]: found 2 CPUs, using 2 worker threads<br />
Apr 28 09:16:06 chihiro named[23411]: loading configuration from '/etc/bind/named.conf'<br />
Apr 28 09:16:06 chihiro named[23411]: listening on IPv4 interface lo, 127.0.0.1#53<br />
Apr 28 09:16:06 chihiro named[23411]: listening on IPv4 interface eth1, 192.168.0.1#53<br />
Apr 28 09:16:06 chihiro named[23411]: listening on IPv4 interface eth2, 192.168.1.1#53<br />
Apr 28 09:16:06 chihiro named[23411]: /etc/bind/named.conf.local:14: undefined ACL 'wtf'<br />
Apr 28 09:16:06 chihiro named[23411]: loading configuration: not found<br />
Apr 28 09:16:06 chihiro named[23411]: exiting (due to fatal error)<br />
</code></p>
<p>I made up that error, but you get the idea.  Why it returns &#8216;OK&#8217; when it didn&#8217;t start, I do not know. </p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/655/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing php5-ming on Dapper</title>
		<link>http://nathanpowell.org/blog/archives/356</link>
		<comments>http://nathanpowell.org/blog/archives/356#comments</comments>
		<pubDate>Mon, 25 Jun 2007 17:23:48 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/356</guid>
		<description><![CDATA[I ran into a package today that I couldn&#8217;t find in the repos for Dapper. So I had to figure out a way to get it on there. Luckily I ran into mah online, and I asked him for some &#8230; <a href="http://nathanpowell.org/blog/archives/356">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I ran into a package today that I couldn&#8217;t find in the repos for Dapper.  So I had to figure out a way to get it on there.</p>
<p>Luckily I ran into <a href="http://mah.everybody.org">mah</a> online, and I asked him for some dpkg-fu.  He was kind enough to give me a hand getting this working.  Here is what we did.</p>
<p>First, I added a Feisty repo to my sources.list so I could grab the source files and patch them for Debian.<br />
<code><br />
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ feisty main universe" >> /etc/apt/sources.list<br />
</code><br />
Next we had to increase the cache size for apt so it wouldn&#8217;t choke on the new repo<br />
<code><br />
echo "APT::Cache-Limit \"33554432\";" >> /etc/apt/apt.conf<br />
</code><br />
Then, you can update and install the source files<br />
<code><br />
sudo apt-get update<br />
apt-get source php5-ming<br />
</code><br />
This should, among other things create a directory called ming-0.3.0.  Next, see what deps are missing. Install them.<br />
<code><br />
cd ming-0.3.0/<br />
debuild -uc -us -b<br />
</code><br />
This will tell you all the packages you need.  The only one you won&#8217;t be able to install is python-central&#8230;who cares <a href="http://thinkhole.org/wp/">python</a> sucks anyway. Let&#8217;s get rid of the need for it.<br />
<code><br />
vi debian/rules<br />
</code><br />
Change lines 25 and 26 to<br />
<code><br />
#PYDEF=$(shell pyversions -d)<br />
#PYVERS=$(shell pyversions -r)<br />
</code><br />
And lines 181 and 182 to<br />
<code><br />
  #dh_pycentral<br />
  #dh_python<br />
</code><br />
Now we are ready to build&#8230;but we&#8217;ll have to force it.<br />
<code><br />
debuild -uc -us -b -d<br />
</code><br />
In the parent directory (after that finishes) there will be a bunch of deb&#8217;s.  Just install the lib-ming, and the php5-ming deb&#8217;s.<br />
<code><br />
sudo dpkg -i php5-ming_0.3.0-11ubuntu1_i386.deb libming0_0.3.0-11ubuntu1_i386.deb<br />
</code><br />
One last thing, you have to enable the use of ming in the php.ini file<br />
<code><br />
echo "extension=ming.so" >> /etc/php5/apache2/php.ini<br />
</code><br />
Then restart Apache.</p>
<p>That&#8217;s it.  You can also now take those deb&#8217;s and use them on any Dapper machine&#8230;though, as mah pointed out&#8230;I wouldn&#8217;t use the Python ones if I were you :)</p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/356/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cacti/Ubuntu/PAM</title>
		<link>http://nathanpowell.org/blog/archives/344</link>
		<comments>http://nathanpowell.org/blog/archives/344#comments</comments>
		<pubDate>Thu, 14 Jun 2007 12:51:17 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/344</guid>
		<description><![CDATA[**EDIT, don&#8217;t use this :) I am pretty sure it&#8217;s not working properly, see previous edit, I am running out of time today to fix it. If I don&#8217;t get it right soon, I am going to take this down &#8230; <a href="http://nathanpowell.org/blog/archives/344">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>**EDIT, don&#8217;t use this :)  I am pretty sure it&#8217;s not working properly, see previous edit, I am running out of time today to fix it.  If I don&#8217;t get it right soon, I am going to take this down till I do get it working right**<br />
**EDIT: I am not convinced the auth takes place before the rewrite to SSL, I am looking at that now **</p>
<p>So&#8230;you want to use PAM to do authentication for Cacti over SSL?  Sweet, here is how. (These directions are for Ubuntu, but could probably be extrapolated to other distros).</p>
<p>First, install <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=ubuntu+ssl&#038;btnG=Search">mod_ssl</a> (This is something separate that I am not going over here, it&#8217;s pretty straight forward).</p>
<p>Now, install mod_auth_pam<br />
<code><br />
  apt-get install libapache2-mod-auth-pam<br />
</code><br />
And add the apache user to the shadow group<br />
<code><br />
  usermod -G shadow www-data<br />
</code></p>
<p>At this point, www-data can talk to PAM for authentication.</p>
<p>Now we need to force SSL so that our communication with the server is encrypted:<br />
<code><br />
  vi /etc/apache2/sites-available/default<br />
</code><br />
Adding this to the file (in the < virtualhost *:80> section):<br />
<code><br />
    RewriteEngine on<br />
    RewriteCond %{REQUEST_URI} ^\/cacti\/.*<br />
    RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R=301]<br />
</code><br />
Now, reload Apache<br />
<code><br />
  /etc/init.d/apache2 reload<br />
</code><br />
There, now visit http://yoursite.com/cacti.  It should reroute you to https, and the login page of Cacti. Login, and go to settings (in the lower left hand corner).  Then click the &#8216;authentication&#8217; tab.  The first config param should be a checkbox with &#8216; Use Cacti&#8217;s Builtin Authentication&#8217; checked.  Uncheck that.  Now, anyone can get into your Cacti install!  Wooo!  Actually, let&#8217;s fix that.</p>
<p>Open the apache conf file for cacti:<br />
<code><br />
  vi /etc/apache2/conf.d/cacti.conf<br />
</code><br />
And add these lines (after the Alias directive):</p>
<pre>
<location />
    AuthType Basic
    AuthName "Cacti"
    Require valid-user
< /location>
</pre>
<p>Reload apache, and go back to the url.  It should prompt you for your username/password (this will be your system username/password).</p>
<p>That is all.</p>
<p>(note, in < /location> and < virtualhost> there is a space after the < symbol&#8230;wordpress keeps doing weird things.  Take that space out)</p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/344/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zenoss over ssl</title>
		<link>http://nathanpowell.org/blog/archives/284</link>
		<comments>http://nathanpowell.org/blog/archives/284#comments</comments>
		<pubDate>Wed, 18 Apr 2007 14:09:52 +0000</pubDate>
		<dc:creator>Nathan Powell</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://nathanpowell.org/blog/archives/284</guid>
		<description><![CDATA[Since Zenoss runs inside of Zope, you have to do a couple of things to get it to run over ssl. There are zope plugins, and perhaps there is another way that Zenoss would recommend, but I have never been &#8230; <a href="http://nathanpowell.org/blog/archives/284">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://zenoss.com">Zenoss</a> runs inside of Zope, you have to do a couple of things to get it to run over ssl.  There are zope plugins, and perhaps there is another way that Zenoss would recommend, but I have never been one for reading when I can stomp full speed ahead :)</p>
<p>I just created a vhost and used modproxy to proxy all the connections to https:</p>
<p><code><br />
<virtualhost *:443><br />
  ServerAdmin bignate@yourwindowsbox.com<br />
  ServerName zen.domain.com</p>
<p>  SSLEngine On<br />
  SSLCertificateFile /etc/apache2/ssl/apache.pem<br />
  <directory /><br />
    Options ExecCGI Indexes FollowSymLinks<br />
    AllowOverride All</p>
<p>  ErrorLog /var/log/apache2/error.log<br />
  LogLevel warn</p>
<p>  CustomLog /var/log/apache2/access.log combined<br />
  ServerSignature On</p>
<p>  ProxyPass / http://127.0.0.1:8080/<br />
  ProxyPassReverse / http://127.0.0.1:8080/<br />
</virtualhost></p>
<p></code></p>
<p>Update: the plugin I use to format code is messing that up</p>
]]></content:encoded>
			<wfw:commentRss>http://nathanpowell.org/blog/archives/284/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

