<?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>The Prodigal Boyfriend &#187; General</title>
	<atom:link href="http://blog.theprodigalboyfriend.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theprodigalboyfriend.com</link>
	<description>Why are you even reading this?</description>
	<lastBuildDate>Sat, 01 May 2010 00:37:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Just to say&#8230;</title>
		<link>http://blog.theprodigalboyfriend.com/2010/04/30/just-to-say/</link>
		<comments>http://blog.theprodigalboyfriend.com/2010/04/30/just-to-say/#comments</comments>
		<pubDate>Sat, 01 May 2010 00:37:46 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=358</guid>
		<description><![CDATA[http://imgur.com/SfSSk.jpg]]></description>
			<content:encoded><![CDATA[<p><a href="http://imgur.com/SfSSk.jpg" title="Hosted by imgur.com">http://imgur.com/SfSSk.jpg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2010/04/30/just-to-say/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL4 -&gt; RHEL5 upgrade script</title>
		<link>http://blog.theprodigalboyfriend.com/2010/03/05/rhel4-rhel5-upgrade-script/</link>
		<comments>http://blog.theprodigalboyfriend.com/2010/03/05/rhel4-rhel5-upgrade-script/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 15:55:55 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=355</guid>
		<description><![CDATA[So, this has been done for months, but I haven&#8217;t gotten around to posting it. So, here it is. Upgrade RHEL4 to RHEL5 with an LVM snapshot of the running system and a backout script (you need to have free space in the VG to do this, really &#8212; pure LVM snapshots work, but it&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>So, this has been done for months, but I haven&#8217;t gotten around to posting it.  So, here it is.  Upgrade RHEL4 to RHEL5 with an LVM snapshot of the running system and a backout script (you need to have free space in the VG to do this, really &#8212; pure LVM snapshots work, but it&#8217;ll fill up to 100% when you try to back out and leave it unbootable if your snapshot isn&#8217;t the same size as the regular partitions).  </p>
<p>It assumes HP&#8217;s packages for Proliants are installed, and a tarball of a yum root with the packages you need to install are present.  It rips out any package not on our list of &#8220;needed&#8221; packages (yours may be different).  If you&#8217;re actually using a RHEL CD or a full repo (rather than just pushing what you need to remote sites), change the repo definition accordingly.</p>
<p>Variable names are odd, but those are easy enough to fix if you want something more descriptive of what it does:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/env perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Sys<span style="color: #339933;">::</span><span style="color: #006600;">Hostname</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$host</span> <span style="color: #339933;">=</span> hostname<span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir /var/upgrade&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$output</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;/var/upgrade/upgrade.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cd /boot; tar jcf bootback.tbz *; mv bootback.tbz /root&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir /root/bootsave&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'tail -n 8 /boot/grub/menu.lst |head -n 4| sed -e <span style="color: #000099; font-weight: bold;">\'</span>s/LogVol00/ssLogVol00/<span style="color: #000099; font-weight: bold;">\'</span> | sed -e <span style="color: #000099; font-weight: bold;">\'</span>s/Red.*/Rollback to EL4/<span style="color: #000099; font-weight: bold;">\'</span> &gt; /root/bootsave/menu.lst'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /boot/*2.6* /root/bootsave&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp /etc/fstab /etc/fstab.original&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp /etc/fstab /etc/fstab.rollback&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s/\(LogVol[0-9]*\) /ss\1 /<span style="color: #000099; font-weight: bold;">\'</span> /etc/fstab.rollback'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.save&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s/\(.*[^#]filter.*sdb.*\)/#\1/<span style="color: #000099; font-weight: bold;">\'</span> /etc/lvm/lvm.conf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s:\(&quot;a/.*/&quot;\):\1, &quot;r|/dev/cdrom|&quot;:<span style="color: #000099; font-weight: bold;">\'</span> /etc/lvm/lvm.conf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#I'm not happy about it, but our lastlog is huge, and there's no space for it anywhere in the snapshot. Save off a copy, at least.</span>
<span style="color: #666666; font-style: italic;">#system(&quot;cp /var/log/lastlog /root &amp;&amp; gzip /root/lastlog &amp;&amp; cat /dev/null &gt; /var/log/lastlog&quot;);</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cat /dev/null &gt; /var/log/lastlog&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /var/adm/sw/products/backout.pl /usr/bin/backout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Try to take snapshots.  Die if it fails, since we're not committed yet, and we want to ensure we can</span>
<span style="color: #666666; font-style: italic;">#abort if necessary</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@lvs</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`lvs --noheading --units k| awk '{print <span style="color: #000099; font-weight: bold;">\$</span>1, <span style="color: #000099; font-weight: bold;">\$</span>4}' | grep -v ss`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir /mnt/snap&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lvs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$lv</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lvs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@args</span> <span style="color: #339933;">=</span> <span style="color: #000066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$lv</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">m/^(\d+)/</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$size</span> <span style="color: #339933;">=</span> <span style="color: #000066;">int</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$size</span> <span style="color: #339933;">*</span> <span style="color: #339933;">.</span>3<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">#Create new LVM filesystems to back up to</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span>  <span style="color: #ff0000;">&quot;lvcreate --name ss$args[0] --size $size<span style="color: #000099; font-weight: bold;">\K</span> VolGroup00 &gt;&gt; /var/upgrade/upgrade.log&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error: $? (probably insufficient free extents)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;mkfs.ext3 /dev/VolGroup00/ss$args[0] &gt;&gt; /var/upgrade/upgrade.log&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;mount /dev/VolGroup00/ss$args[0] /mnt/snap&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't mount snapshot!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mount</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`grep $args[0] /etc/fstab | awk '{print <span style="color: #000099; font-weight: bold;">\$</span>2}'`</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;cd $mount; find . -xdev | cpio -pvdaum /mnt/snap &gt;&gt; /var/upgrade/upgrade.log&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error in cpio: $? (probably not enough free space)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;umount /mnt/snap&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Save off fstab</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mount /dev/VolGroup00/ssLogVol00 /mnt/snap&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't mount snapshot!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp /etc/fstab.rollback /mnt/snap/etc/fstab&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;umount /mnt/snap&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Remove packages before the upgrade from a known-good list</span>
<span style="color: #666666; font-style: italic;">#Anything that differs, kill it</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;/var/adm/sw/products/stillinstalled.fs&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@good</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&lt;</span><span style="color: #0000ff;">$file</span><span style="color: #339933;">&gt;;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@good</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@current</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa --queryformat &quot;%{NAME}.%{ARCH}<span style="color: #000099; font-weight: bold;">\n</span>&quot; | grep -v none | grep -v svt`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@current</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%known</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@good</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%present</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@current</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@killrpms</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rpm</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%present</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$known</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$rpm</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@killrpms</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rpm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rpmkillcmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;rpm -e --nodeps --allmatches &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@killrpms</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$rpmkillcmd<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rpmkillcmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Extract the upgrade files</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir -p /tmp/upgrade&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;tar -xzvf /var/adm/sw/products/rhel53upgrade.tgz -C /tmp/upgrade&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@rpms</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa --queryformat &quot;<span style="color: #000099; font-weight: bold;">\%</span><span style="color: #000099; font-weight: bold;">\{</span>NAME<span style="color: #000099; font-weight: bold;">\}</span>.<span style="color: #000099; font-weight: bold;">\%</span><span style="color: #000099; font-weight: bold;">\{</span>ARCH<span style="color: #000099; font-weight: bold;">\}</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@rpms</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@specific</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa --queryformat &quot;%{NAME}-%{VERSION}.%{ARCH}<span style="color: #000099; font-weight: bold;">\n</span>&quot;| egrep &quot;elfutils|elfutils-libelf|pwlib|rpm-libs&quot;`</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@specific</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$specdel</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@specific</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@nuke</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa --queryformat &quot;%{NAME}-%{VERSION}.%{ARCH}<span style="color: #000099; font-weight: bold;">\n</span>&quot; | egrep &quot;libselinux|util-linux|e2fsprogs&quot;`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@nuke</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@cracklib</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa --queryformat &quot;%{NAME}-%{VERSION}.%{ARCH}<span style="color: #000099; font-weight: bold;">\n</span>&quot; | egrep &quot;cracklib.*i386&quot;`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@cracklib</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@nukers</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@nuke</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@cracklib</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@findkernels</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`rpm -qa |grep kernel`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@findkernels</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@deleters</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@oldkernels</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%del</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#123;</span>VFlib2 caching<span style="color: #339933;">-</span>nameserver autofs kudzu pcmcia<span style="color: #339933;">-</span>cs xorg<span style="color: #339933;">-</span>x11 newt<span style="color: #339933;">-</span>perl hal crypto<span style="color: #339933;">-</span>utils gdm openjade docbook<span style="color: #339933;">-</span>dtds scrollkeeper pilot<span style="color: #339933;">-</span><span style="color: #000066;">link</span> octave kdemultimedia kdebase xorg<span style="color: #339933;">-</span>x11<span style="color: #339933;">-</span>xdm system<span style="color: #339933;">-</span>config<span style="color: #339933;">-</span>printer system<span style="color: #339933;">-</span>config<span style="color: #339933;">-</span>printer<span style="color: #339933;">-</span>gui hal<span style="color: #339933;">-</span>cups<span style="color: #339933;">-</span>utils linuxwacom OPC OPCCOMM dce redhat<span style="color: #339933;">-</span>logos redhat<span style="color: #339933;">-</span>menus redhat<span style="color: #339933;">-</span>artwork system<span style="color: #339933;">-</span>config<span style="color: #339933;">-</span>securitylevel system<span style="color: #339933;">-</span>config<span style="color: #339933;">-</span>securitylevel<span style="color: #339933;">-</span>tui HPOvEaAgt HPOvLcja HPOvPCO HPOvBbc HPOvPacc HPOvLczC HPOvEaAes HPOvEaAja HPOvSecCo HPOvAgtEx HPOvLcko HPOvCtrl HPOvEaAzC HPOvSecCC HPOvXercesA HPOvLces HPOvDepl HPOvXpl HPOvPerlA HPOvXalanA HPOvEaAko HPOvConf<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%postdel</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#123;</span>lha bluez<span style="color: #339933;">-</span>bluefw desktop<span style="color: #339933;">-</span>backgrounds<span style="color: #339933;">-</span>extra gtk<span style="color: #339933;">-</span>engines ttfprint gsl lam<span style="color: #339933;">-</span>libs ash krbafs tclx fribidi Omni<span style="color: #339933;">-</span>foomatic Omni mysqlclient10 FreeWnn<span style="color: #339933;">-</span>libs w3c<span style="color: #339933;">-</span>libwww<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@postdeleters</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rpm</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@rpms</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$shortname</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rpm</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">m/(.*)\..*/</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$del</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$shortname</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@deleters</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rpm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$postdel</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$shortname</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@postdeleters</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rpm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$kernel</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@findkernels</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@oldkernels</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$kernel</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$removelist</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@deleters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$removekernels</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@oldkernels</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nukelist</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@nukers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%version</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#123;</span>redhat<span style="color: #339933;">-</span>release<span style="color: #339933;">-</span>notes<span style="color: #339933;">-</span>5Server<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm redhat<span style="color: #339933;">-</span>release<span style="color: #339933;">-</span>5Server<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%prepinstall</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>rpm<span style="color: #339933;">-</span>libs<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm rpm<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm yum<span style="color: #339933;">.</span>noarch<span style="color: #339933;">.</span>rpm rpm<span style="color: #339933;">-</span>python<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm popt<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm glibc<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm glibc<span style="color: #339933;">-</span>common<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm beecrypt<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm glibc<span style="color: #339933;">-</span>headers<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm glibc<span style="color: #339933;">-</span>devel<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm binutils<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm elfutils<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm elfutils<span style="color: #339933;">-</span>libelf<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm elfutils<span style="color: #339933;">-</span>libs<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm beecrypt<span style="color: #339933;">-</span>python<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">-</span>devel<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">-</span>elementtree<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">-</span>sqlite<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm sqlite<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm sqlite<span style="color: #339933;">-</span>devel<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">-</span>urlgrabber<span style="color: #339933;">.</span>noarch<span style="color: #339933;">.</span>rpm neon<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm libxml2<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm libxml2<span style="color: #339933;">-</span>python<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm db4<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm libselinux<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm libsepol<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm mcstrans<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm m2crypto<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm krb5<span style="color: #339933;">-</span>libs<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm openssl<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm <span style="color: #000066;">readline</span><span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm python<span style="color: #339933;">-</span>iniparse<span style="color: #339933;">.</span>noarch<span style="color: #339933;">.</span>rpm yum<span style="color: #339933;">-</span>metadata<span style="color: #339933;">-</span>parser<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm nss<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm glib2<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm e2fsprogs<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm e2fsprogs<span style="color: #339933;">-</span>libs<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm nspr<span style="color: #339933;">.</span>x86_64<span style="color: #339933;">.</span>rpm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@instlist</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$packdir</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/tmp/upgrade/base/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">opendir</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dir</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$packdir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%cdromfiles</span> <span style="color: #339933;">=</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #000066;">readdir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@versions</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@installers</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$kernel</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$entry</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%cdromfiles</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$packname</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$packarch</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$entry</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">m/(.*?)-\d[^S].*(\..*?\.rpm)/</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$package</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$packname</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$packarch</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$version</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$package</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$entry</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$packdir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$entry</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">push</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@versions</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$entry</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$prepinstall</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$package</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$entry</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$packdir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$entry</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">push</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@installers</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$entry</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$entry</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/kernel-\d.*/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$kernel</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$packdir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$entry</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$installlist</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@installers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$versionlist</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@versions</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -Uvh $versionlist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -Uvh $versionlist&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm --import /tmp/upgrade/base/RPM-GPG-KEY-redhat-release<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm --import /tmp/upgrade/base/RPM-GPG-KEY-redhat-release&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -Uvh --nodeps --replacefiles $installlist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -Uvh --nodeps --replacefiles $installlist&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rm -f /var/lib/rpm/__* &amp;&amp; rpm --rebuilddb<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rm -f /var/lib/rpm/__* &amp;&amp; rpm --rebuilddb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$removelist</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -e --allmatches --nodeps $removelist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e --allmatches --nodeps $removelist&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$specdel</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -e --allmatches $specdel<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e --allmatches $specdel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$yumconf</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt; /etc/yum.repos.d/iso.repo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$yumconf</span> <span style="color: #ff0000;">&quot;[rh53]<span style="color: #000099; font-weight: bold;">\n</span>baseurl=file:///tmp/upgrade/base<span style="color: #000099; font-weight: bold;">\n</span>enabled=1<span style="color: #000099; font-weight: bold;">\n</span>gpgcheck=0&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$yumconf</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;yum clean all&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -ivh --nodeps $kernel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -e --nodeps $removekernels<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e --nodeps $removekernels&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -ivh --nodeps --replacefiles /var/adm/sw/products/openssl097a-0.9.7a-9.el5_2.1.i386.rpm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$nukelist</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;rpm -e --nodeps $nukelist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e --nodeps $nukelist&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e hpasm hprsm hponcfg; yum -y --exclude=expect upgrade &amp;&amp; rpm -e --nodeps e2fsprogs.i386; yum -y install kernel-devel bind bind-chroot compat-openldap openmotif22 e2fsprogs-libs nss.i386 swig numactl enscript guile rpm-libs.i386 libtool-ltdl nspr wdaemon sqlite.i386 libgcj.i386 elfutils-libelf.i386&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$postdeletelist</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@postdeleters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$postdeletelist</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e --allmatches $postdeletelist&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
rpmrun<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir -p /usr/bin/X11 &amp;&amp; ln -s /usr/bin/mwm /usr/bin/X11/mwm &amp;&amp; ln -s /usr/bin/xauth /usr/bin/X11/xauth &amp;&amp; ln -s /usr/bin/xmodmap /usr/bin/X11/xmodmap &amp;&amp; ln -s /usr/bin/xset /usr/bin/X11/xset &amp;&amp; ln -s /usr/bin/xsetroot /usr/bin/X11/xsetroot &amp;&amp; ln -s /usr/bin/xterm /usr/bin/X11/xterm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /var/adm/sw/products/postinstall.pl /usr/bin/postinstall&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;chmod 777 /tmp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;echo 'nohup /usr/bin/postinstall &amp;' &gt;&gt; /etc/rc.local&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;grub-install /dev/your/root&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
finished<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;success&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> finished <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$status</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /root/bootsave/*2.6* /boot&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s/2.6.*ELsmp/2.6.18-128.el5/g<span style="color: #000099; font-weight: bold;">\'</span> /boot/grub/menu.lst'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s/Red Hat.*up/RHEL5/g<span style="color: #000099; font-weight: bold;">\'</span> /boot/grub/menu.lst'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'sed -i -e <span style="color: #000099; font-weight: bold;">\'</span>s/2.6.*EL/2.6.18-128.el5/g<span style="color: #000099; font-weight: bold;">\'</span> /boot/grub/menu.lst'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cat /root/bootsave/menu.lst &gt;&gt; /boot/grub/menu.lst&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$status</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/failed/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$msg</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Upgrade failed!  Please boot into the snapshot and run /usr/bin/backout.&quot;</span><span style="color: #339933;">;</span>
                notify<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Upgrade on $host failed!  Please boot into the snapshot and run /usr/bin/backout.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$msg</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Upgrade on $host successful.  Rebooting...&quot;</span><span style="color: #339933;">;</span>
                notify<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Upgrade successful.  Rebooting...<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;chmod +x /etc/rc.d/rc.local&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;reboot -t now&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> rpmrun <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$cmd<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">#We're probably past the point of no return here, so I'm not going to die(), but I'll still print</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$cmd &gt;&gt; /var/upgrade/upgrade.log 2&gt;&amp;1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> failed<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> failed <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$message</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed on $message packages<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        finished<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> notify <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$message</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@admins</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'youraddress@whatever.domain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$admin</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@admins</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;echo $message <span style="color: #000099; font-weight: bold;">\|</span> mailx -s '$host upgrade' $admin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>List of packages:</p>
<pre>acl.x86_64
acpid.x86_64
alchemist.i386
alchemist.x86_64
alsa-lib.i386
alsa-lib.x86_64
anacron.x86_64
aspell-en.x86_64
aspell.i386
aspell.x86_64
atk.i386
atk.x86_64
attr.x86_64
at.x86_64
audiofile.i386
audiofile.x86_64
audit-libs.i386
audit-libs.x86_64
audit.x86_64
authconfig.x86_64
basesystem.noarch
bash.x86_64
bc.x86_64
beecrypt.i386
beecrypt.x86_64
bind-libs.i386
bind-libs.x86_64
bind-utils.x86_64
binutils.x86_64
bitmap-fonts.noarch
bitstream-vera-fonts.noarch
bzip2-libs.i386
bzip2-libs.x86_64
bzip2.x86_64
chkconfig.x86_64
chkfontpath.x86_64
compat-dapl-1.2.5.x86_64
compat-db.i386
compat-libgcc-296.i386
compat-libstdc++-296.i386
compat-libstdc++-33.i386
comps-extras.noarch
coreutils.x86_64
cpio.x86_64
cpp.x86_64
cracklib-dicts.x86_64
cracklib.x86_64
crash.x86_64
crontabs.noarch
cups-libs.i386
cups-libs.x86_64
cups.x86_64
curl.i386
cyrus-sasl.i386
cyrus-sasl-md5.i386
cyrus-sasl-md5.x86_64
cyrus-sasl-plain.i386
cyrus-sasl-plain.x86_64
cyrus-sasl.x86_64
db4.i386
db4.x86_64
dbus-glib.i386
dbus-glib.x86_64
dbus.i386
dbus-python.x86_64
dbus.x86_64
desktop-backgrounds-basic.noarch
desktop-backgrounds-extra.noarch
desktop-file-utils.x86_64
device-mapper.i386
device-mapper.x86_64
diffutils.x86_64
dmraid.i386
docbook-dtds.noarch
dos2unix.x86_64
dosfstools.x86_64
e2fsprogs.x86_64
ed.x86_64
eject.x86_64
elfutils-libelf.x86_64
elfutils.x86_64
esound.i386
esound.x86_64
ethtool.x86_64
expat.i386
expat.x86_64
expect.i386
fbset.x86_64
filesystem.x86_64
file.x86_64
findutils.x86_64
finger.x86_64
fontconfig.i386
fontconfig.x86_64
fonts-xorg-base.noarch
foomatic.x86_64
freetype.i386
freetype.x86_64
ftp.x86_64
gail.i386
gail.x86_64
gamin.i386
gamin.x86_64
gawk.x86_64
gcc.x86_64
GConf2.i386
GConf2.x86_64
gdbm.i386
gdbm.x86_64
gd.i386
gd.x86_64
gettext.x86_64
ghostscript-fonts.noarch
ghostscript.i386
ghostscript.x86_64
glib2.i386
glib2.x86_64
glibc-common.x86_64
glibc-devel.x86_64
glibc-headers.x86_64
glibc.i686
glibc-kernheaders.x86_64
glibc.x86_64
glib.i386
glib.x86_64
gmp.i386
gmp.x86_64
gnome-keyring.i386
gnome-keyring.x86_64
gnome-mime-data.x86_64
gnome-python2-bonobo.x86_64
gnome-python2-canvas.x86_64
gnome-python2-gtkhtml2.x86_64
gnome-python2.x86_64
gnome-vfs2.i386
gnome-vfs2.x86_64
gnupg.x86_64
gnutls.i386
gnutls.x86_64
gpm.i386
gpm.x86_64
grep.x86_64
groff.x86_64
grub.x86_64
gtk2.i386
gtk2.x86_64
gtkhtml2.i386
gtkhtml2.x86_64
guile.i386
gzip.x86_64
hal.i386
hal.x86_64
hdparm.x86_64
hesiod.i386
hesiod.x86_64
hotplug.x86_64
htmlview.noarch
hwdata.noarch
info.x86_64
initscripts.x86_64
intltool.x86_64
iproute.x86_64
ipsec-tools.x86_64
iptables.x86_64
iptstate.x86_64
iputils.x86_64
jpackage-utils.noarch
jwhois.x86_64
kbd.x86_64
kernel-devel.x86_64
kernel-ib.x86_64
kernel-smp-devel.x86_64
kernel-smp.x86_64
kernel-utils.x86_64
kernel.x86_64
keyutils-libs.x86_64
keyutils.x86_64
krb5-auth-dialog.x86_64
krb5-libs.i386
krb5-libs.x86_64
krb5-workstation.x86_64
krbafs.i386
kudzu.x86_64
less.x86_64
lftp.x86_64
lha.x86_64
libacl.i386
libacl.x86_64
libart_lgpl.i386
libart_lgpl.x86_64
libattr.i386
libattr.x86_64
libbonobo.i386
libbonoboui.x86_64
libbonobo.x86_64
libcap.i386
libcap.x86_64
libcroco.i386
libcroco.x86_64
libf2c.i386
libgcc.i386
libgcc.x86_64
libgcrypt.i386
libgcrypt.x86_64
libgfortran.i386
libglade2.i386
libglade2.x86_64
libgnomecanvas.i386
libgnomecanvas.x86_64
libgnomecups.i386
libgnomecups.x86_64
libgnome.i386
libgnomeprint22.i386
libgnomeprint22.x86_64
libgnomeprintui22.i386
libgnomeprintui22.x86_64
libgnomeui.x86_64
libgnome.x86_64
libgpg-error.i386
libgpg-error.x86_64
libgsf.x86_64
libibverbs.i386
libibverbs.x86_64
libIDL.i386
libIDL.x86_64
libidn.i386
libidn.x86_64
libieee1284.i386
libjpeg.i386
libjpeg.x86_64
libmng.i386
libmng.x86_64
libobjc.i386
libogg.i386
libogg.x86_64
libpcap.i386
libpcap.x86_64
libpng10.i386
libpng.i386
libpng.x86_64
libraw1394.i386
libraw1394.x86_64
librdmacm.i386
librdmacm.x86_64
librsvg2.x86_64
libselinux.i386
libselinux.x86_64
libsepol.i386
libsepol.x86_64
libstdc++.i386
libstdc++.x86_64
libtermcap.i386
libtermcap.x86_64
libtiff.i386
libtiff.x86_64
libusb.i386
libusb.x86_64
libuser.i386
libuser.x86_64
libvorbis.i386
libvorbis.x86_64
libxml2.i386
libxml2-python.x86_64
libxml2.x86_64
libxslt.i386
libxslt.x86_64
logrotate.x86_64
logwatch.noarch
lshw.x86_64
lsof.x86_64
lvm2.x86_64
m4.x86_64
mailcap.noarch
mailx.x86_64
MAKEDEV.x86_64
make.x86_64
man-pages.noarch
man.x86_64
mcelog.x86_64
mdadm.x86_64
metacity.x86_64
mgetty.x86_64
mikmod.i386
mingetty.x86_64
mkinitrd.x86_64
mktemp.x86_64
module-init-tools.x86_64
mpage.x86_64
mtools.x86_64
mtr.x86_64
mt-st.x86_64
nano.x86_64
ncurses.i386
ncurses.x86_64
nc.x86_64
netconfig.x86_64
netdump.x86_64
net-snmp-libs.i386
net-snmp-libs.x86_64
net-tools.x86_64
newt.i386
newt.x86_64
nss_db.i386
nss_db.x86_64
ntp.x86_64
ntsysv.x86_64
numactl.x86_64
Omni-foomatic.x86_64
Omni.i386
Omni.x86_64
OpenIPMI-libs.x86_64
OpenIPMI.x86_64
openldap.i386
openldap.x86_64
openmotif21.i386
openmotif.i386
openssh-askpass-gnome.x86_64
openssh-askpass.x86_64
openssh-clients.x86_64
openssh-server.x86_64
openssh.x86_64
openssl096b.i386
openssl.i686
openssl.x86_64
ORBit2.i386
ORBit2.x86_64
pam_ccreds.i386
pam_ccreds.x86_64
pam.i386
pam_krb5.i386
pam_krb5.x86_64
pam_passwdqc.i386
pam_passwdqc.x86_64
pam_smb.i386
pam_smb.x86_64
pam.x86_64
pango.i386
pango.x86_64
parted.x86_64
passwd.x86_64
patch.x86_64
pax.x86_64
pciutils.x86_64
pcre.i386
pcre.x86_64
pdksh.x86_64
perl-DateManip.noarch
perl-DBI.x86_64
perl-Filter.x86_64
perl-HTML-Parser.x86_64
perl-HTML-Tagset.noarch
perl-libwww-perl.noarch
perl-libxml-enno.noarch
perl-libxml-perl.noarch
perl-Parse-Yapp.noarch
perl-URI.noarch
perl.x86_64
perl-XML-Dumper.noarch
perl-XML-Encoding.noarch
perl-XML-Parser.x86_64
pinfo.x86_64
pnm2ppa.x86_64
popt.i386
popt.x86_64
ppp.x86_64
procmail.x86_64
procps.x86_64
psacct.x86_64
psmisc.x86_64
psutils.x86_64
pygtk2-libglade.x86_64
pygtk2.x86_64
pyOpenSSL.x86_64
pyorbit.x86_64
python.x86_64
pyxf86config.x86_64
PyXML.x86_64
qt.i386
qt.x86_64
quota.x86_64
rdate.x86_64
rdist.x86_64
readline.i386
readline.x86_64
redhat-logos.noarch
redhat-lsb.i386
redhat-lsb.x86_64
redhat-menus.noarch
redhat-release.x86_64
rhgb.x86_64
rhnlib.noarch
rhpl.x86_64
rootfiles.noarch
rpm-libs.i386
rpm-libs.x86_64
rpm-python.x86_64
rpm.x86_64
rp-pppoe.x86_64
rsync.x86_64
scrollkeeper.i386
scrollkeeper.x86_64
SDL.i386
sed.x86_64
sendmail.x86_64
setarch.x86_64
setserial.x86_64
setup.noarch
setuptool.x86_64
sgml-common.noarch
shadow-utils.x86_64
shared-mime-info.x86_64
sharutils.x86_64
slang.i386
slang.x86_64
specspo.noarch
speex.i386
speex.x86_64
startup-notification.i386
startup-notification.x86_64
statserial.x86_64
stunnel.x86_64
sudo.x86_64
switchdesk.noarch
symlinks.x86_64
sysfsutils.x86_64
sysklogd.x86_64
sysstat.x86_64
system-config-date.noarch
system-config-display.noarch
system-config-keyboard.noarch
system-config-language.noarch
system-config-lvm.noarch
system-config-mouse.noarch
system-config-rootpassword.noarch
system-config-securitylevel-tui.x86_64
system-config-securitylevel.x86_64
system-config-services.noarch
system-config-users.noarch
system-logviewer.noarch
SysVinit.x86_64
talk.x86_64
tar.x86_64
tcl.i386
tcl.x86_64
tclx.i386
tcpdump.x86_64
tcp_wrappers.i386
tcp_wrappers.x86_64
tcsh.x86_64
telnet.x86_64
termcap.noarch
time.x86_64
tk.i386
tk.x86_64
tmpwatch.x86_64
traceroute.x86_64
ttmkfdir.x86_64
tzdata.noarch
udev.x86_64
umb-scheme.x86_64
unix2dos.x86_64
unzip.x86_64
urw-fonts.noarch
usbutils.x86_64
usermode-gtk.x86_64
usermode.x86_64
utempter.i386
utempter.x86_64
util-linux.x86_64
vasclnts.x86_64
vasclnts.x86_64
vas.x86_64
vconfig.x86_64
vim-common.x86_64
vim-enhanced.x86_64
vim-minimal.x86_64
vixie-cron.x86_64
vnc-server.x86_64
vte.i386
vte.x86_64
WFBwfssh-maint.x86_64
WFBwfssh.x86_64
wget.x86_64
which.x86_64
words.noarch
Xaw3d.i386
xinetd.x86_64
xinitrc.noarch
xml-common.noarch
xmlsec1.i386
xmlsec1-openssl.i386
xmlsec1-openssl.x86_64
xmlsec1.x86_64
xorg-x11-deprecated-libs.i386
xorg-x11-deprecated-libs.x86_64
xorg-x11-font-utils.x86_64
xorg-x11-libs.i386
xorg-x11-libs.x86_64
xorg-x11-Mesa-libGL.i386
xorg-x11-Mesa-libGLU.i386
xorg-x11-Mesa-libGLU.x86_64
xorg-x11-Mesa-libGL.x86_64
xorg-x11-tools.x86_64
xorg-x11-twm.x86_64
xorg-x11.x86_64
xorg-x11-xauth.x86_64
xorg-x11-xfs.x86_64
xsri.x86_64
xterm.x86_64
zip.x86_64
zlib.i386
zlib.x86_64</pre>
<p>Backout script:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$fstab</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;/etc/fstab.original&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@lines</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&lt;</span><span style="color: #0000ff;">$fstab</span><span style="color: #339933;">&gt;;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fstab</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Check if we're on the live partitions</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$test</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`mount`</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$test</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/-LogVol\d+/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Please ensure you are in the snapshot before running the backout!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%mapping</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/Vol/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@fields</span> <span style="color: #339933;">=</span> <span style="color: #000066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s+/</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #0000ff;">$mapping</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mkdir /mnt/backout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$vol</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%mapping</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$vol -&gt; $mapping{$vol}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;mount $vol /mnt/backout<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mount $vol /mnt/backout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">#Clean it out</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rm -rf /mnt/backout/*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">#Step into whatever directory matches and cpio it to the appropriate filesystem</span>
        <span style="color: #666666; font-style: italic;">#Copy special nodes and don't cross filesystems</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;cd $mapping{$vol}; find . -xdev | cpio -pvdaum /mnt/backout<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cd $mapping{$vol}; find . -xdev | cpio -pvdaum /mnt/backout&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error in cpiO: $? (probably not enough free space)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;umount /mnt/backout<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;umount /mnt/backout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">#restore fstab</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mount /dev/VolGroup00/LogVol00 /mnt/backout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /etc/fstab.original /mnt/backout/etc/fstab&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cp -v /etc/fstab.original /etc/fstab&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#restore /boot</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;tar -xjvf /root/bootback.tbz -C /boot&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$cmd<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$cmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;reboot -t now&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Postinstall script (for anything you need done after the reboot, emails you to let you know it&#8217;s done):</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Sys<span style="color: #339933;">::</span><span style="color: #006600;">Hostname</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$host</span> <span style="color: #339933;">=</span> hostname<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rpm -e hpasm hprsm; yum -y install hponcfg hpacucli hp-health &gt;&gt; /var/log/upgrade.log 2&gt;&amp;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@admins</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'youraddress@whatever.domain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$admin</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@admins</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cat /etc/motd | sed -e 's/~//g' | sed -e '/^<span style="color: #000099; font-weight: bold;">\\</span>s*<span style="color: #000099; font-weight: bold;">\$</span>/d' | mailx -s '$host upgraded' $admin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Take us out of rc.local</span>
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sed -i -e 's/.*postinstall//' /etc/rc.local&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2010/03/05/rhel4-rhel5-upgrade-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now here&#8217;s a power list&#8230;</title>
		<link>http://blog.theprodigalboyfriend.com/2009/07/01/now-heres-a-power-list/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/07/01/now-heres-a-power-list/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 20:12:58 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Warhammer]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=348</guid>
		<description><![CDATA[Dark Elves Roster &#8211; 2250 pts Highborn (1#, 264 Pts) 1 Dreadlord General; Hand Weapon; Sea Dragon Cloak; Shield; Eternal Hatred 1 Cold One Thick-skinned; Causes Fear; Stupid 1 Deathpiercer 1 Armor of Eternal Servitude 1 Ring of Hotek Hag Queen (1#, 205 Pts) 1 Death Hag (Battle Standard Bearer) Khainite; Hand Weapon; Extra Hand [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Dark Elves Roster &#8211; 2250 pts</p>
<p>Highborn (1#, 264 Pts)<br />
1 Dreadlord<br />
General; Hand Weapon; Sea Dragon Cloak; Shield; Eternal Hatred<br />
1 Cold One<br />
Thick-skinned; Causes Fear; Stupid<br />
1 Deathpiercer<br />
1 Armor of Eternal Servitude<br />
1 Ring of Hotek</p>
<p>Hag Queen (1#, 205 Pts)<br />
1 Death Hag (Battle Standard Bearer)<br />
Khainite; Hand Weapon; Extra Hand Weapon; Battle Standard<br />
Bearer; Eternal Hatred; Frenzy; Poisoned Attacks<br />
1 Witchbrew<br />
1 Touch of Death<br />
1 Banner of Hag Graef<br />
Always Strike First</p>
<p>Hag Queen (4#, 200 Pts)<br />
1 Death Hag<br />
Khainite; Hand Weapon; Extra Hand Weapon; Eternal Hatred;<br />
Frenzy; Poisoned Attacks<br />
1 Cauldron of Blood<br />
Altar of Khaine; Attendents; Blessings of Khaine; Khainite;<br />
War Machine; Causes Terror; Eternal Hatred; Frenzy; Magic Resistance<br />
(1); Poisoned Attacks<br />
2 Hags<br />
Khainite; Hand Weapon; Extra Hand Weapon; Eternal Hatred;<br />
Frenzy; Poisoned Attacks</p>
<p>Repeater Crossbowmen (10#, 100 Pts)<br />
10 Dark Elf Repeater Crossbowmen<br />
Hand Weapon; Repeater Crossbow; Light Armour; Eternal Hatred</p>
<p>Repeater Crossbowmen (10#, 100 Pts)<br />
10 Dark Elf Repeater Crossbowmen<br />
Hand Weapon; Repeater Crossbow; Light Armour; Eternal Hatred</p>
<p>Dark Riders (5#, 85 Pts)<br />
5 Dark Riders<br />
Hand Weapon; Spear; Light Armour; Eternal Hatred; Fast Cavalry<br />
5 Dark Steed</p>
<p>Dark Riders (5#, 85 Pts)<br />
5 Dark Riders<br />
Hand Weapon; Spear; Light Armour; Eternal Hatred; Fast Cavalry<br />
5 Dark Steed</p>
<p>Executioners (23#, 455 Pts)<br />
21 Har Ganeth Executioners<br />
Khainite; Musician Mus; Standard Bearer Std; Draich; Heavy<br />
Armour; Eternal Hatred; Killing Blow<br />
1 Assassin<br />
A Killer Not a Leader; Always Strike First; Hidden; Khainite;<br />
Hand Weapon; Extra Hand Weapon; Eternal Hatred; Poisoned Attacks;<br />
Scouts<br />
1 Dark Venom<br />
1 Touch of Death<br />
1 Rune of Khaine<br />
1 Draich-master<br />
Khainite; Draich; Heavy Armour; Eternal Hatred</p>
<p>Executioners (10#, 120 Pts)<br />
10 Har Ganeth Executioners<br />
Khainite; Draich; Heavy Armour; Eternal Hatred; Killing Blow</p>
<p>Executioners (10#, 120 Pts)<br />
10 Har Ganeth Executioners<br />
Khainite; Draich; Heavy Armour; Eternal Hatred; Killing Blow</p>
<p>War Hydra (3#, 175 Pts)<br />
1 War Hydra<br />
Fiery Breath; Monsters and Handlers; Causes Terror; Eternal<br />
Hatred; Large Target; Regenerate; Scaly Skin<br />
2 Beastmaster<br />
Hand Weapon; Eternal Hatred<br />
2 Beastmasters Scourge</p>
<p>War Hydra (3#, 175 Pts)<br />
1 War Hydra<br />
Fiery Breath; Monsters and Handlers; Causes Terror; Eternal<br />
Hatred; Large Target; Regenerate; Scaly Skin<br />
2 Beastmaster<br />
Hand Weapon; Eternal Hatred<br />
2 Beastmasters Scourge</p>
<p>Cold One Knights (5#, 166 Pts)<br />
5 Cold One Knights<br />
Standard Bearer Std; Hand Weapon; Lance; Heavy Armour; Shield;<br />
Eternal Hatred<br />
1 Banner of Cold Blood<br />
5 Cold One<br />
Thick-skinned; Causes Fear; Stupid</p></blockquote>
<p>It&#8217;s unlikely to be the sort of list I&#8217;d use (Witch elf BSB, no; big unit of Executioners probably replaced with Black Guard; turn Dreadlord into Supreme Sorceress; drop assassin for highborn), but holy gods.  Other than core, the whole damn list it Khainite. so all the Executioners would be stubborn.  Fun.</p>
<p><a href="http://www.reddit.com/r/Economics/comments/8vdr3/how_goldman_sachs_pumped_and_dumped_the_us/">Here&#8217;s Matt Taibbi&#8217;s article on GS.</a> and <a href="http://www.reddit.com/r/IAmA/comments/8wxpm/i_am_in_love_with_my_sister_and_she_reciprocates/">more fucked up shit on Reddit.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/07/01/now-heres-a-power-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear internet, please shut up</title>
		<link>http://blog.theprodigalboyfriend.com/2009/06/22/dear-internet-please-shut-up/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/06/22/dear-internet-please-shut-up/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:05:31 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bitching]]></category>
		<category><![CDATA[Bullshit]]></category>
		<category><![CDATA[Crazy]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=343</guid>
		<description><![CDATA[Honestly, the fervor over Iran? Enough. While it&#8217;s certainly an important event, it merely serves to illustrate that the people of Iran have a nominal choice over their president. That is all. There&#8217;s some feeling of solidarity with Iran&#8217;s youth (about 30% of the populace) in the US, but people seem to have deluded themselves [...]]]></description>
			<content:encoded><![CDATA[<p>Honestly, the fervor over Iran?  Enough.  While it&#8217;s certainly an important event, it merely serves to illustrate that the people of Iran have a nominal choice over their president.  That is all.  There&#8217;s some feeling of solidarity with Iran&#8217;s youth (about 30% of the populace) in the US, but people seem to have deluded themselves into thinking it&#8217;s another Iranian Revolution or a harbinger of Western-style democracy.  First, I guess, a little background on Iran&#8217;s government structure:</p>
<ul>
<li><b>Supreme Leader:</b></li>
<p>Controls everything, really, as we&#8217;ll see in a bit.  Personally has the power to declare war and peace, command army/intelligence/police forces.
<li><b>Assembly of Experts:</b></li>
<p>Clerics who determine who the next Supreme Leader will be, though they capitulate to his desires in every recorded instance(see: Montazeri).  Elected to 8 year terms by direct public vote, but the list of candidates is screened anyway, so it&#8217;s not like a &#8220;free election.&#8221;
<li><b>Guardian Council:</b></li>
<p>Easily the most powerful force in Iranian politics.  Twelve members, 6 picked directly by the Supreme Leader, 6 picked by the head of the judiciary (who is also picked by the Supreme Leader).  Confirmed by Parliament, but it&#8217;s mostly for show.  Functions as a combination Supreme Court and presidential veto (except Parliament cannot actually override their veto, it just gets sent back for revision).  Screens candidates for every imaginable branch of government and arbitrarily excludes them (this has been happening for a while to keep reform candidates out &#8212; the 2004, 2006, and 2008 electiosn were particularly bad).  May as well have total control of the Revolutionary Guard (which is not a branch of the normal army).
<li><b>Expendiency Council:</b></li>
<p>Nominally there to function as a screen between the Guardian Council and parliament.  In reality, just advises the Supreme Leader
<li><b>Majlis (parliament)</b>:</li>
<p>Does the things you&#8217;d normally expect parliament to do (approve budgets, treaties, drafts legislation), only neutered by the Guardian Council. As with everything else, candidates are screened.
<li><b>President/VPs/Ministries</b></li>
<p>Executive branch stuff &#8212; day-to-day running of the state.  Nominally right below the Supreme Leader.  In truth, Guardian Council wields more power.  Candidates are elected, but are screened by Guardian Council beforehand, ensuring real reformers never even make it to the vote.  Best described as a figurehead.</ul>
<p>There is very little debate in Iran about the importance of religion.  They&#8217;re not going to turn into a secular nation.  There&#8217;s hardly any protest (even now) against the Supreme Leader, though some resentment against the Guardian Council for the behavior of the Basij.  No matter how the protests go, it&#8217;s unlikely to be another revolution &#8212; very few revolutions succeed without support from another sovereign nation, which they are not getting.  The nature of the screening pretty much ensures that it&#8217;ll be another conservative candidate even if it <em>does</em> succeed, but Ahmadinejad and the Guardian Council control the complete apparatus of the state.  It&#8217;s likely to be brutally repressed (granted, I&#8217;ve seen very little from outside Tehran, which I consider to be an indication that it&#8217;s relatively calm there).</p>
<p>Mousavi&#8217;s campaign?  Move control of the police from Khamenei to the president.  Make government a little more transparent.  Allow non-state run television.  Not exactly Kucinich here, or even Obama.  Maybe Ron Paul is an apt comparison.</p>
<p>Karroubi?  Actual reform!  Freedom of the press, women&#8217;s rights, nationalize the oil industry and distribute the profits to the people, etc.  As you&#8217;ve maybe seen, he was not the winner.</p>
<p>With that out of the way (and the background may have been necessary for those thinking about Iran becoming South Korea or post-imperial Japan), can we stop the damn Twittering?  Changing your timezone to Tehran?  Ahh&#8230; I&#8217;m not sure what you think that&#8217;s accomplishing.  Under the assumption that the Iranian government can track individual people Twittering (and really?  They&#8217;ve got more important things to worry about &#8212; just that people don&#8217;t post updates after going to rallies), it&#8217;s because they control the feeds out of the country.  Your timezone isn&#8217;t fooling them, unless you&#8217;re routing it through Iran, which is doubtful.  Open proxies?  Let&#8217;s say they can track Twitterers &#8212; that means they&#8217;re using Deep Packet Inspection and, well, proxies don&#8217;t exactly help against that.  They get around blackholing IP blocks (Facebook/whatever), and the headers change a little, but the packet contents are still eminently sniffable.  </p>
<p>Tor exit nodes are a better option, but there&#8217;s the possibility the Iranian government is running an exit node themselves as a honeypot (<b>extremely</b> unlikely).  VPNs are much better, and not all that hard to set up, as long as you keep the address of the server relatively private.  For the sake of argument, we&#8217;ll say OpenVPN &#8212; which is SSL based &#8212; running on port 443.  It should be utterly indistinguishable from HTTPS traffic, since the key negotiation is also encrypted, and DPI isn&#8217;t going to help them here.  For all they know, people would be conducting internet banking or one of the million other things SSL is used for.</p>
<p>Of course, doing this requires more effort than changing your Twitter timezone or giving yourself a green background for &#8220;solidarity.&#8221;  Worse than that, the technical issues should have been obvious to a lot of people by now (or at least the contradiction in assuming they can track what IP addresses are using Twitter to individuals, yet thinking that packets which are <em>never</em> routed through Iran will somehow fool them).  The irony of the &#8220;solidarity&#8221; is that our elections in 2000 and 2004 were filled with questionable voter purges, yet we didn&#8217;t rise up.  The candidate they elected (assuming the leaked results are true) is more comparable to Reagan or one of the Bushes than Johnson or Carter &#8212; a man who the people in support of &#8220;#iranelection&#8221; would never, <b>ever</b> vote for, but they don&#8217;t realize that as he&#8217;s a &#8220;reform&#8221; candidate.  We arrested twice as many journalists in the 4 days of the RNC in Saint Paul than Iran has in a week of street riots.  </p>
<p>Until you can drop the hypocrisy, technical incompetence (and don&#8217;t think most of the people <em>wanted</em> to think about that, since they might have to stop patting themselves on the back for &#8220;helping Iranians&#8221; with a fucking website that has the same limitations as SMS), and utter lack of understanding about Iran&#8217;s politics (ahem, even if Mousavi is inducted, not much is likely to change in Iran until the Guardian Council stops culling candidates who want actual change), you can shut the fuck up and keep your self-righteousness to yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/06/22/dear-internet-please-shut-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Resizing / on ext3 remotely</title>
		<link>http://blog.theprodigalboyfriend.com/2009/05/12/resizing-on-ext3-remotely/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/05/12/resizing-on-ext3-remotely/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:08:27 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=334</guid>
		<description><![CDATA[This is a feature request we had at work, and ignoring the RedHat consultant&#8217;s &#8220;If all you have is a hammer&#8230;&#8221; mentality (he suggested Anaconda again, no matter how unsuitable it is for updating 4,000 remote servers), it&#8217;s not actually that difficult of a task. The prime difficult here, of course, is that you cannot [...]]]></description>
			<content:encoded><![CDATA[<p>This is a feature request we had at work, and ignoring the RedHat consultant&#8217;s &#8220;If all you have is a hammer&#8230;&#8221; mentality (he suggested Anaconda <strong>again</strong>, no matter how unsuitable it is for updating 4,000 remote servers), it&#8217;s not actually that difficult of a task.  The prime difficult here, of course, is that you cannot shrink a live filesystem, and good luck unmounting / while the system is running.  Additionally, it seems like nobody else on the internet has had to do it (or documented the process and changes needed), other than one guy whose documentation is useless (he put up a frakking binary of resize2fs, took it down because it was &#8220;a binary without source&#8221; [which the GPL abhors], and said he &#8220;didn&#8217;t have the sources anymore&#8221;.  You&#8217;ll see further down exactly how large the necessary change to publicly available sources is [one line, and not a complicated one]).</p>
<p>In case you&#8217;ve never look at it before, the initramfs (and initrd before it, though RHEL still calls the initramfs an initrd, despite the fact that you cannot stuff an ext2 filesystem in there anymore to my knowledge) is a gzipped cpio archive, which makes mucking with it dead simple.  Just make yourself a directory somewhere (I used ~/initrd), and issue:</p>
<pre>gzip -d --suffix=".img" | cpio -id < /path/to/initrd</pre>
<p>You'll find a directory structure resembling:</p>
<pre>drwxr-xr-x 2 root root 4096 May  8 13:03 bin
drwxr-xr-x 2 root root 4096 Mar  6 08:54 dev
drwxr-xr-x 4 root root 4096 Mar  6 08:54 etc
-rwxr-xr-x 1 root root 2007 May 11 04:58 init
drwxr-xr-x 2 root root 4096 May  8 09:52 lib
lrwxrwxrwx 1 root root    3 May  8 12:09 lib64 -> lib
drwxr-xr-x 2 root root 4096 Mar  6 08:54 loopfs
drwxr-xr-x 2 root root 4096 Mar  6 08:54 proc
lrwxrwxrwx 1 root root    3 Mar  6 08:54 sbin -> bin
drwxr-xr-x 2 root root 4096 Mar  6 08:54 sys
drwxr-xr-x 2 root root 4096 Mar  6 08:54 sysroot</pre>
<p>The bulk of the work is done in ./init, which calls out to nash (an ridiculously limited shell with almost zero constructs for doing useful stuff other than booting).  It mounts /proc and /sys, makes device nodes for the consoles, null, zero, and shared memory, loads drivers (LVM/SCSI), then finds the root filesystem, mounts it, and pivots the root to continue normal bootup.  The only real caveat here is that every binary in there is statically linked -- and that's not necessarily a bad thing, since portability is a lot easier.  </p>
<p>To resize, we'll need resize2fs built statically, and e2fsck wouldn't be a bad idea either.  There are make targets for both of them in e2fsprogs (either an SRPM or just sources, your pick).  All the routines in e2fsprogs check to see whether or not the filesystem is mounted before they do anything by checking /etc/mtab or /proc/mounts (and nash's mount doesn't put an entry in /proc/mounts for reasons that I haven't dug into).  That file does not exist during the init process, and while e2fsck will spit out a warning and continue to run, resize2fs isn't so lucky.  From resize/main.c:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
* Figure out whether or not the device is mounted, and if it is
* where it is mounted.
*/</span>
len<span style="color: #339933;">=</span><span style="color: #0000dd;">80</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  mtpt <span style="color: #339933;">=</span> malloc<span style="color: #009900;">&#40;</span>len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>mtpt<span style="color: #009900;">&#41;</span>
     <span style="color: #b1b100;">return</span> ENOMEM<span style="color: #339933;">;</span>
  mtpt<span style="color: #009900;">&#91;</span>len<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  retval <span style="color: #339933;">=</span> ext2fs_check_mount_point<span style="color: #009900;">&#40;</span>device_name<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>mount_flags<span style="color: #339933;">,</span>
                                                  mtpt<span style="color: #339933;">,</span> len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>retval<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    com_err<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ext2fs_check_mount_point&quot;</span><span style="color: #339933;">,</span> retval<span style="color: #339933;">,</span>
                _<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;while determining whether %s is mounted.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                 device_name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>mount_flags <span style="color: #339933;">&amp;</span> EXT2_MF_MOUNTED<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>mtpt<span style="color: #009900;">&#91;</span>len<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
     <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
  free<span style="color: #009900;">&#40;</span>mtpt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  len <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span> <span style="color: #339933;">*</span> len<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That comes from lib/ext2fs/ismounted.c, which is 50% comments from Theodore T'so bitching about the HURD, and I don't feel like editing it (or reposting it verbatim, since the sources are easy enough to get).  The gist is that it's checking for a non-zero return value on retval and bailing if it find one (which it will).  The decision of modifying ismounted.c or just making a quick hack to resize/main.c is up to you (I opted for the quick hack option, which could be commenting out the if statement, deleting the block, or just setting retval to zero, which involves the least typing).</p>
<p>As an aside, I know braces aren't necessary in lots of languages if there's only one statement in the block (C being one of them), but it makes it seriously ugly without them.  Let's hope he never has to add another statement and forgets to add braces.</p>
<p>With that modified (I opted not to modify e2fsck, since it runs anyway), we have handy-dandy make targets for the utilities we need. </p>
<pre>make -C resize resize2fs.static &#038;&#038; make -C e2fsck e2fsck.static</pre>
<p>It should be obvious, but, ah...  Don't do a `make install` on this.  resize2fs is dangerous now.</p>
<p>Move the new binaries (located in $src/{resize,e2fsck}/*.static) to $initrd/bin, and `$EDITOR $initrd/init`.</p>
<p>At least on CentOS/RHEL, we're running an LVM root.  If you're not, the correct place may be slightly different, but not too much.  Find `lvm vgchange -ay...`, and tack the following lines after it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> Creating root device node...
<span style="color: #666666; font-style: italic;">#RHEL/CentOS ignore the 'defaults' parameter, but other systems may not</span>
mkrootdev <span style="color: #660033;">-t</span> ext3 <span style="color: #660033;">-o</span> defaults,ro <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>device<span style="color: #000000; font-weight: bold;">/</span>here
<span style="color: #7a0874; font-weight: bold;">echo</span> Resizing filesystem...
e2fsck <span style="color: #660033;">-fy</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>device<span style="color: #000000; font-weight: bold;">/</span>here
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>resize2fs <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>device<span style="color: #000000; font-weight: bold;">/</span>here <span style="color: #007800;">$newsize</span>
<span style="color: #666666; font-style: italic;">#If you're running lvm, the initrd will contain a static lvm binary, too</span>
<span style="color: #666666; font-style: italic;">#but not of the aliases to `lvmresize` and such, which is basically `lvm $argv[1] $@`</span>
<span style="color: #666666; font-style: italic;">#Caveat: lvm will not resize volumes with snapshots yet, but if you don't have any</span>
<span style="color: #666666; font-style: italic;">#you can resize now if you like.  You don't have to, since lvm will shrink online volumes</span>
<span style="color: #666666; font-style: italic;">#once you're into the actual system</span>
lvm lvresize <span style="color: #660033;">-L</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>device<span style="color: #000000; font-weight: bold;">/</span>here</pre></div></div>

<p>I would probably recommend putting this into a different initrd than the one you usually use, setting it as the default in grub, and having a one-off script change grub back and delete itself (rc.local would be a good place for this, since knocking itself out of there would be trivial).</p>
<pre>find . -print | cpio -o -c | gzip -c9 >/boot/$newinitrd</pre>
<p>The new initrd will be ~1.5MB larger than the old one (less if you stripped the binaries), but that's a trivial size different compared to a rescue image or (gods forbid) Anaconda simply to resize.  Remember: TMTOWTDI, and what OS vendors/consultants recommend is not always ideal for your situation (it was not for ours).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/05/12/resizing-on-ext3-remotely/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XMonad and xmobar on OpenSolaris with functional monitoring (mutt to boot)</title>
		<link>http://blog.theprodigalboyfriend.com/2009/05/10/xmonad-and-xmobar-on-opensolaris-with-functional-monitoring-mutt-to-boot/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/05/10/xmonad-and-xmobar-on-opensolaris-with-functional-monitoring-mutt-to-boot/#comments</comments>
		<pubDate>Mon, 11 May 2009 03:21:52 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bitching]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[shitcode]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=324</guid>
		<description><![CDATA[I&#8217;ve been having carpal tunnel flareups lately, so I went looking around for things I could do to use the mouse less and the keyboard more (as counter-intuitive as that may sound, I find that holding a mouse for hours irritates it far more than any amount of typing, YMMV). Vimperator is an obvious first [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having carpal tunnel flareups lately, so I went looking around for things I could do to use the mouse less and the keyboard more (as counter-intuitive as that may sound, I find that holding a mouse for hours irritates it far more than any amount of typing, YMMV).  Vimperator is an obvious first step, but, well, I love vi, so I already had that running.</p>
<p>Tiling window managers came to mind.  I&#8217;ve already used wmii and dwm once upon a time, but they&#8217;re hardly state of the art (as state of the art as tiling window managers get, anyway), and hacking together a reasonable workspace status bar in dzen/Perl didn&#8217;t appeal to me.  Awesome3 (the window manager) does appeal to me, but getting it running on Solaris looked like a little more work than I wanted to invest, and I&#8217;m sick of working with moving targets (Awesome3 looks like they&#8217;re almost as &#8220;break your config&#8221; happy as Rails).</p>
<p>Mind you, I still love Openbox, but given that 99% of my time is spent in terminals (irssi, mutt, ssh, vim, mcabber, slash&#8217;em), I see no reason why I should even bother with having window decorations and manually arranging them at all.</p>
<p>Had I known what I was getting into, I probably would have just used Awesome.  I mean, it needed two libraries I didn&#8217;t have, and some dzen hacking.  Not&#8230; this.  Not that I&#8217;m unhappy with XMonad, but&#8230;</p>
<p>Firstly, there&#8217;s no build of GHC (Glaskow Haskell Compiler) in the OpenSolaris repositories.  There&#8217;s a pre-compiled version of GHC 6.10, but only for SPARC.  Pre-compiled version of GHC 6.8 for x86/amd64, but that ain&#8217;t helping me (a scary amount of stuff from Hackage, Haskell&#8217;s version of CPAN/rubygems/whathaveyou doesn&#8217;t want to run in GHC 6.8, and the recommended fix for some bugs is &#8220;upgrade to 6.10&#8243;).</p>
<p>No GCC 4 in the repos either, and GCC 4.1.2 is the recommended version for building GHC.  So, onto the magic.  Don&#8217;t even try with SunStudio.  GNU-isms in the code stopped me dead.</p>
<p>I was bitching to Dan about how ridiculous this process was a few weeks ago.  Maybe it&#8217;ll help somebody.</p>
<p>Firstly, either install readline from the OpenSolaris Pending repositories or compile it yourself. </p>
<p>Next, we need to bootstrap gcc.  For that, we&#8217;ll need gmp from GNU and mpfr.  Grab the precompiled version of <a href="http://www.haskell.org/ghc/dist/6.8.2/maeder/ghc-6.8.2-i386-unknown-solaris2.tar.bz2">GHC 6.8.2</a> while you&#8217;re at it.  You should also get the newest versions of ghc and ghc-$version and ghc-$version-src-extralibs to get running later.</p>
<p>Complaint #1: GNU automake is braindead.  It, I assume, just checks `uname` and not `isainfo`, so I can&#8217;t tell when we&#8217;re running 64 bit.  Either use Solaris libtools or do the following for gmp and MPFR</p>
<pre>./configure ABI=32 &#038;&#038; gmake &#038;&#038; pfexec gmake install
make distclean
configure --prefix=/usr/local/lib64 &#038;&#038; gmake &#038;&#038; pfexec gmake install</pre>
<p>If you don&#8217;t specify another prefix, it&#8217;ll stomp all over the 32 bit libraries it just installed on your 64 bit box.</p>
<p>Complain #2: gcc is even more braindead.  It&#8217;ll build a 64 bit binary but link it against 32 bit libraries, then eat itself during stage 2 bootstrap.  You&#8217;d <em>think</em> the FSF would be smarter, but no.  It just finds the wrong ELFCLASS down the line.  To correct:</p>
<pre>export LDFLAGS=-L/opt/local/lib -L/opt/local/lib/64 \
-R/usr/local/lib:/usr/local/lib/64
export LD_OPTIONS=-L/opt/local/lib -L/opt/local/lib/64 \
-R/usr/local/lib:/usr/local/lib/64
./configure &#038;&#038; gmake -j4 &#038;&#038; pfexec gmake install</pre>
<p>Complaint #3: The precompiled ghc-6.8.2 we got?  It sucks.  The rts library is broken (check it with ldd).  It would be nice to avoid this, but, well&#8230;  Bootstrapping ghc from C sources and no Haskell compiler involves another goddamn system which DOES have Haskell installed, AND knowledge of what registers your CPU uses.  Whoever thought up that notion of bootstrapping?  Well&#8230;  The &#8220;goal&#8221; is to have Haskell self-bootstrap (it currently does not, since, ironically, Haskell is too &#8220;pure&#8221; to actually be written in a &#8220;pure&#8221; language, since we need dirty things like actually doing something useful with &#8220;impure&#8221; data, like user input or stuff sucked in from a file).</p>
<pre>cd ../ghc-6.8.2
./configure &#038;&#038; pfexec gmake install
ghc-pkg describe rts > rts.pkg
vim rts.pkg
#add -R/usr/local/lib to the end of the ldoptions field, or ghc bombs bootstrapping the new version in stage 2
ghc-pkg update rts.pkg</pre>
<p>Complaint #4: GHC is even stupider than GCC, if possible.  Not only do we have to prepend /usr/local/bin to $PATH so GHC can find our shiny new gcc-4.1.2, we have to pass ridiculous amounts of config flags (including one which tells it where GCC is &#8212; if the $PATH OR &#8211;with-gcc is wrong, it won&#8217;t bootstrap.  Don&#8217;t ask, because I don&#8217;t know why).</p>
<pre>export PATH=/usr/local/bin:$PATH
./configure --with-gcc=/usr/local/bin/gcc --with-gmp-libraries=/usr/local/lib --with-gmp-include=/usr/local/include --with-readline-libraries=/usr/local/bin --with-readline-include=/usr/local/include
gmake -j4 &#038;&#038; pfexec gmake install</pre>
<p>Yay!  Working GHC.  Sadly, if you want to reclaim the 350MB or so the GHC 6.8 install is taking up, you have to go remove it yourself (apparently the GHC team does not believe in `make uninstall`).  This means we can install cabal, which requires nothing special, other than you grabbing the tarball and installing it as normal.</p>
<p>Next, `cabal install xmonad xmonad-contrib`  I said we were going to install xmobar, and we are, but it&#8217;s a little tricker.  You see, even though Xmobar mostly reads a pipe to give us a title and workspace listing, the plugins are not optional.  They also depend on libnotify, which is only present on Linux.  Good job, xmobar developer!  Fortunately, this is easily corrected, and xmobar (mostly) works.  Caveats explained later.</p>
<p>You can&#8217;t just `cabal install` xmobar.  No-go since hinotify will not install, and there&#8217;s not a clear explanation as to why from the output.  As noted, it doesn&#8217;t <em>really</em> depend on it, just that the developer can&#8217;t be bothered to use Haskell&#8217;s typing system to throw messages at you when you try to use features that are not implemented.  So&#8230;  edit ~/.cabal/packages/hackage.haskell.org/xmobar/$version/xmobar-$version/xmonad.cabal</p>
<p>Take out the lines referring to hinotify.  Then `cabal build &#038;&#038; cabal install` from the directory xmonad.cabal was in. Ooh and aah, but don&#8217;t try to use, well&#8230; anything.  BatteryReader, CpuReader, MemReader, Net, Swap, all broken.  Thankfully, we have Dtrace and Python to replace it with, since xmobar&#8217;s PipeReader still works.</p>
<p>Memory usage?</p>

<div class="wp_syntax"><div class="code"><pre class="d" style="font-family:monospace;">#pragma D option quiet
#pragma D option bufsize<span style="color: #66cc66;">=</span>16k
&nbsp;
dtrace<span style="color: #66cc66;">:::</span>BEGIN
<span style="color: #66cc66;">&#123;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
profile<span style="color: #66cc66;">:::</span>tick<span style="color: #66cc66;">-</span>1sec
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">/* RAM stats */</span>
	this<span style="color: #66cc66;">-&gt;</span>ram_total <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">`physinstalled;
	this-&gt;unusable  = `</span>physinstalled <span style="color: #66cc66;">-</span> <span style="color: #ff0000;">`physmem;
	this-&gt;locked    = `</span>pages_locked<span style="color: #66cc66;">;</span>
	this<span style="color: #66cc66;">-&gt;</span>ram_used  <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">`availrmem - `</span>freemem<span style="color: #66cc66;">;</span>
	this<span style="color: #66cc66;">-&gt;</span>freemem   <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">`freemem;
	this-&gt;kernel    = `</span>physmem <span style="color: #66cc66;">-</span> <span style="color: #ff0000;">`pages_locked - `</span>availrmem<span style="color: #66cc66;">;</span>
&nbsp;
	this<span style="color: #66cc66;">-&gt;</span>ram_total	<span style="color: #66cc66;">*=</span> <span style="color: #ff0000;">`_pagesize;  this-&gt;ram_total	/= 1048576;
	this-&gt;unusable	*= `</span>_pagesize<span style="color: #66cc66;">;</span>  this<span style="color: #66cc66;">-&gt;</span>unusable	<span style="color: #66cc66;">/=</span> <span style="color: #0000dd;">1048576</span><span style="color: #66cc66;">;</span>
	this<span style="color: #66cc66;">-&gt;</span>kernel	<span style="color: #66cc66;">*=</span> <span style="color: #ff0000;">`_pagesize;  this-&gt;kernel	/= 1048576;
	this-&gt;locked	*= `</span>_pagesize<span style="color: #66cc66;">;</span>  this<span style="color: #66cc66;">-&gt;</span>locked	<span style="color: #66cc66;">/=</span> <span style="color: #0000dd;">1048576</span><span style="color: #66cc66;">;</span>
	this<span style="color: #66cc66;">-&gt;</span>ram_used	<span style="color: #66cc66;">*=</span> <span style="color: #ff0000;">`_pagesize;  this-&gt;ram_used	/= 1048576;
	this-&gt;freemem	*= `</span>_pagesize<span style="color: #66cc66;">;</span>  this<span style="color: #66cc66;">-&gt;</span>freemem	<span style="color: #66cc66;">/=</span> <span style="color: #0000dd;">1048576</span><span style="color: #66cc66;">;</span>
	printf<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;RAM: %2d%%<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>this<span style="color: #66cc66;">-&gt;</span>ram_total <span style="color: #66cc66;">-</span> this<span style="color: #66cc66;">-&gt;</span>freemem<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0000dd;">100</span> <span style="color: #66cc66;">/</span> this<span style="color: #66cc66;">-&gt;</span>ram_total<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Network speeds?</p>

<div class="wp_syntax"><div class="code"><pre class="d" style="font-family:monospace;"><span style="color: #0040ff;">#!/usr/sbin/dtrace -s</span>
#pragma D option quiet
dtrace<span style="color: #66cc66;">:::</span>BEGIN
<span style="color: #66cc66;">&#123;</span>
	TCP_out <span style="color: #66cc66;">=</span> <span style="color: #0000dd;">0</span><span style="color: #66cc66;">;</span> TCP_in <span style="color: #66cc66;">=</span> <span style="color: #0000dd;">0</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
mib<span style="color: #66cc66;">:::</span>tcpOutDataBytes		<span style="color: #66cc66;">&#123;</span> TCP_out <span style="color: #66cc66;">+=</span> arg0<span style="color: #66cc66;">;</span>   <span style="color: #66cc66;">&#125;</span>
mib<span style="color: #66cc66;">:::</span>tcpInDataInorderBytes	<span style="color: #66cc66;">&#123;</span> TCP_in <span style="color: #66cc66;">+=</span> arg0<span style="color: #66cc66;">;</span>    <span style="color: #66cc66;">&#125;</span>
&nbsp;
profile<span style="color: #66cc66;">:::</span>tick<span style="color: #66cc66;">-</span>1sec
<span style="color: #66cc66;">&#123;</span>
	OUT_print <span style="color: #66cc66;">=</span> TCP_out<span style="color: #66cc66;">/</span><span style="color: #0000dd;">1024</span><span style="color: #66cc66;">;</span> IN_print <span style="color: #66cc66;">=</span> TCP_in<span style="color: #66cc66;">/</span><span style="color: #0000dd;">1024</span><span style="color: #66cc66;">;</span>
	printf<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Out:%3d|In:%3d&quot;</span><span style="color: #66cc66;">,</span> OUT_print<span style="color: #66cc66;">,</span> IN_print<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	TCP_out <span style="color: #66cc66;">=</span> <span style="color: #0000dd;">0</span><span style="color: #66cc66;">;</span>
	TCP_in <span style="color: #66cc66;">=</span> <span style="color: #0000dd;">0</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>.xmobarrc</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">Config <span style="color: green;">&#123;</span> font <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;-*-terminus-*-*-*-*-12-*-*-*-*-*-*-u&quot;</span>
       <span style="color: #339933; font-weight: bold;">,</span> bgColor <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;#000000&quot;</span>
       <span style="color: #339933; font-weight: bold;">,</span> fgColor <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;#AFAF87&quot;</span>
       <span style="color: #339933; font-weight: bold;">,</span> position <span style="color: #339933; font-weight: bold;">=</span> Top 
       <span style="color: #339933; font-weight: bold;">,</span> lowerOnStart <span style="color: #339933; font-weight: bold;">=</span> True
       <span style="color: #339933; font-weight: bold;">,</span> commands <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#91;</span> Run Date <span style="background-color: #3cb371;">&quot;%a %b %_d %Y %H:%M:%S&quot;</span> <span style="background-color: #3cb371;">&quot;date&quot;</span> <span style="color: red;">10</span> 
                    <span style="color: #339933; font-weight: bold;">,</span> Run Weather <span style="background-color: #3cb371;">&quot;KSTP&quot;</span> <span style="color: green;">&#91;</span><span style="background-color: #3cb371;">&quot;-t&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;&lt;tempF&gt;F&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;-L&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;64&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;-H&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;77&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;--normal&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;green&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;--high&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;red&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;--low&quot;</span><span style="color: #339933; font-weight: bold;">,</span><span style="background-color: #3cb371;">&quot;lightblue&quot;</span><span style="color: green;">&#93;</span> <span style="color: red;">36000</span>
		    <span style="color: #339933; font-weight: bold;">,</span> Run PipeReader <span style="background-color: #3cb371;">&quot;/export/home/ryan/dtrace/net&quot;</span> <span style="background-color: #3cb371;">&quot;wireless&quot;</span>
		    <span style="color: #339933; font-weight: bold;">,</span> Run PipeReader <span style="background-color: #3cb371;">&quot;/export/home/ryan/dtrace/netspeed&quot;</span> <span style="background-color: #3cb371;">&quot;speed&quot;</span>
		    <span style="color: #339933; font-weight: bold;">,</span> Run PipeReader <span style="background-color: #3cb371;">&quot;/export/home/ryan/dtrace/psr&quot;</span> <span style="background-color: #3cb371;">&quot;cpui&quot;</span>
		    <span style="color: #339933; font-weight: bold;">,</span> Run PipeReader <span style="background-color: #3cb371;">&quot;/export/home/ryan/dtrace/ram&quot;</span> <span style="background-color: #3cb371;">&quot;mem&quot;</span>
                    <span style="color: #339933; font-weight: bold;">,</span> Run StdinReader
                    <span style="color: green;">&#93;</span>
       <span style="color: #339933; font-weight: bold;">,</span> sepChar <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;%&quot;</span>
       <span style="color: #339933; font-weight: bold;">,</span> alignSep <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;}{&quot;</span>
       <span style="color: #339933; font-weight: bold;">,</span> template <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot; %StdinReader% } { %cpui% | %mem% | %wireless% %speed% | %date% | %KSTP%&quot;</span>
       <span style="color: green;">&#125;</span></pre></div></div>

<p>A script to feed those pipes.  If you don&#8217;t have python2.6, pexpect on python2.4 (the Solaris/OpenSolaris default) works.  Just install pexpect with easy_install, an .egg, or whatever your poison may be.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python2.6</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">math</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">platform</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">stat</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> pexpect
&nbsp;
<span style="color: #808080; font-style: italic;">#Get the directory we're running from to create the fifos rather than the $pwd of whatever called us</span>
path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">realpath</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;/&quot;</span>
&nbsp;
wificonfig = <span style="color: #483d8b;">&quot;&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Y'know, I haven't actually written the iwconfig thing.  It's here for posterity and possible later use.</span>
osystem = <span style="color: #dc143c;">platform</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> osystem == <span style="color: #483d8b;">'SunOS'</span>:
  wificonfig = <span style="color: #483d8b;">'wificonfig'</span>
<span style="color: #ff7700;font-weight:bold;">elif</span> osystem == <span style="color: #483d8b;">'Linux'</span>:
  wificonfig = <span style="color: #483d8b;">'iwconfig'</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#Kill off any old instances which may be running.  Poor man's pkill, but guaranteed to work pretty much anywhere.</span>
pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;ps -ef |grep mpstat |grep -v python| awk <span style="color: #000099; font-weight: bold;">\'</span>{print $2}<span style="color: #000099; font-weight: bold;">\'</span> | xargs kill -9&quot;'</span><span style="color: black;">&#41;</span>
pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;ps -ef | grep speed.d | awk <span style="color: #000099; font-weight: bold;">\'</span>{print $2}<span style="color: #000099; font-weight: bold;">\'</span> | xargs kill -9'</span><span style="color: black;">&#41;</span>
pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;ps -ef | grep meminfo.d | awk <span style="color: #000099; font-weight: bold;">\'</span>{print $2}<span style="color: #000099; font-weight: bold;">\'</span> | xargs kill -9'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> checkfifo<span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;">#If it ain't there, make it</span>
  <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">os</span>.<span style="color: black;">mkfifo</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>
    handle = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;r+&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> handle
  <span style="color: #808080; font-style: italic;">#If it is, just return it</span>
  <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #dc143c;">stat</span>.<span style="color: black;">S_ISFIFO</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: #dc143c;">stat</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>.<span style="color: black;">st_mode</span><span style="color: black;">&#41;</span>:
    handle = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;r+&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> handle
  <span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">isfile</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>:
      <span style="color: #808080; font-style: italic;">#Not a FIFO, and it needs to be</span>
      <span style="color: #dc143c;">os</span>.<span style="color: black;">unlink</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">os</span>.<span style="color: black;">mkfifo</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>
    handle = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;r+&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> handle
&nbsp;
<span style="color: #808080; font-style: italic;">#Set up our fifos</span>
psrfifo = checkfifo<span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;psr&quot;</span><span style="color: black;">&#41;</span>
netfifo = checkfifo<span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;net&quot;</span><span style="color: black;">&#41;</span>
nspdfifo = checkfifo<span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;netspeed&quot;</span><span style="color: black;">&#41;</span>
ramfifo = checkfifo<span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;ram&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Fire off the processes we'll be reading from.  Using pexpect seems like overkill, but mpstat is apparently smart enough to tell when it's being read from a pipe, and it'll buffer no matter what you do.  pexpect/expect fake being interactive, so it happily runs without buffering.</span>
mpstat = pexpect.<span style="color: black;">spawn</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;mpstat 1 | grep -v CPU&quot;'</span><span style="color: black;">&#41;</span>
ramstats = pexpect.<span style="color: black;">spawn</span><span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;meminfo.d&quot;</span><span style="color: black;">&#41;</span>
nspeed = pexpect.<span style="color: black;">spawn</span><span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;speed.d&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Regular expressions to use later.  Since it's a long-runnign script, they may as well be compiled</span>
mpre = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^<span style="color: #000099; font-weight: bold;">\s</span>+?(?P&lt;cpu&gt;<span style="color: #000099; font-weight: bold;">\d</span>+).*?(?P&lt;idle&gt;<span style="color: #000099; font-weight: bold;">\d</span>+)$'</span><span style="color: black;">&#41;</span>
solwifire = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'.*?linkstatus: (?P&lt;status&gt;<span style="color: #000099; font-weight: bold;">\w</span>+).*essid: (?P&lt;essid&gt;<span style="color: #000099; font-weight: bold;">\w</span>+).*strength: <span style="color: #000099; font-weight: bold;">\w</span>+<span style="color: #000099; font-weight: bold;">\(</span>(?P&lt;strength&gt;<span style="color: #000099; font-weight: bold;">\d</span>+)<span style="color: #000099; font-weight: bold;">\)</span>.*'</span>, <span style="color: #dc143c;">re</span>.<span style="color: black;">DOTALL</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> prstat<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;">#Yay for awk/sed abuse, but it's concise and I'm already forking.  Basically getting a list of CPUs to check later, so this script should perform its duty no matter if you have 1 CPU or 128 (T2 users)</span>
  psrinfo = pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;psrinfo -v |grep MHz | awk <span style="color: #000099; font-weight: bold;">\'</span>{print $6,$7}<span style="color: #000099; font-weight: bold;">\'</span> | sed -e <span style="color: #000099; font-weight: bold;">\'</span>s/,//<span style="color: #000099; font-weight: bold;">\'</span>&quot;'</span><span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
  output = <span style="color: #483d8b;">&quot;&quot;</span>
  <span style="color: #ff7700;font-weight:bold;">for</span> cpu <span style="color: #ff7700;font-weight:bold;">in</span> psrinfo:
    line = prmatch<span style="color: black;">&#40;</span>cpu<span style="color: black;">&#41;</span>
    output = output + line
  psrfifo.<span style="color: black;">write</span><span style="color: black;">&#40;</span>output + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
  psrfifo.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> prmatch<span style="color: black;">&#40;</span>cpu<span style="color: black;">&#41;</span>:
  line = mpstat.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  m = mpre.<span style="color: black;">match</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
  <span style="color: #808080; font-style: italic;">#Match it against our earlier regex and subtract the idle value from 100 to get the actual used percentage, which isn't wholly accurate (IOWAIT and whatnot), but it's good enough for me</span>
  usage = <span style="color: #ff4500;">100</span> - <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'idle'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
  <span style="color: #808080; font-style: italic;">#Padding the string seems stupid, and it is, but xmobar arbitrarily decides spots that it's not going to refresh even if text shows up there, leaving it (black in my case) when text slides.  Padding fixes that.  Also, if your CPU goes to 100%, you probably shouldn't have a script which reads dtrace probes running.  Just sayin'.</span>
  <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;Cpu%s: %2d%% (%s) &quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'cpu'</span><span style="color: black;">&#41;</span>, usage, cpu<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> memory<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;">#I haven't found any swap information from dtrace probes as easy to manipulate as thi sis</span>
  swap = pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;/usr/sbin/swap -l |tail -n 1 | awk <span style="color: #000099; font-weight: bold;">\'</span>{print $4, $5}<span style="color: #000099; font-weight: bold;">\'</span>&quot;'</span><span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">' '</span><span style="color: black;">&#41;</span>
  <span style="color: #808080; font-style: italic;">#Ugly?  You bet.  Cast the subtract free swap from total swap blocks, divide it by free swap blocks * 100 cast to an int to give us an actual percentage, floor that, then cast THAT to an int</span>
  usedswap = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">math</span>.<span style="color: black;">floor</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>swap<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>-<span style="color: #008000;">int</span><span style="color: black;">&#40;</span>swap<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>/<span style="color: #008000;">int</span><span style="color: black;">&#40;</span>swap<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
  ram = ramstats.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  output =  <span style="color: #483d8b;">&quot;%s Swap: %2d%%&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>ram, usedswap<span style="color: black;">&#41;</span>
  ramfifo.<span style="color: black;">write</span><span style="color: black;">&#40;</span>output + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
  ramfifo.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> network<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;">#Filter out interface which aren't up, which are vnics, which only point to localhost to get the running interface.  I'm assuming you only have one at a time, but if you have more modify this to suit.</span>
  iface = pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bash -c &quot;ifconfig -a | grep UP |grep RUNNING| grep -v IPv6 |grep -v lo | grep -v -E <span style="color: #000099; font-weight: bold;">\'</span>:[0-9]: <span style="color: #000099; font-weight: bold;">\'</span> | awk <span style="color: #000099; font-weight: bold;">\'</span>{print $1}<span style="color: #000099; font-weight: bold;">\'</span> | sed -e <span style="color: #000099; font-weight: bold;">\'</span>s/://<span style="color: #000099; font-weight: bold;">\'</span>i&quot;'</span><span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">if</span> osystem == <span style="color: #483d8b;">'SunOS'</span>:
    command = <span style="color: #483d8b;">&quot;wificonfig -i &quot;</span> + iface + <span style="color: #483d8b;">&quot; showstatus&quot;</span>
    status = pexpect.<span style="color: black;">run</span><span style="color: black;">&#40;</span>command<span style="color: black;">&#41;</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    output = <span style="color: #483d8b;">&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> solwifire.<span style="color: black;">match</span><span style="color: black;">&#40;</span>status<span style="color: black;">&#41;</span>:
      <span style="color: #808080; font-style: italic;">#Beauty of regexes.  If it doesn't match, it's not wireless (or not connected).  It if is, give us values.</span>
      m = solwifire.<span style="color: black;">match</span><span style="color: black;">&#40;</span>status<span style="color: black;">&#41;</span>
      strength = <span style="color: #dc143c;">math</span>.<span style="color: black;">floor</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'strength'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> / 15.<span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>
      output =  <span style="color: #483d8b;">&quot;%s: %s(%s) %3d%%&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>iface, m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'status'</span><span style="color: black;">&#41;</span>, m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'essid'</span><span style="color: black;">&#41;</span>, strength<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
      <span style="color: #808080; font-style: italic;">#Probably not wireless</span>
      output = iface + <span style="color: #483d8b;">&quot;:&quot;</span>
    netfifo.<span style="color: black;">write</span><span style="color: black;">&#40;</span>output + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span> 
    netfifo.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> netspeed<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;">#Is this method really necessary?  Couldn't the dtrace probe just write to the fifo itself?  Probably, but if you (or I) want to colorize it at some point, it may as well get sucked in here.</span>
  speed = nspeed.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  nspdfifo.<span style="color: black;">write</span><span style="color: black;">&#40;</span>speed + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
  nspdfifo.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff4500;">1</span>:
&nbsp;
  prstat<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  memory<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  network<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  netspeed<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  <span style="color: #dc143c;">time</span>.<span style="color: black;">sleep</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span></pre></div></div>

<p>It&#8217;s not the prettiest python.  I should probably move those repetitive fifo flushes/etc to a method, but I didn&#8217;t honestly expect that I&#8217;d need to replace this much XMobar functionality.  Notably, XMobar can colorize things with &lt;span&gt; attributes setting colors in case somebody wanted to pretty up the usages (really, to make it look more like XMobar&#8217;s [colorized] defaults for CPU/net usage).  I don&#8217;t care, personally.  I didn&#8217;t implement a battery monitor either, but hey, you can if you want to.</p>
<p>Complaint #5 (did I lose track?):  SUNWmutt doesn&#8217;t have support for header caching, which is a real bitch when I have 12,000 emails.  It also doesn&#8217;t support SMTP over SSL, making it pretty well worthless for Gmail. I have other accounts I use mutt for, but Gmail&#8217;s an important one.</p>
<p>This isn&#8217;t that tough, really.  You need some kind of a database for the mutt config script, and gdbm is trivially easy to get running (normal ./configure &#038;&#038; make &#038;&#038; make install).  On the other hand, we run into two hiccups.  The configure file depends on ncurses, which is just a link to plain ol&#8217; curses on lots of Solaris boxes.  Secondly, (and I don&#8217;t really begrudge the Mutt guys for this, since there&#8217;s actually a commit to fix this, unlike GCC and GHC, whose response is &#8220;too fucking bad&#8221; [GHC actually posts the recommendation for fixing rts.pkg and the configure flags on their own site rather than FIXING THE BUILD]), configure.ac does some things wrong with libidn.  </p>
<p>Find $with_idn, and replace the block which follows it with this (&#8211;with-idn doesn&#8217;t seem to build properly).:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$with_idn</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;no&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$with_idn</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;yes&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
    AC_CHECK_HEADERS<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>idn<span style="color: #000000; font-weight: bold;">/</span>idn-int.h<span style="color: #7a0874; font-weight: bold;">&#93;</span>,
      <span style="color: #7a0874; font-weight: bold;">&#91;</span>AC_CHECK_HEADERS<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>idn<span style="color: #000000; font-weight: bold;">/</span>idna.h<span style="color: #7a0874; font-weight: bold;">&#93;</span>, <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
        <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">CPPFLAGS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$CPPFLAGS</span> -I/usr/include/idn&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>If you don&#8217;t have or want ncurses (or it&#8217;s a symlink on your system), fix configure.  `sed -i -e &#8216;s/-lncurses/-lcurses/&#8217; configure`.</p>
<p>./configure &#8211;with-regex &#8211;with-gnutls &#8211;enable-hcache &#8211;enable-smtp &#8211;enable-imap &#8211;enable-pop &#8211;enable-mailtool &#8211;with-sasl &#8211;with-idn=/usr/include/idn</p>
<p>Congratulations!  </p>
<p>Next up, re-implementing htop for Solaris with dtrace probes, python, and ncurses. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/05/10/xmonad-and-xmobar-on-opensolaris-with-functional-monitoring-mutt-to-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bored</title>
		<link>http://blog.theprodigalboyfriend.com/2009/05/07/bored/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/05/07/bored/#comments</comments>
		<pubDate>Thu, 07 May 2009 19:57:05 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bitching]]></category>
		<category><![CDATA[Prospective Trip]]></category>
		<category><![CDATA[Rambling]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=326</guid>
		<description><![CDATA[So bored it&#8217;s unreal, actually. Other than a strong desire find a Haskell developer and treat him like a punching bag (but that&#8217;s another rant, probably this weekend, now that I&#8217;m finally done getting a working Xmonad/xmobar/Mutt/zsh combination on OpenSolaris with proper statistics), I haven&#8217;t had anything to do. I haven&#8217;t logged into WoW in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>So</strong> bored it&#8217;s unreal, actually.  Other than a strong desire find a Haskell developer and treat him like a punching bag (but that&#8217;s another rant, probably this weekend, now that I&#8217;m finally done getting a working Xmonad/xmobar/Mutt/zsh combination on OpenSolaris with proper statistics), I haven&#8217;t had anything to do.  I haven&#8217;t logged into WoW in a month or so, though I may do that this weekend also.  I&#8217;m sort of stuck in a rut here.  </p>
<p>Half-Price Books had their warehouse sale last weekend, so I picked up some new books, but those aren&#8217;t going to keep me occupied for very long.  Heather&#8217;s website has to be rewritten at some point, but I&#8217;m still debating technologies to use for that (I like Rails, I really do, but the core team doesn&#8217;t give a shit if they break features during minor version releases, so almost all the documentation you find is out of date without going back $n versions and applying all the errata).  Django is seeming appealing.  I do not, however, have any idea how well that&#8217;s supported on Dreamhost.  Sure, there are entries for it on their wiki, but Rails wasn&#8217;t exactly stable when they first added support for that.  For a personal site, m&#8217;kay.  For a site for her business?  I&#8217;d rather have something reliable.  Not that Django isn&#8217;t reliable, just that I don&#8217;t know how reliable it is on Dreamhost.  Maybe I&#8217;ll set up a Django site on my VPS and just point her DNS servers (which are not hosted by Dreamhost) there.</p>
<p>I am, in truth, spending an inordinate amount of time questing for the Amulet of Yendor.  I forgot how much I loved NetHack, and Slash&#8217;em just makes it better.  On the downside, valkyries don&#8217;t appear to start with a longsword in Slash, so I&#8217;m not going to get any free Excaliburs at level 5.  Monks aren&#8217;t bad at all, but food is kind of a pain in the ass.  I&#8217;d also guess that blessed scrolls of genocide drop less frequently, leading to me getting killed by liches a few times.  Awesome.</p>
<p>I&#8217;m sort of considering implementing Vassal in PyGame.  Vassal 40k is a really neat system.  Dice rolling isn&#8217;t handled all that well, it doesn&#8217;t import AB files, and the Vassal engine doesn&#8217;t do reforms/wheels well at all.  I&#8217;m not going to hack at the Java to fix Vassal (thought the developers have started work on Vassal Fantasy Battles), and I sort of want to learn PyGame anyway, which seems like a good motivation to do it.  Dan and I never did finish the C# implementation (in fact, I never really did anything other than the XML parser, and I have no idea how far he got).  I don&#8217;t imagine it taking me all that long to do it in Python though, with PyGame doing the heavy lifting of the GDI crap C# needs for me.  Thoughs (take a look at Vassal 40k, for instance)?  I don&#8217;t picture it being difficult to render sprites from images of models I find on Google Image Search, but I guess you never know.</p>
<p>I do have lots of time to read news, though, and I&#8217;ve come to the following conclusions:</p>
<ul>
<li><strong>Slashdot:</strong> My first, and probably still my favorite.  The Firehose is worthless, but the community moderation system is incredibly effective.  It is the only place I visit where I can regularly expect to see somebody with a post-graduate degree in whatever subject it is posting.  People like NYCountryLawyer (who is actually a lawyer) make the site.  There are, of course, some libertarian &#8220;omg government never solves any problems&#8221; trolls (who don&#8217;t think they are trolls), but that goes across the spectrum (generally people who say this in response to anything have never looked at numbers comparing government spending to private spending in the same field &#8212; Medicare being a great example &#8212; and mistakenly believe that corporations wouldn&#8217;t rape everybody).  Increasingly dominated by people who have never worked worked in the real world (with user ids near 1.5 million) and an astounding amount of GPL trolls (who think it&#8217;s the greatest license since sliced bread and slander any company which does not abide by it &#8212; including Sun&#8217;s CDDL, which was devised because they don&#8217;t own the IP on some of their drivers &#8212; while simultaneously whining that they can&#8217;t steal code [ZFS, dtrace, etc] from alternatively-licensed projects).  These, though, are generally modded into oblivion also.
</li>
<li><strong>(Total)Fark:</strong> Biting headlines, little regard for the average human being (which I sort of appreciate, actually, since most of the people in their stories deserved what they got).  Effective moderation, but the comment threading system sucks (not that I really need to read the comments with TotalFark having ~1 story per minute, most of which are worth a read).  JonSnow is awesome.</li>
<li><strong>Reddit:</strong> Reddit seems to be a mixed bag.  I love /r/programming, and some of the other SubReddits are great.  At the same time, the average Redditor believes that they are much more intelligent than they actually are. I <em>often</em> see people talking about how they were &#8220;too smart&#8221; to be in school which, while possibly true, isn&#8217;t really relevant given that school is primarily a social tool.  People spew nonsense about how the public education system was designed to make for complacent workers who will follow commands and obey the bell (this is true, but that was 130 years ago, and I&#8217;d hardly say school is psychological prep for working in a meat processing plant these days).  There&#8217;s a lot of talk (on Reddit and Slashdot) about home schooling by parents who believe their children are beautiful, brilliant, unique snowflakes.  Their child is doing $randomthing (3d rendering, programming, whatever) or is in &#8220;7th grade&#8221; at age 9, so it must be better, though they have no unbiased metrics to use for comparison.
<p>This particular aspect of Reddit comes out in shit like <a href="http://www.reddit.com/r/AskReddit/comments/8gzx7/ask_me_about_being_a_paedophile/">this</a> (which is, by the way, the 2nd time that subject has been on AskReddit in the last few months).  I&#8217;m all for being inclusive, but seriously?  Not everybody deserves it.  Reddit&#8217;s comment threading system is good, even if I don&#8217;t like it as much as Slashdot&#8217;s (in particular, if a parent post is downvoted too many times in Reddit, it hides the entire tree, even if one of the replies has 1,000,000 upvotes), but I don&#8217;t know where the fuck the moderation is sometimes.  To give this guy a platform where he can answer selected questions to rationalize his behavior and make it seem as if he doesn&#8217;t need help is, well&#8230;  Ephebophilia isn&#8217;t that uncommon, but this guy states he&#8217;s attracted to 2 year olds, FFS, and that he &#8220;admires them&#8221; at playgrounds and whatnot (he says he&#8217;s never touched them or seen images/videos, but that&#8217;s extremely dubious, and it&#8217;s virtually assured that he <strong>will</strong> act upon his urges at some point).  I&#8217;m not easily sickened but, well, read the comments.  Virtually nobody calls him out on it.  They just stroke his ego.</li>
</ul>
<p>Somebody give me a suggestion.  If not, I&#8217;m just going start writing a frontend for a Vassal clone (while that may sound stupid, I suspect that the biggest obstacle WILL end up in unit reformation/wheeling/etc rather than back-end logic, so I&#8217;ll write it first.  Integration tests can cover everything else when I write it).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/05/07/bored/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control structures, in my functional language?</title>
		<link>http://blog.theprodigalboyfriend.com/2009/04/17/control-structures-in-my-functional-language/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/04/17/control-structures-in-my-functional-language/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 19:37:58 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=322</guid>
		<description><![CDATA[In other words, Scala &#8212; first impressions (though a lot of this also applies to F#). Don&#8217;t get me wrong, the idea of a functional language on the JVM appeals to me (and not Clojure, due to Lisp hate). It&#8217;s a major problem for me, though, that the JVM doesn&#8217;t support tail packing at all [...]]]></description>
			<content:encoded><![CDATA[<p>In other words, Scala &#8212; first impressions (though a lot of this also applies to F#).  Don&#8217;t get me wrong, the idea of a functional language on the JVM appeals to me (and not Clojure, due to Lisp hate).  It&#8217;s a major problem for me, though, that the JVM doesn&#8217;t support tail packing <em>at all</em> (the CLR might with F# becoming a first-class language, but if so, I&#8217;ve heard nothing about it), which makes recursion the way it&#8217;s normally used sort of a problem.  While somewhat offset by the fact that Scala can utilize pretty much any Java library out there.  Groovy and JRuby can, too, and they feel more natural.  JRuby, at least, doesn&#8217;t clutter the code with Java-isms (for lack of a better term).  I don&#8217;t want to type <strong>MyClass</strong> extends <strong>SomeOtherClass</strong> in a functional language.</p>
<p>I want first-class support for map instead of it being a metaphor for for.  Function composition is neat and all, but it&#8217;s there in every functional language (and other than map and foldl/r, I haven&#8217;t found a lot of use for it).  I don&#8217;t want to import scala.collection.mutable.Hashmap.  I don&#8217;t want mutable variables <em>at all</em>.  Lists and tuples are enough.  I want pattern matching to function the way it does in Haskell, OCaml, SML, F#, Erlang, and probably more rather than using a gussied up case statement.  I&#8217;d rather not see for, while, foreach, et al in there.  If I wanted them, I&#8217;d write them myself:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #014ea4;">-</span><span style="color: #5400b3;">module</span><span style="color: #109ab8;">&#40;</span>for<span style="color: #109ab8;">&#41;</span>
<span style="color: #014ea4;">-</span><span style="color: #5400b3;">export</span><span style="color: #109ab8;">&#40;</span><span style="color: #109ab8;">&#91;</span>for<span style="color: #014ea4;">/</span><span style="color: #ff9600;">3</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span>
&nbsp;
<span style="color: #ff3c00;">for</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Maxval</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Maxval</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Function</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">F</span><span style="color: #ff3c00;">unction</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Maxval</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#93;</span>
<span style="color: #ff3c00;">for</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">I</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Maxval</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Function</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">F</span><span style="color: #ff3c00;">unction</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">I</span><span style="color: #109ab8;">&#41;</span> | <span style="color: #ff3c00;">for</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">I</span><span style="color: #014ea4;">+</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Maxval</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Function</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>Tough.</p>
<p>Those, though, are really just complaints about the way Scala does functional programming.  What I like?  Actors.  However, actors are a first-class feature in Erlang.  In Scala, they ride on top of locking/thread semantics in the JVM.  In Scala, objects which don&#8217;t implement .receive() silently discard messages.  In Scala, I can&#8217;t swap out modules without bringing down the service, and it&#8217;s nontrivial (unlike Erlang) to pass messages between identical codebases, say, Solaris, AIX, Linux, and OSX.  Sure, Erlang isn&#8217;t as fast as the JVM, but it scales out a hell of a lot better without assloads of XML and clusters.</p>
<p>I also really like the fact that unlike some languages (-cough- Erlang -cough-), string handling doesn&#8217;t, well, suck.  I like the fact that I can use JDBC bindings and Swing.  I like that it can be compiled to a .war and deployed.  Frankly though, in that case, I&#8217;d rather just use JRuby.  </p>
<p>I don&#8217;t like the ludicrous method chaining it inherits from .Java. something.length.toString.length to align text?  Really?  Same goes for F#, though.  Thanks, Scala team, and I look forward to revisiting your language sometime in the future.  Until then, I&#8217;m sticking with Erlang/OCaml/F#, depending on my needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/04/17/control-structures-in-my-functional-language/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oi, work</title>
		<link>http://blog.theprodigalboyfriend.com/2009/03/13/oi-work/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/03/13/oi-work/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:41:01 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bitching]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=314</guid>
		<description><![CDATA[It&#8217;s such a joy to come in this morning to find out that somebody has helpfully shut down the virtual machine I was testing a RHEL4.7 -> 5.3 migration in. Not a supported move by RedHat (as noted, their consultant will charge us lots of money to certify a process that I&#8217;ll already have done), [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s such a joy to come in this morning to find out that somebody has <em>helpfully</em> shut down the virtual machine I was testing a RHEL4.7 -> 5.3 migration in.  Not a supported move by RedHat (as noted, their consultant will charge us lots of money to certify a process that I&#8217;ll already have done), and it involves mucking about with lots of important parts of the system.  So, when I haven&#8217;t taken a snapshot in a couple of hours, and I leave a script running overnight, no big deal, eh?  Sadly, the team lead did not agree, and needed the precious ESX resources for the (3!) other VMs that were running at a total of 7% CPU load.  Goodbye, 800 lines of Perl to massage the system into place.  This would be less of a mess if there were any sort of reasonable rollback method, but the Linux devs, in their infinite wisdom, don&#8217;t think that&#8217;s important.</p>
<p>In fact, if you clone a drive, the logical volume manager will arbitrarily choose which one to boot from and prevent you from managing the other, even if the contents are totally different, since the cloned logical volume will have the same UUID.  More than that, you cannot boot from a LV, so RHEL sets a label in the metadata for the boot partition (typically /boot1).  This means in order to have a rollback method (a -real- rollback method), you have to clone said partition, take an LVM snapshot, rename it, hack the /etc/fstab for the partition which will become recovery, munge up the bootloader config files to get it to boot from /dev/vol/orig instead of /dev/vol/upgraded, etc.  It was nicer to have straight-up partitions, in a way.</p>
<p>The sad part is that this is a SOLVED PROBLEM.  ZFS (and Solaris Live Upgrades on UFS/VxFS/SVM) handle it with aplomb.  The license simply doesn&#8217;t agree with Linux developers, so they&#8217;re slowly (and poorly) implementing it with btrfs and ext4.  BSD has HAMMER now, and the license permits ZFS (though only FreeBSD has integrated it so far).  Hell, OSX has ZFS support (not ZFS root, but you can get around that).  Even better &#8212; ext4 loses data if you get a kernel panic, since they decided to delay allocation cycles by 115 seconds (from 5 -> 120) for a marginal performance gain unless you forcefully fsync(), which sorta defeats the point of having a journaled filesystem.</p>
<p>Maybe the work in Solaris Live Upgrade is from Bob.  It very well may be, according to him, in one of those &#8220;I don&#8217;t know whether to gape in horror, pretend it was never said, or just say &#8216;lolwut&#8217;&#8221; moments.  Specifically, he said that Microsoft contacted him and somebody else we went to school with 10 years ago to work on Solaris.  Nevermind that Solaris is 18 years old, and Solaris <2.6 goes back further than that, that's it's based on code written around the time he was born, he doesn't really know C, and it has abso-fucking-lutely nothing to do with Microsoft.  For that matter, I think Xenix (Microsoft's UNIX) was sold off to SCO before I ever used a computer.  The worst part, really, is that he'll be an IP lawyer, and he wants to be one of the non-litigating ones who just researches things.</p>
<p>At the same time, his only knowledge of RISC processors is that the GBA and DS run on ARM (which he didn't know was RISC).  Arguments about whether or not the PS3, 360, Wii, DS, PS3, his cable box, microwave, phone, and virtually every other device he uses fell on deaf ears.  Which is fine, normally.  I don't expect people to know that their cable box uses big-endian MIPS, or that the Wii, 360, and PS3 essentially run on the same processor with minor tweaks (ok, major tweaks, but they're all PPC970 at the core).  Then again, I don't expect people to litigate patents related to these things, either.  </p>
<p>It's just that I had no way to express to him how absolutely out of his depth he was -- that this is what I do for a living (about 50% of our systems are still AIX on POWER, and some are HP-UX on PA-RISC, with a little Solaris 10), and that he's dead wrong.  No successful argument could have been made, since it wasn't Microsoft on x86.  At the same time, though, I couldn't explain that a $400 PS3 has no tangible benefits over a $0 laptop (given that I already have it) when it comes to running emulators hooked up to a HDTV, since the controllers work on PCs just fine, and that throwing $400 at a PS3 so I could run Linux on POWER (well, the Cell) isn't really that interesting.  At some point, I stopped doing things because I could, and just went with solutions that work for what I need (hence, fileserver is Solaris, for which he insisted I needed to buy a MyBook, but he's <strong>never</strong> seen a drive fail, and the fact that it comes with them set up in RAID0 with a processor so wimpy it cannot saturate a single GigE interface isn&#8217;t a problem).</p>
<p>On the other hand, hanging out with Bob is entertaining most of the time, and it definitely got my mind off of the pain I&#8217;m in.  Tomorrow, I think, I&#8217;ll actually sign into WoW (assuming that I don&#8217;t go watch the crappy miniseries based on crappy books [Sword of Truth] that Bob is putting on a showing of).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/03/13/oi-work/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dammit</title>
		<link>http://blog.theprodigalboyfriend.com/2009/01/30/dammit/</link>
		<comments>http://blog.theprodigalboyfriend.com/2009/01/30/dammit/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 20:23:18 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dnd]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/?p=308</guid>
		<description><![CDATA[Ok, so cue this as being slightly more complicated. I&#8217;ve got XML files describing most of what I need. The problem is that it&#8217;s only &#8220;most.&#8221; Example: &#60;class&#62; &#60;name&#62;Rogue&#60;/name&#62; &#60;role&#62;Striker. You dart in to attack, do massive damage, and then retreat to safety. You do best when teamed with a defender to flank enemies.&#60;/role&#62; &#60;powerSource&#62;Martial. [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so cue this as being slightly more complicated.</p>
<p>I&#8217;ve got XML files describing <strong>most</strong> of what I need.  The problem is that it&#8217;s only &#8220;most.&#8221;  Example:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Rogue<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;role<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Striker. You dart in to attack, do massive damage, and then retreat to safety. You do best when teamed with a defender to flank enemies.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/role<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;powerSource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Martial. Your talents depend on extensive training and constant practice, innate skill, and natural coordination.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/powerSource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;keyAbilities<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dexterity, Strength, Charisma<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/keyAbilities<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;armorProficiencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Cloth, Leather<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/armorProficiencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;weaponProficiencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dagger, Hand Crossbow, Shuriken, Sling, Short Sword<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/weaponProficiencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bonusToDefense<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>+2 Reflex<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bonusToDefense<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;firstLevelHitPoints<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>12 + Constitution score<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/firstLevelHitPoints<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;firstLevelHitPointScript<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>12 + root.con.current<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/firstLevelHitPointScript<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hitPointsPerLevel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hitPointsPerLevel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;healingSurges<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>6 + root.con.currentMod<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/healingSurges<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trainedSkills<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[&lt;html&gt;</span>
<span style="color: #339933;">      Stealth and Thievery. From the class skills list below, choose four more trained skills at 1st level.&lt;br/&gt;&lt;i&gt;Class Skills: &lt;/i&gt; Acrobatics (Dex), Athletics (Str), Bluff (Cha), Dungeoneering (Wis), Insight (Wis), Intimidate (Cha), Perception (Wis), Stealth (Dex), Streetwise (Cha), Thievery (Dex)&lt;/html&gt; </span>
<span style="color: #339933;">    ]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trainedSkills<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;buildOptions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Brawny rogue, trickster rogue<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/buildOptions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classFeatures<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>First Strike, Rogue Tactics, Rogue Weapon Talent, Sneak Attack<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classFeatures<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modifierSetName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>class.rogue<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modifierSetName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Or:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;power<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Positioning Strike<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;macroName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>P_E_Positioning_Strike<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/macroName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;level<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/level<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Rogue<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;flavor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>A false stumble and a shove place the enemy exactly where you want him.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/flavor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Encounter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;keywords<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Martial, Weapon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/keywords<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Standard<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attackTypeAndRange<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>'Melee weapon'<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/attackTypeAndRange<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;requirementsMet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>root.currentWeapon.melee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/requirementsMet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>One creature<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attack<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>'Dexterity'<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/attack<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attackModifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>root.dex.currentMod<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/attackModifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defense<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Will<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/defense<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1[W] + Dexterity damage, and you slide the <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hitWeaponDamageMultiplier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hitWeaponDamageMultiplier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hitDamageModifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>root.dex.currentMod<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hitDamageModifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/power<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>See anything mentioning paragon paths?  What archetypes change the effect (I think that one is Artful Dodger)?  Neither do I.  I&#8217;m doing to end up having to convert the PDFs to HTML and parse those anyway (though not for much, I don&#8217;t think).  Yay.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theprodigalboyfriend.com/2009/01/30/dammit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
