<?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>Beyond Abstraction &#187; Software</title>
	<atom:link href="http://beyondabstraction.net/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://beyondabstraction.net</link>
	<description>Meanderings and Such...</description>
	<lastBuildDate>Thu, 22 Dec 2011 14:29:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Entourage Apple Script for Moving IMAP Mail</title>
		<link>http://beyondabstraction.net/2009/08/16/entourage-apple-script-for-moving-imap-mail/</link>
		<comments>http://beyondabstraction.net/2009/08/16/entourage-apple-script-for-moving-imap-mail/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 16:53:04 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[gtd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=380</guid>
		<description><![CDATA[In my last post I described a VB Script for moving IMAP email from my inbox to an archive folder. As an interesting Apples to Oranges (or Apple to Microsoft?) comparison here is the Apple Script I use with Entourage to perform the same task. I will post two versions: one that performs the exact &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2009/08/16/entourage-apple-script-for-moving-imap-mail/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://beyondabstraction.net/2009/08/14/outlook-vb-macro-for-moving-mail/">In my last post I described a VB Script for moving IMAP email from my inbox to an archive folder.</a>  As an interesting Apples to Oranges (or Apple to Microsoft?) comparison here is the Apple Script I use with Entourage to perform the same task.  I will post two versions: one that performs the exact same task and a second version that is significantly longer that integrates with the popular Growl notification system for OS X.  I would just like to highlight the overall simplicity  and elegance of the Apple Script vs. the VB script.  Yes I know their history is totally different and perhaps VB script is overloaded in usage these days but the point stands: the Apple Script is readable and intuitive while the VB script is neither.</p>
<p>Once again I apologize for the formatting but WordPress is butchering &lt;code&gt; posts lately and insert all sorts of uglies inside the code blocks and I don&#8217;t feel like fixing it at the moment.</p>
<blockquote><p>
tell application &#8220;Microsoft Entourage&#8221;<br />
	set acctName to &#8220;BA&#8221;<br />
	set folderName to &#8220;Archives&#8221;<br />
	set destFolder to null</p>
<p>	set currMsgs to (current messages)<br />
	set currCount to (count of currMsgs)</p>
<p>	if currCount is not 0 then<br />
		set folderList to folders of IMAP account acctName<br />
		repeat with x in folderList<br />
			if name of x is folderName then<br />
				set destFolder to x<br />
				move currMsgs to x<br />
			end if<br />
		end repeat<br />
	end if<br />
end tell
</p></blockquote>
<p>And the second with Growl support:</p>
<blockquote>
<p>	tell application &#8220;GrowlHelperApp&#8221;<br />
		set the allNotificationsList to {&#8220;General&#8221;, &#8220;Move message&#8221;, &#8220;Error&#8221;}<br />
		set the enabledNotificationsList to {&#8220;General&#8221;, &#8220;Move message&#8221;, &#8220;Error&#8221;}</p>
<p>		register as application &#8220;Entourage AppleScripts&#8221; all notifications allNotificationsList default notifications enabledNotificationsList icon of application &#8220;Microsoft Entourage&#8221;</p>
<p>		if currCount is 0 then<br />
			notify with name &#8220;Error&#8221; title &#8220;Entourage Error&#8221; description &#8220;You attempted to move a message but no message was selected.&#8221; application name &#8220;Entourage AppleScripts&#8221;<br />
			delay 10<br />
			return<br />
		end if<br />
		if destFolder is null then<br />
			notify with name &#8220;Error&#8221; title &#8220;Entourage Error&#8221; description (&#8220;You attempted to move a message but the destination folder \&#8221;" &#038; folderName &#038; &#8220;\&#8221; is not valid.&#8221;) application name &#8220;Entourage AppleScripts&#8221;<br />
			delay 10<br />
			return<br />
		end if</p>
<p>		&#8211;	1 Notification&#8230;<br />
		if currCount is 1 then<br />
			notify with name &#8220;General&#8221; title (acctName &#038; &#8221; Notification&#8221;) description (&#8220;1 message moved to \&#8221;" &#038; name of destFolder &#038; &#8220;\&#8221; folder of account \&#8221;" &#038; acctName &#038; &#8220;\&#8221;") application name &#8220;Entourage AppleScripts&#8221;<br />
			delay 10<br />
		end if</p>
<p>		&#8211;	Multi Notification&#8230;<br />
		if currCount > 1 then<br />
			notify with name &#8220;General&#8221; title (acctName &#038; &#8221; Notification&#8221;) description (&#8220;&#8221; &#038; (count of currMsgs) &#038; &#8221; messages moved to \&#8221;" &#038; name of destFolder &#038; &#8220;\&#8221; folder of account \&#8221;" &#038; acctName &#038; &#8220;\&#8221;") application name &#8220;Entourage AppleScripts&#8221;<br />
			delay 10<br />
		end if<br />
end tell
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2009/08/16/entourage-apple-script-for-moving-imap-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling file access time updates using noatime in OS X</title>
		<link>http://beyondabstraction.net/2008/11/06/noatime-mount-option-in-os-x/</link>
		<comments>http://beyondabstraction.net/2008/11/06/noatime-mount-option-in-os-x/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 19:23:44 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tipsntricks]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=225</guid>
		<description><![CDATA[The past few days people in Linux blogosphere have been bringing back up the noatime/nodiratime mount options. These options disable the updating of file and directory access times. On many standard systems when you read file a &#8220;last read,&#8221; or access time, timestamp is written to disk. Disabling the writing of access times can provide &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/11/06/noatime-mount-option-in-os-x/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>The past few days people in Linux blogosphere have been bringing back up the noatime/nodiratime mount options.  These options disable the updating of file and directory access times.  On many standard systems when you read file a &#8220;last read,&#8221; or access time, timestamp is written to disk. Disabling the writing of access times can provide performance increases in some conditions.  Probably in a lot of conditions.  Disabling the writing of these access times can be accomplished with the noatime and nodiratime mount options on a typical FS on a Linux system.  Well in OS X and hfs+ nodiratime doesn&#8217;t exist but noatime does.  </p>
<p>These options are old news to some.  I had used them in Linux in the past &#8211; heck I think it was even in the standard Gentoo install docs &#8211; but I had never them a second thought since I moved to OS X.  If you know me personally you know I can&#8217;t leave something untweaked.  And those recent discussions got me to thinking&#8230;</p>
<p>Be forewarned, I haven&#8217;t gone to great lengths to explain the concepts of the notes below so if you&#8217;ve never seen a terminal this isn&#8217;t going to be comprehendible.</p>
<p>I wanted to mount my filesystems with the noatime option in OS X to disable the updates to access times for files.  Problem is that, at least in 10.5, OS X no longer honors /etc/fstab for system disks, only for automount disks.  </p>
<p>After wrestling with it for awhile I gave upon trying to find a location where I could specify mount options for system disks.  I decided to just remount the disk later with the correct options.  I created a StartupItem entry to remount the disk.  I created a directory:</p>
<blockquote><p>
# mkdir /Library/StartupItems/spencer_boot
</p></blockquote>
<p>Then I created the StartupItem plist. Pretty straight forward.</p>
<blockquote><p>
# cat /Library/StartupItems/\<br />
spencer_boot/StartupParameters.plist</p>
<blockquote><p>
{<br />
  Description = &#8220;Spencer&#8217;s Boot Script&#8221;;<br />
  Provides = (&#8220;spencer_boot&#8221;);<br />
  OrderPreference = &#8220;None&#8221;;<br />
  Messages =<br />
  {<br />
    start = &#8220;Starting Spencer&#8217;s Boot Script&#8221;;<br />
    stop = &#8220;Stoping Spencer&#8217;s Boot Script&#8221;;<br />
    restart = &#8220;Restarting Spencer&#8217;s Boot Script&#8221;;<br />
  };<br />
}
</p></blockquote>
</blockquote>
<p>Now I needed the shell script that would be run on boot.</p>
<blockquote><p>
# cat /Library/StartupItems/spencer_boot/spencer_boot </p>
<blockquote><p>
#!/bin/sh</p>
<p>. /etc/rc.common</p>
<p>case &#8220;$1&#8243; in<br />
  start)</p>
<p>    ConsoleMessage &#8220;Starting Spencer Boot: remounting root fs noatime&#8221;<br />
    mount_hfs -o noatime /dev/disk0s2 /</p>
<p>    ;;<br />
esac</p>
<p>exit 0
</p></blockquote>
</blockquote>
<p>This solved the problem for the root fs but I also use Filevault.  If you don&#8217;t use Filevault you can stop reading here.  How would I go about this?  Same problem as before, no where to add mount time options.  Additionally the fs is mounted upon login, not boot.  So our previous method of creating a StartupItem won&#8217;t work.  We&#8217;re going to have to do it later after it has been mounted &#8211; again.  </p>
<blockquote><p><strong>&lt;redacted&gt;</strong> I did have some other information here but after review I wasn&#8217;t happy with advocating the &#8220;hack&#8221; I&#8217;m using.  But the gist of it is to run something like this: <code>/sbin/mount  -u -o noatime,nosuid,nodev /dev/disk1s2 /Users/spencer/</code> after the volume is mounted.  This happens after you enter your password.  So a good place would be login items if you can figure out how to run mount as root from a user&#8217;s startup scripts.<strong>&lt;/redacted&gt;</strong></p></blockquote>
<p>After you login and the system has completely finished running your startup apps open a terminal and type &#8220;mount&#8221;.  You should see &#8220;noatime&#8221; listed as a mount option for you system and Filevault disks.</p>
<p><a href="http://beyondabstraction.net/wp-content/uploads.hidden/2008/11/spencer_boot.sh" title="noatime OS X StartupItem script">spencer_boot shell script</a><br />
<a href="http://beyondabstraction.net/wp-content/uploads.hidden/2008/11/startupparameters.plist" title="noatime OS X StartItems StartupParameters.plist">StartupParameters.plist for the spencer_boot StartupItem</a><br />
<a href="http://beyondabstraction.net/wp-content/uploads.hidden/2008/11/remount_filevault.c" title="noatime Filevault remounter">remount_filevault for noatime in Filevault volumes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/11/06/noatime-mount-option-in-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My favorite shell completion of all time&#8230;</title>
		<link>http://beyondabstraction.net/2008/10/21/my-favorite-shell-completion-of-all-time/</link>
		<comments>http://beyondabstraction.net/2008/10/21/my-favorite-shell-completion-of-all-time/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 22:30:07 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=176</guid>
		<description><![CDATA[My favorite BASH shell completion of all time is hostname completion for all of my favorite commands: SSH_COMPLETE=( $(cat ~/.ssh/known_hosts &#124; \ cut -f 1 -d &#8216; &#8216; &#124; \ sed -e s/,.*//g &#124; \ uniq &#124; \ egrep -v [0123456789]) ) complete -o default -W &#8220;${SSH_COMPLETE[*]}&#8221; ssh scp sftp rsync nmap traceroute ping nslookup &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/10/21/my-favorite-shell-completion-of-all-time/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>My favorite BASH shell completion of all time is hostname completion for all of my favorite commands:</p>
<blockquote><p>SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \<br />
                 cut -f 1 -d &#8216; &#8216; | \<br />
                 sed -e s/,.*//g | \<br />
                 uniq | \<br />
                 egrep -v [0123456789]) )</p>
<p>complete -o default -W &#8220;${SSH_COMPLETE[*]}&#8221; ssh scp sftp rsync nmap traceroute ping nslookup dig host nmap nc</p></blockquote>
<p>I find most of the hosts I ssh into I use for basic network diagnostics.  So performing completion  for traceroute, ping, etc based on the contents of known_hosts works great.  Just add it to your .bashrc.</p>
<p><strong>Update: 2008/11/04</strong> </p>
<p>I&#8217;ve modified it to support completion of SVN commands leveraging the hostnames expanded during the SSH completion above:</p>
<blockquote><p><code>SVN_COMPLETE=( $(svn -h|grep -e '^   '|awk '{ print $1; }') $SSH_COMPLETE )<br />
complete -o default -W "${SVN_COMPLETE[*]} ${SSH_COMPLETE[*]}" svn</code></p></blockquote>
<p>Adding these may lengthen your shell exec tasks.  </p>
<p>I test at work. I work from home.  But I will not test from home.  Fix it yourself. (trademark pending).</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/10/21/my-favorite-shell-completion-of-all-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Red Hat RHN SSL certificate verification error</title>
		<link>http://beyondabstraction.net/2008/10/02/red-hat-rhn-ssl-certificate-verification-error/</link>
		<comments>http://beyondabstraction.net/2008/10/02/red-hat-rhn-ssl-certificate-verification-error/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 18:45:01 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=121</guid>
		<description><![CDATA[I was trying to connect to RHN from Yum/up2date in Red Hat Enterprise Linux 5. I kept getting fatal invalid SSL cert errors. The strange part &#8211; out of all of the machines I tested it was only occuring on a single RHEL 5 laptop. The really strange part &#8211; it was happening on the &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/10/02/red-hat-rhn-ssl-certificate-verification-error/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I was trying to connect to RHN from Yum/up2date in Red Hat Enterprise Linux 5.  I kept getting fatal invalid SSL cert errors.  The strange part &#8211; out of all of the machines I tested it was only occuring on a single RHEL 5 laptop.   The really strange part &#8211; it was happening on the host as well as inside a guest in a VM running in VMware Player.  </p>
<p>If you get this:</p>
<blockquote><p><code><br />
[root@rhel5-vm ~]# yum search openoffice<br />
Loading "rhnplugin" plugin<br />
Loading "installonlyn" plugin<br />
Traceback (most recent call last):<br />
  File "/usr/bin/yum", line 29, in ?<br />
    yummain.main(sys.argv[1:])<br />
  File "/usr/share/yum-cli/yummain.py", line 85, in main<br />
    base.getOptionsConfig(args)<br />
  File "/usr/share/yum-cli/cli.py", line 199, in getOptionsConfig<br />
    errorlevel=opts.errorlevel)<br />
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 134, in doConfigSetup<br />
    self.plugins.run('init')<br />
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 153, in run<br />
    func(conduitcls(self, self.base, conf, **kwargs))<br />
  File "/usr/lib/yum-plugins/rhnplugin.py", line 88, in init_hook<br />
    login_info = up2dateAuth.getLoginInfo()<br />
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 139, in getLoginInfo<br />
    login()<br />
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 98, in login<br />
    li = server.up2date.login(systemId)<br />
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 64, in __call__<br />
    raise up2dateErrors.SSLCertificateVerifyFailedError()<br />
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.<br />
</code></p></blockquote>
<p>Check the date/time on the machine.  Mine was a VM syncing w/ a host clock with a bad CMOS battery.  Caused it to think it was 2005 and the cert wasn&#8217;t valid yet.  Also explains why it happened in both host and guest.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/10/02/red-hat-rhn-ssl-certificate-verification-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Deleting All Messages in Exchange OWA</title>
		<link>http://beyondabstraction.net/2008/10/02/deleting-all-messages-in-exchange-owa/</link>
		<comments>http://beyondabstraction.net/2008/10/02/deleting-all-messages-in-exchange-owa/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 15:05:45 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=119</guid>
		<description><![CDATA[Ran into a problem with Exchange. I created a server-side rule to place spam messages in a folder that didn&#8217;t exist. All spam was instead going to the root folder, the folder above my inbox. Well if you use Entourage to access Exchange you will not be able to access this folder. If you go &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/10/02/deleting-all-messages-in-exchange-owa/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Ran into a problem with Exchange.  I created a server-side rule to place spam messages in a folder that didn&#8217;t exist.  All spam was instead going to the root folder, the folder above my inbox.  Well if you use Entourage to access Exchange you will not be able to access this folder.  If you go into Outlook Web Access (OWA) you can navigate to the root user folder by clicking on &#8220;Folders&#8221;.  </p>
<p>Unfortunately by this point I had like thousands and thousands of messages.  There is no &#8220;Delete All&#8221; option in OWA.  Craptacular.  So moving on I mounted the server via WebDAV in finder (cmd+k).  The URL to mount will look something like:<br />
<code>http://exchange.servername.com/exchange/username</code></p>
<p>If this folder is large navigating to it in Finder will be a horrific experience.  Open Terminal.app and navigate to the mountpoint.</p>
<p><code>~/> cd /Volumes/username</code></p>
<p>Once again, if the folder is large <code>rm *.EML</code> will not work as the wildcard expansion done by bash will exceed the length of the command-line itself (32K by default IIRC).  Try this:</p>
<p><code><br />
/Volumes/username> SRC=./*.EML<br />
/Volumes/username> for i in $SRC; do rm "$i"; done<br />
</code></p>
<p>This will cleanup most, if not all, of the mess.  Some files will not be removed due to escape characters and escaped escaped characters etc.  Open the folder in Finder and delete the rest.  There are def. more elegant ways to handle this from a scripting standpoint but this was quick and worked.  </p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/10/02/deleting-all-messages-in-exchange-owa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgraded WordPress (again)</title>
		<link>http://beyondabstraction.net/2008/04/12/upgraded-wordpress-again/</link>
		<comments>http://beyondabstraction.net/2008/04/12/upgraded-wordpress-again/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 15:38:20 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/?p=116</guid>
		<description><![CDATA[Just finished updating WordPress to 2.5 from 2.3.3. Ran into a few problems. Normally I diff the old version of WP to the new version and just apply the generated patch to my &#8220;custom&#8221; install. Somewhere along the line I must have deleted extraneous files like license.txt because the patch failed to apply because some &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/04/12/upgraded-wordpress-again/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Just finished updating WordPress to 2.5 from 2.3.3.  Ran into a few problems.  Normally I diff the old version of WP to the new version and just apply the generated patch to my &#8220;custom&#8221; install.  Somewhere along the line I must have deleted extraneous files like license.txt because the patch failed to apply because some files listed in the diff didn&#8217;t exist in the directory I was applying it to&#8230; this is the first time this method of non-destructively updating WordPress had failed me.  I could have edited the patch by hand but it was 100K lines so I wasn&#8217;t particularly interested in this method.</p>
<p>So I finally ended up actually following the upgrade instructions, deleted wp-admin and wp-includes, and copied all the files from 2.5 into my existing install.  The database update took about 1 second to complete.  The upgrade was technically complete at this point but of course it wreaked havoc with my theme.  </p>
<p>One thing about the WordPress theme architecture is that if a failure occurs in a custom theme it kinda falls back to the default theme, this is due to CSS I guess.  Problems with a theme, like my Binary Blue bastardization, also show up in the strangest ways.  </p>
<p>For example, my last.fm plugin&#8217;s cache directory got blown away.  The plugin could no longer find the image cache and was throwing a (fatal?) error to Apache&#8217;s logs.  The site was being styled by what looked like a combination of the default classic and my own customized Binary Blue theme.  What I do to fix this is an utter hack, I move the default theme out of the way and symlink the directory of my theme to wp-content/themes/default.  Then when things go wrong it is still pulling from my theme.  Then I go back and fix the actual problem.  </p>
<p>The upgrade is complete.  It took me about 30 minutes to migrate total.  But I am more concerned about &#8220;corner cases&#8221; this time since my traditional method of just merging in the diff between releases failed.  I also haven&#8217;t stress tested all of the widgets and plugins.  Overall I would suggest upgrading.  The experience was worse than usual, but not terrible.  </p>
<p>I just noticed when writing this post that the &#8220;Preview this Post&#8221; feature in WP 2.5 must pull from the auto-saved draft.  When I click preview I don&#8217;t see the content that hasn&#8217;t been saved yet.  Small potatoes, remind me to open a bug.</p>
<p>Update (4 hours later): I figured out why my theme was getting butchered into some combination of the default and my own &#8211; I had some absolute URLs in my header.php where I forgot to use the template path variables. </p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/04/12/upgraded-wordpress-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Migration</title>
		<link>http://beyondabstraction.net/2008/03/08/server-migration/</link>
		<comments>http://beyondabstraction.net/2008/03/08/server-migration/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 19:16:33 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[brickwall]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2008/03/08/server-migration/</guid>
		<description><![CDATA[It&#8217;s been three years since we upgraded the hardware that hosts our various sites. I contacted my provider (Crucial Paradigm) and got some competitive offers. Stefan, my friend in Berlin that I split the server with, and I agreed on the following specs: Athlon 64 x2 4000 (2 cores @ 2.1GHz, 512K L2 each) 4GB &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/03/08/server-migration/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been <a href="http://beyondabstraction.net/2005/03/03/new-server-and-the-seframework/" title="Old, New Hardware">three years since we upgraded the hardware</a> that hosts our various sites.  I contacted my provider (Crucial Paradigm) and got some competitive offers. Stefan, my friend in Berlin that I split the server with, and I agreed on the following specs:</p>
<ul>
<li>Athlon 64 x2 4000 (2 cores @ 2.1GHz, 512K L2 each)</li>
<li>4GB RAM, 160GB SATA, 100Mbps</li>
<li><a href="http://www.centos.org">CentOS 5</a></li>
<li>Apache, BIND, MySQL, Postifx, Spam Assassin, ClamAV, Cyrus IMAP</li>
<li>SELinux enforcing</li>
</ul>
<p>Once again this is going to be a dedicated, remote, hosted server.  A few days later and they contacted me with the login information.  I&#8217;m going to describe the move from a high-level.  I&#8217;m not going to go through the individual config file modifications or how to dump a Cyrus database.</p>
<p><span id="more-113"></span></p>
<p>It only took me about a day to prep the new system for the move.  Stefan was gone for a week so I could move pretty much all of my stuff but I would wait until he got back to move the shared mail services.  It is rather difficult to incrementally move users from one system to another using Cyrus so I just did a test migration of the IMAP spools and databases but waited on actually updating the DNS MX records.  </p>
<p>First I updated the glue records and name servers at my registrar.  I made the new system master and the old system I just modified to run as a slave.  I also had Josh fix his config since he is my DNS buddy (I highly recommend using the DNS buddy system).  With DNS up and running I added entries for the new server.</p>
<p>Then I moved my website.  I just dumped my databases and pulled them into the new system.  A few Apache tweaks and everything was good to go.  I was pulling my hair out at one point trying to figure out why the CentOS default page was appearing but I finally tracked it down to a welcome.conf configuration file.  I removed that and found I could debug Apache config problems more easily.</p>
<p>I decided to tackle all of the SSL stuff at once.  I setup Apache, Cyrus, and Postfix w/ certs and CAs.  I tested each service to ensure I had the directory permissions correct and had the authentication mechanisms properly configured.  It is at this point that I tested a Cyrus migration knowing that I would be repeating the process again later.  </p>
<p>Then I moved on to configuring the rest of the Postfix chain using Amavis, Spam Assassin, and ClamAV.  There was plenty of documentation on this process available online.  Note that ClamAV (and maybe a few of the others) are only available in the rpmforge yum repos.  These programs aren&#8217;t officially part of the CentOS/RHEL distributions but are commonly used by the user communities.  As a result their configuration files don&#8217;t mesh precisely with the rest of the services, for example storing the virus database in /var/clamav by default instead of /var/lib/clamav.  I fixed these discrepancies and would recommend you do the same.  It did take me a while to track all of these down.  freshclam (the ClamAV updater) was running from a Cron job.  It was trying to write to &#8220;/var/clamav&#8221; which didn&#8217;t exist.  As a result the virus signatures weren&#8217;t updating.  I discovered this only through reviewing the logs.</p>
<p>As soon as Stefan got back he moved all of his services and data.  Finally we cut the mail over to the new system by fixing the MX records and using the Postfix transport map feature on the old system to force it to relay to the new server.  That completed the migration.</p>
<p><strong>SELinux</strong><br />
Upon login I discovered SELinux was disabled despite my specific request that it be enabled.  I decided to fix it by hand instead of letting Brickwall fix it automatically to show that going from disabled to permissive to enforcing isn&#8217;t bad and shouldn&#8217;t be scary.  It should be done regardless of the presence of a management tool like Brickwall.  I changed the flag in <code>/etc/selinux/config</code> to enforcing and ran <code># touch /.autorelabel</code>.  </p>
<p>I also added <code>enforcing=0</code> to the ends of the kernel command lines in <code>/boot/grub/menu.lst</code>.  </p>
<blockquote><p>Tangent &#8211; I chose this route, modifying the grub file, for going into permissive mode during configuration and testing instead of setting the flag in <code>/etc/selinux/config</code> to permissive.  Applications, such as those built into Red Hat and CentOS as well as third party applications like Brickwall, modify the settings in <code>/etc/selinux/config</code>.  It is possible for me to inadvertently set the system to boot into enforcing before I am ready using these applications.  Since this is a remote server and the configuration is in flux I want to make sure a quick remote reboot request gets me back in to my system.  It is the exact same as using iptables remotely; you don&#8217;t load the firewall rules automatically on boot until you&#8217;re sure you can get back in through SSH.  As soon as I&#8217;m confident that I typed in the SSH network settings properly the system boots into enforcing mode.</p></blockquote>
<p>After setup is complete remember to remove the kernel command line flag &#8211; always going into permissive mode on reboot, much like not auto-loading firewall rules, is a patentable bad idea on a production system.</p>
<p>I disabled all unnecessary services (everything except SSH at this point) and rebooted.  The system relabeled and came up in permissive mode.   Everything was working fine and running in the proper SELinux domains according to <code># ps axZ</code>.  I ran <code># setenforce 1</code> to go into enforcing mode for the first time.  </p>
<p>Nothing bad happened.  The world didn&#8217;t end.  The system didn&#8217;t stop responding.  I&#8217;m also assuming the rampant rumor that <a href="http://twitter.com/UnquietMind/statuses/723260632" title="SELinux Kills">SELinux kills Giraffes in enforcing mode</a> is false because I watched the news and saw nothing Giraffe related.  This SELinux stuff really isn&#8217;t as hard, or as mean as people make it sound.  BTW Brickwall would have taken care of all of this editing of SELinux config files and relabeling stuff for me if I wasn&#8217;t such a control freak.</p>
<p>Well turning it on is one thing.  Really using it is a whole &#8216;nother thing right?  That is where Brickwall comes into play (disclaimer [1]).  I mentioned it before but think &#8220;SELinux Management&#8221; and there are free versions for Fedora and demos for RHEL and CentOS.  Because I&#8217;m cool I get to use the Enterprise Edition.  Mere mortals may have to run Professional or Standard via &#8220;ssh -X&#8221;.  There is no difference in configurability.  Both use the same configuration GUI.  The only policy difference is the policy for the remote daemon &#8211; not really needed if the remote enterprise management daemon isn&#8217;t installed.  One has centralized/remote management, the other does not. </p>
<p>Brickwall Enterprise Edition has two components, the centralized manager application with configuration editor and the remote daemon.  The centralized management application takes different plug-ins &#8211; I&#8217;m only going to be using Brickwall plug-in that supports general SELinux configuration.  I installed the Enterprise Manager with the Brickwall Enterprise component on my desktop RHEL 5 system.  This installation process generated the remote daemon RPMs for me.  These packages include SSL keys tying the remote daemon to this specific Enterprise Manager install.  The SSL keys are used to encrypt the network traffic between the manager and the client daemons.</p>
<p>I installed the remote daemon on the new system.  It is just a little daemon that facilitates remote management of SELinux policy.  I added one of the IPs of this system to a group in my Enterprise Manager.  The system had to be &#8220;activated&#8221; which means Brickwall had to switch from the standard targeted policy to a Brickwall policy.  There aren&#8217;t really any functional differences between the two policies &#8211; a default Brickwall policy is semantically equivalent to a targeted policy as shipped by Red Hat/CentOS.  But the Brickwall policy contains the structure we need in-place to customize the policy later.</p>
<p>Continuing w/ Brickwall I started restricting network settings for the services I would be running (listed above).  I restricted things like the spam, virus, mysql, and other mail filtering services to local host only.  I restricted service ports to meet my requirements.  I applied the configuration changes and rebooted and went into enforcing to verify services came up in the proper domain after a reboot.</p>
<p>All of the SELinux domain names show exactly what processes they target so run`ps axZ`.  All of you key services should be running as &#8220;*:*:servicename_t&#8221;, such as &#8220;mysqld_t&#8221; or &#8220;httpd_t&#8221; or &#8220;postfix_smtp_t&#8221;.  </p>
<p>The only thing that should be &#8220;unconfined_t&#8221; is user processes or custom services that aren&#8217;t targeted by SELinux.  Note that there are some 200 odd applications or services covered by SELinux so there is a good chance your &#8220;custom service&#8221; is covered.</p>
<p>[1] Disclaimer: I work for the company that makes Brickwall.  Since I&#8217;m only an amateur blogger (not commerically endorsed, still eligible for the Bloglympics) and since this doesn&#8217;t appear on tresys.com I&#8217;m not going to be writing a review or praise the software, I&#8217;m just going to run through using it to batten down the hatches on my system.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/03/08/server-migration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The &#8220;P&#8221; in PIM is for Collaboration (part 1)</title>
		<link>http://beyondabstraction.net/2007/12/21/the-p-in-pim-is-for-collaboration-part-1/</link>
		<comments>http://beyondabstraction.net/2007/12/21/the-p-in-pim-is-for-collaboration-part-1/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 06:02:39 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[gtd]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/12/21/the-p-in-pim-is-for-collaboration-part-1/</guid>
		<description><![CDATA[I recently decided that the tried and trusted [1] personal information management tool I had been using, a G5 pen and a Levenger Circa, wasn&#8217;t doing much to manage the information on my computer. In actuality I had the paper notebook, Entourage, iPhoto, folder structures, del.icio.us, etc to manage all my information. For awhile I &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/12/21/the-p-in-pim-is-for-collaboration-part-1/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I recently decided that the tried and trusted <a href="#footnote_1">[1]</a> <em>personal</em> information management tool I had been using, a G5 pen and a Levenger Circa, wasn&#8217;t doing much to manage the information on my computer.  In actuality I had the paper notebook, Entourage, iPhoto, folder structures, del.icio.us, etc to manage all my information.  For awhile I thought this system rocked.  Then I thought it was missing something.  Then I thought it sucked.  Then I knew it sucked.  Then I thought about how all this information was like disconnected graphs.  Then I wanted to kill my discrete math professor.  It was time to do something about this mess.  Someone had to be connecting the disparate information centers in life.  The exploration of <em>personal</em> information management started anew.  </p>
<p><span id="more-95"></span></p>
<p>I hate Entourage <a href="#footnote_2">[2]</a> so that was out, kGTD was great but a little to &#8220;hacky&#8221;, so after looking over the options I settled on the combo of Omnifocus (aka the kGTD on crack) and Yojimbo.  I can capture notes, passwords, serials, web page archives, bookmarks blah blah blah in Yojimbo.  A few scripts helped any bookmarking I do get sent to del.icio.us, Pukka, and Yojimbo as both a bookmark and a web archive.  Omnifocus handles organization of everything that doesn&#8217;t already reside on a computer mainly my GTD lists.    I&#8217;ve been using this combination for <em>personal</em> information management for about a week and it is pretty solid.  I have nothing but praise for both applications.</p>
<p><a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-2.png' title='Yojimbo' rel="lightbox"><img class="centered" src='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-2.thumbnail.png' alt='Yojimbo' /></a><br />
<br/><br />
<a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-3.png' title='Omnifocus' rel="lightbox"><img class="centered" src='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-3.thumbnail.png' alt='Omnifocus' /></a></p>
<p>During these phases where I&#8217;m restructuring my <em>personal</em> information and tasks I won&#8217;t become attached for at least a month or so.  This is something that really has to grow on you.  Spending a few weeks with a tool that impacts so much in your day-to-day life is the least you can do&#8230; during this period you also have to continue exploring your options.  You should be open to supporting multiple systems and even moving management systems during this period.  Yes using multiple systems or switching systems sucks.  Just be happy you have more than one fucking system to choose from and quit your bitchin.  Seriously, stop.</p>
<p>OK so I bitched a little inside and bottled up the frustration to let out at a later, yet to be announced date.  Now today I read about this new <a href="http://chandlerproject.org/features" title="Chandler Project">Chandler</a> application.  Completely open source, runs on Linux, OS X (including Leopard), and Windows.  It also has a standalone Tomcat app that can be used for synchronization and provides a bad-ass AJAX <a href="#footnote_3">[3]</a> web interface.  </p>
<p>Some may have heard of this project before.  It is a rare breed in that seems to have followed some type of development process. Haven&#8217;t read <a href="http://www.amazon.com/exec/obidos/ASIN/1400082463/" title="Scott Rosenburg's Dreaming in Code">the book</a>&#8230;. yet.</p>
<p><a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-4.png' title='Chandlerâ€™s IMAP Folders' rel="lightbox"><img class="centered" src='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-4.thumbnail.png' alt='Chandlerâ€™s IMAP Folders' /></a><br />
<br/><br />
Finally, it has a bit of integration with ordinary IMAP servers; it creates special folders that you can move content into from any other email application.  </p>
<p><a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-1.png' title='Chandler IMAP Meeting Request' rel="lightbox"><img class="centered" src='http://beyondabstraction.net/wp-content/uploads.hidden/2007/12/picture-1.thumbnail.png' alt='Chandler IMAP Meeting Request' /></a></p>
<p>You can then operate on this content using the normal management techniques supported by Chandler (GTD). For example, I sent myself an email with the simple subject line &#8220;meeting on january 2nd at 10am with ken&#8221;.  When it popped up in my Entourage inbox I simply moved it to the &#8220;Chandler Events&#8221; folder.  Back in the Hall of Justice (Chandler) I forced a sync.  This grabbed my email and immediately realized I wanted to create a meeting on January 2nd.  It leaves the item in your Inbox for processing later, a GTD concept, but the appt is already there.  </p>
<p>But apps and other scripts can do all this.  The part that I&#8217;m really looking forward to, the collaborative information management possibilities.  Chandler can run stand-alone, it can connect to your iMap servers, and it can connect to Chandler servers.  The people at OSAF (the group behind Chandler) have kindly provided us with Chandler hub.  Until I get some friends on I can&#8217;t really test out the features but two things come to mind: porn and chicken.  First, the server is a Tomcat app that provides an ajaxy gooey sweet interface even if you&#8217;re not sharing information with other people.  You sync from your desktop, then you can access the information remotely from anything with a browser.  Mobile browser support is not provided but you might have some luck.  I expect this will be remedied quickly.  </p>
<p>But if you are someone who interacts with other people in any way, perhaps you can take advantage of Chandlers collaborative features.  PIM has just gotten personal&#8230; erh um&#8230; collaborative <a href="#footnote_4">[4]</a>.</p>
<p>I&#8217;ll post a follow-up shortly.  I&#8217;m going to continue using Yojimbo/Omnifocus but will experiment with Chandler and possibly other collaborative tools for the next few weeks.  Like I said, sometimes information management sucks but the benefits are amazing.</p>
<p>Inbox:</p>
<ol>
<li>Fix P is for Collaboration Part 1</li>
<li>Write second article discussing for P is for Collaboration Chandler in more detail.</li>
<li>Add this to my Chandler inbox.</li>
</ol>
<div class="footnote_list">
<div class="footnote" id="footnote_1">
<div class="footnote_id">[1]</div>
<div class="footnote_content">some would say archaic</div>
</div>
<div class="footnote">
<div class="footnote_id" id="footnote_2">[2]</div>
<div class="footnote_content"> I have it on good authority that Entourage was created by Satan himself.</div>
</div>
<div class="footnote">
<div class="footnote_id" id="footnote_3">[3]</div>
<div class="footnote_content">I&#8217;m talking Web 4.0 here people.  As the site name indicates, I think a little ahead of you &#8220;normies&#8221;.</div>
</div>
<div class="footnote">
<div class="footnote_id" id="footnote_4">[4]</div>
<div class="footnote_content">Pure Easy Cheese</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/12/21/the-p-in-pim-is-for-collaboration-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade complete</title>
		<link>http://beyondabstraction.net/2007/11/14/upgrade-complete/</link>
		<comments>http://beyondabstraction.net/2007/11/14/upgrade-complete/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 23:59:35 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/11/14/upgrade-complete/</guid>
		<description><![CDATA[I just finished moving the last of my content into WordPress pages. I got tired of my old theme and decided to give up on integrating WordPress into my existing site. I was spending a significant amount of time just merging in the changes from WordPress releases without clobbering all of my customizations. It had &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/11/14/upgrade-complete/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I just finished moving the last of my content into WordPress pages.  I got tired of my old theme and decided to give up on integrating WordPress into my existing site.  I was spending a significant amount of time just merging in the changes from WordPress releases without clobbering all of my customizations.  It had officially become a pain in my ass.  School, and Projects are now available in the other <a href="http://beyondabstraction.net/stuff/">Other&#8230;</a> section at the top.  I might them up to the top-level but for now they are there.<br />
<span id="more-83"></span><br />
Aside from moving the content and fixing it to adhere to my theme and WordPress&#8217; requirements I had to come up with some magic mod_rewrite rules to redirect the old pages to the new pages including query strings.  I hadn&#8217;t used QUERY_STRING in redirects before so it was a learning experience and quickly reminded of the love/hate relationship I have with mod_rewrite.  Here are the new components:</p>
<pre>RewriteCond %{REQUEST_URI}              ^/wordpress.*$ [NC]
RewriteRule wordpress/(.*)            http://beyondabstraction.net/$1 [R=301,L]

# legacy url rewriting
RewriteCond %{REQUEST_URI}              ^/school.php$ [NC]
RewriteRule ^school.php$                http://%{SERVER_NAME}/stuff/school/ [R=301,L]
RewriteCond %{REQUEST_URI}              ^/school-stuff/?$ [NC]
RewriteCond %{QUERY_STRING}             class=([^&#038;;]*)? [NC]
RewriteRule .*                  http://%{SERVER_NAME}/stuff/school/%1/? [R=301,L]

RewriteCond %{REQUEST_URI}              ^/sonyfs660/?$ [NC]
RewriteRule sonyfs660/?            http://beyondabstraction.net/stuff/vaio-fs660/ [R=301,L]

RewriteCond %{REQUEST_URI}              ^/projects.php.*$ [NC]
RewriteRule projects.php(.*)?            http://beyondabstraction.net/stuff/projects/$1 [R=301,L]
</pre>
<p>Since I&#8217;ve never posted these in their entirety before I&#8217;m attaching my top-level .htaccess and my 403 page <a href="#footnote_1">[1]</a> <a href="#footnote_2">[2]</a>.  The 403 page uses flushes to display content to humans while staying in a loop to waste spammers time.  </p>
<p>I had to add a .htaccess rule to disable output compression on the 403 directory.  This is because I have Apache setup to use mod_deflate to compress the content.  So mod_deflate is buffering output to compress before sending it to the client.  Additionally, PHP is buffering output and the client side browsers are buffering.  PHP is an easy fix via a flush() and ob_flush() call.  Client side buffering is a little more tricky.  Must browsers start displaying content as soon as it can be rendered.  Safari, and perhaps other KHTML/Webkit based browsers, buffer until the first 1K is seen or the connection is closed.  There is some magic in the 403 file to skirt around this problem.</p>
<p>Updated: Forgot to describe the rest of the <a href="#footnote_1">.htaccess</a> file.  Those of you not interested in mod_rewrite should <em>not read</em> on as the boredom may kill you.  Those of you that are interested:</p>
<ol>
<li>Find a new hobby and <em>don&#8217;t</em> read this dribble</li>
<li>Perhaps even move and start a new life</li>
<li>At the very least should get a cup of coffee and a porno to avoid the same boredom related death as the non-interested</li>
</ol>
<p>I&#8217;m going to pretend I didn&#8217;t post that clip from the .htaccess file above and just start over from the beginning.  Please click any of the links below to see a demonstration of the rewrites.</p>
<pre>
# spammers and scanners
Order Allow,Deny
Deny from 69.13.156.208
Deny from 208.57.118.100
Deny from 216.229.143.241
Deny from 12.178.36.25
Deny from 81.95.146.227
Deny from 68.83.37.146
Deny from 80.58.205.34
Allow from all
</pre>
<p>The next section starts the rewrite engine, ensures that the site is only reachable via very certain host names <a href="#footnote_3">[3]</a>.  It also provides a shorthand for my security blog that can easily be written on a matchbook <img src='http://beyondabstraction.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<pre>
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On

# host rewrite rules
RewriteCond %{HTTP_HOST}   !^beyondabstraction\.net [NC]
RewriteCond %{HTTP_HOST}   !^security.beyondabstraction\.net [NC]
RewriteCond %{HTTP_HOST}   !^$ [NC]
RewriteRule ^/(.*)         http://beyondabstraction.net/$1 [R=301,L]

# security sub-blog
RewriteRule ^security/?$ /category/security?title=off [R=301,L]
</pre>
<p>The next chunk is the meat of what I call &#8220;legacy support&#8221;.  These are efforts a maintainer takes to avoid dead links as their site changes.  These were all required when I moved to a pure WordPress site.  Come to think of it, that is how this whole tangent got started.  Oh well, now that you&#8217;re screwed and I&#8217;m stuck finishing&#8230;</p>
<p>The wordpress/ rewrite shows exactly what I mean when I say WordPress was integrated into my site; the rewritten rule shows that WordPress is now the top-level of my site.  For the sake of explanation, lets say WordPress <em>used to be</em> at the second level.  I had other content at the second level such as my school work.  This meant all of that content had to be moved from the second level of my old site, to the second level of my new site inside of WordPress.  These rewrites are the equivalent of setting a forwarding address for snail mail or email.  The hardest one is the rewrite of a query string, a GET request.  The old school pages took the class number as a GET argument to determine which page to display.  I used the QUERY_STRING variable and converted it into a sub-directory. <a href="/school.php?class=cs331">/school.php?class=cs331</a> will now redirect to <a href="/stuff/school/cs331">/stuff/school/cs331</a>.  </p>
<pre>
RewriteCond %{REQUEST_URI}              ^/wordpress.*$ [NC]
RewriteRule wordpress/(.*)            http://beyondabstraction.net/$1 [R=301,L]

# legacy url rewriting
RewriteCond %{REQUEST_URI}              ^/school.php$ [NC]
RewriteRule ^school.php$                http://%{SERVER_NAME}/stuff/school/ [R=301,L]
RewriteCond %{REQUEST_URI}              ^/school-stuff/?$ [NC]
RewriteCond %{QUERY_STRING}             class=([^&#038;;]*)? [NC]
RewriteRule .*                  http://%{SERVER_NAME}/stuff/school/%1/? [R=301,L]

RewriteCond %{REQUEST_URI}              ^/sonyfs660/?$ [NC]
RewriteRule sonyfs660/?            http://beyondabstraction.net/stuff/vaio-fs660/ [R=301,L]

RewriteCond %{REQUEST_URI}              ^/projects.php.*$ [NC]
RewriteRule projects.php(.*)?            http://beyondabstraction.net/stuff/projects/$1 [R=301,L]
</pre>
<p>The final set of rules addresses bandwidth leechers, Ebay image leechers and spam referrers.  The final four lines are used to pass requests for non-existent files and directories onto WordPress as path information.  WordPress then uses this information to generate dynamic pages. </p>
<pre>
# bandwidth leechers
RewriteCond %{HTTP_REFERER} ^https?://.*.ebay.com/.*$
RewriteRule .*\.(gif|GIF|jpg|JPG|png|PNG).*$ - [G,L]

# spammers
RewriteCond %{HTTP_REFERER} poker [OR]
RewriteCond %{HTTP_REFERER} medicine [NC,OR]
RewriteCond %{HTTP_REFERER} pills [NC,OR]
RewriteCond %{HTTP_REFERER} diet [NC,OR]
RewriteCond %{HTTP_REFERER} viagra [NC,OR]
RewriteCond %{HTTP_REFERER} mortgage [NC,OR]
RewriteCond %{HTTP_REFERER} casino [NC,OR]
RewriteCond %{HTTP_REFERER} insurance [NC,OR]
RewriteCond %{HTTP_REFERER} loan [NC,OR]
RewriteCond %{HTTP_REFERER} xanax [NC,OR]
RewriteCond %{HTTP_REFERER} meridia [NC,OR]
RewriteCond %{HTTP_REFERER} incest [NC,OR]
RewriteCond %{HTTP_REFERER} lesbian [NC,OR]
RewriteCond %{HTTP_REFERER} viagra [NC,OR]
RewriteCond %{HTTP_REFERER} adult [NC,OR]
RewriteCond %{HTTP_REFERER} hentai [NC,OR]
RewriteCond %{HTTP_REFERER} tramadol [NC,OR]
RewriteCond %{HTTP_REFERER} phentermine [NC,OR]
RewriteCond %{HTTP_REFERER} gambling [NC,OR]
RewriteCond %{HTTP_REFERER} texas- [NC,OR]
RewriteCond %{HTTP_REFERER} holdem [NC,OR]
RewriteCond %{HTTP_REFERER} pharmacy [NC,OR]
RewriteCond %{HTTP_REFERER} ultram [NC,OR]
RewriteCond %{HTTP_REFERER} levitra [NC,OR]
RewriteCond %{HTTP_REFERER} phentermine [NC,OR]
RewriteCond %{HTTP_REFERER} cialis [NC,OR]
RewriteCond %{HTTP_REFERER} payday [NC,OR]
RewriteCond %{HTTP_REFERER} bargains [NC,OR]

# WARNING: any inserted lines need NC,OR... only the last line should be NC
RewriteCond %{HTTP_REFERER} tramadol [NC]
RewriteRule .* - [F,L]

# pass everything non-file/dir as a parameter to index
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
</pre>
<div class="footnote_list">
<div class="footnote">
<div class="footnote_id" id="footnote_1">[1]</div>
<div class="footnote_content"><a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/11/403.phps' title='403 script'>403 script</a></div>
</div>
<div class="footnote">
<div class="footnote_id" id="footnote_2">[2]</div>
<div class="footnote_content"><a href='http://beyondabstraction.net/wp-content/uploads.hidden/2007/11/htaccess' title='htaccess file'>htaccess file</a></div>
</div>
<div class="footnote">
<div class="footnote_id" id="footnote_3">[3]</div>
<div class="footnote_content">I use this to ensure my site isn&#8217;t reachable via <a href="http://www.beyondabstraction.net">www.beyondabstraction.net</a> or really as a catchall.  As my subdomains come and go this also plays a role in supporting &#8220;legacy&#8221; portions of the site.</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/11/14/upgrade-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

