<?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"
	>

<channel>
	<title>Tech Trivia</title>
	<atom:link href="http://www.alethe.com/brad/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alethe.com/brad</link>
	<description>Just another rarely updated weblog</description>
	<pubDate>Wed, 30 Apr 2008 02:04:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Date format</title>
		<link>http://www.alethe.com/brad/2008/04/date-format/</link>
		<comments>http://www.alethe.com/brad/2008/04/date-format/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 01:57:34 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Ruby and Rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=39</guid>
		<description><![CDATA[Format a date in ruby using the string from time method (strftime).

Format options:
  %a - The abbreviated weekday name (``Sun'')
  %A - The  full  weekday  name (``Sunday'')
  %b - The abbreviated month name (``Jan'')
  %B - The  full  month  name (``January'')
  %c - The [...]]]></description>
			<content:encoded><![CDATA[<p>Format a date in ruby using the string from time method (strftime).</p>
<pre>
Format options:
  %a - The abbreviated weekday name (``Sun'')
  %A - The  full  weekday  name (``Sunday'')
  %b - The abbreviated month name (``Jan'')
  %B - The  full  month  name (``January'')
  %c - The preferred local date and time representation
  %d - Day of the month (01..31)
  %H - Hour of the day, 24-hour clock (00..23)
  %I - Hour of the day, 12-hour clock (01..12)
  %j - Day of the year (001..366)
  %m - Month of the year (01..12)
  %M - Minute of the hour (00..59)
  %p - Meridian indicator (``AM''  or  ``PM'')
  %S - Second of the minute (00..60)
  %U - Week  number  of the current year,
          starting with the first Sunday as the first
          day of the first week (00..53)
  %W - Week  number  of the current year,
          starting with the first Monday as the first
          day of the first week (00..53)
  %w - Day of the week (Sunday is 0, 0..6)
  %x - Preferred representation for the date alone, no time
  %X - Preferred representation for the time alone, no date
  %y - Year without a century (00..99)
  %Y - Year with century
  %Z - Time zone name
  %% - Literal ``%'' character
</pre>
<p><code><br />
   t = Time.now<br />
   t.strftime("Today is %m/%d/%Y")   #=> "Today is 04/29/2008"<br />
   t.strftime("at %I:%M %p")            #=> "at 10:04 PM"<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/date-format/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby on Rails for RHEL 5</title>
		<link>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/</link>
		<comments>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 02:06:49 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ruby and Rails]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[RHEL]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=37</guid>
		<description><![CDATA[Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5 with MySQL.
Using yum install ruby and mysql.  The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be - this is all from memory).

[bm@app3 ~]$ sudo su [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5 with MySQL.</p>
<p>Using <code>yum</code> install ruby and mysql.  The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be - this is all from memory).<br />
<span id="more-37"></span><br />
<code>[bm@app3 ~]$ sudo su -<br />
[root@app3 ~]# yum install ruby ruby-devel ruby-libs ruby-irb \<br />
> ruby-rdoc subversion-ruby mysql-server mysql-devel<br />
[....]</code></p>
<p>Complete the basic configuration of MySQL.<br />
<code>[root@app3 ~]# /sbin/chkconfig mysqld on<br />
[root@app3 ~]# service mysqld start<br />
[root@app3 ~]# mysql_secure_installation<br />
</code></p>
<p><a href="http://rubyforge.org/projects/rubygems/">Download</a> and install RubyGems.  As of the date this post was written, the latest version is 1.1.1.<br />
<code>[root@app3 ~]# wget http://rubyforge.org/frs/download.php/35284/rubygems-1.1.1.zip<br />
[root@app3 ~]# unzip rubygems-1.1.1.zip<br />
[root@app3 ~]# cd rubygems-1.1.1<br />
[root@app3 rubygems-1.1.1]# ruby setup.rb<br />
[root@app3 ~]# cd ..<br />
[root@app3 ~]# rm -rf rubygems-1.1.1<br />
</code></p>
<p>Now install Rails, Mongrel, the Ruby MySQL interface, Capistrano<br />
<code>[root@app3 ~]# gem install rails &#8211;include-dependencies &#8211;no-rdoc &#8211;no-ri<br />
[root@app3 ~]# gem install mongrel &#8211;include-dependencies &#8211;no-rdoc &#8211;no-ri<br />
[root@app3 ~]# gem install mysql &#8212; &#8211;with-mysql-config=/usr/bin/mysql_config<br />
[root@app3 ~]# gem install capistrano &#8211;include-dependencies &#8211;no-rdoc &#8211;no-ri<br />
</code></p>
<p>Phusion&#8217;s <a href="http://modrails.com/">passenger</a> gem provides a &#8220;mod_rails&#8221; module for Apache.  The installation is very straight forward.<br />
<code>[root@app3 ~]# gem install passenger<br />
[root@app3 ~]# passenger-install-apache2-module<br />
</code></p>
<p>Just follow the on-screen instructions to finish the installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reduce database connections using :include</title>
		<link>http://www.alethe.com/brad/2008/04/reduce-database-connections-using-include/</link>
		<comments>http://www.alethe.com/brad/2008/04/reduce-database-connections-using-include/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 01:41:19 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Ruby and Rails]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=36</guid>
		<description><![CDATA[When displaying a list that requires information from several tables in the database, you can sometimes end up with three or more database queries per list row.  Depending on the situation, this may not be a problem.  However, it is possible to join the tables in one large SQL query using the :include [...]]]></description>
			<content:encoded><![CDATA[<p>When displaying a list that requires information from several tables in the database, you can sometimes end up with three or more database queries per list row.  Depending on the situation, this may not be a problem.  However, it is possible to join the tables in one large SQL query using the <code>:include</code> option.</p>
<p><code>@requests = Request.find(:all, :include => [:department, :status])</code></p>
<p>Using the <code>:include</code> option may improve performance.  However, it will likely use more server memory and could potentially return a lot of data through the joins that may not even be used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/reduce-database-connections-using-include/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Move an LVM-based virtual machine to another host</title>
		<link>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/</link>
		<comments>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 03:18:26 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tech Notes]]></category>

		<category><![CDATA[Virtualization]]></category>

		<category><![CDATA[LVM]]></category>

		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=35</guid>
		<description><![CDATA[For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host.  There may be more elegant ways to achieve this, but this is what worked for me.
Environment
Ok, so let&#8217;s set the scene:

vmhost is a RHEL 5 server [...]]]></description>
			<content:encoded><![CDATA[<p>For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host.  There may be more elegant ways to achieve this, but this is what worked for me.</p>
<p><strong>Environment</strong><br />
Ok, so let&#8217;s set the scene:</p>
<ul>
<li><code>vmhost</code> is a RHEL 5 server running several virtual machines using the Xen virtualization technology. Each virtual machine is allocated a 60 GB logical volume within an LVM volume group. One of these virtual machines, &#8220;win2k3vm&#8221;, needs to be moved to a new server.</li>
<li><code>new-vmhost</code> is almost identical to vmhost, but has updated hardware and more memory.  This is the server that &#8220;win2k3vm&#8221; will be moved to.</li>
</ul>
<p><span id="more-35"></span><br />
<strong>Migrate the Virtual Machine</strong><br />
1. Create a snapshot of virtual machine LVM volume.  This can be run on a live virtual machine, but it is probably safer to perform a graceful shutdown of your virtual machine first.</p>
<p><code>[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01</code></p>
<p>2. Export the snapshot of the guest VM to a file that can be moved between physical servers.</p>
<p><code>[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096</code></p>
<p>3. Remove the snapshot LVM volume.</p>
<p><code>[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap</code></p>
<p>4. Copy the file to the new VM host.  Make sure you have sufficient free drive space.</p>
<p><code>[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/</code></p>
<p>5. On the new VM host, create an LVM volume that is at least as big as the guest VM file.</p>
<p><code>[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup</code></p>
<p>6. Transfer the guest VM file to the new LVM volume.</p>
<p><code>[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096</code></p>
<p>7. Copy the VM config file from the old VM host to the new VM host server.</p>
<p><code>[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:</code></p>
<p>8. Copy the file to the appropriate directory.</p>
<p><code>[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/</code></p>
<p><strong>Summary of Commands</strong><br />
<code>[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01<br />
[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096<br />
[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap<br />
[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/<br />
[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup<br />
[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096<br />
[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:<br />
[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install phpMyAdmin</title>
		<link>http://www.alethe.com/brad/2008/02/install-phpmyadmin/</link>
		<comments>http://www.alethe.com/brad/2008/02/install-phpmyadmin/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 03:01:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=38</guid>
		<description><![CDATA[phpMyAdmin is web-based PHP application for managing MySQL databases.  It is fairly easy to install and configure.
Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice.  I prefer to keep the installation outside of the web root and use an apache alias to reference [...]]]></description>
			<content:encoded><![CDATA[<p>phpMyAdmin is web-based PHP application for managing MySQL databases.  It is fairly easy to install and configure.</p>
<p>Download the latest stable version from the <a href="http://www.phpmyadmin.net">phpMyAdmin web site</a>, and extract it to a location of your choice.  I prefer to keep the installation outside of the web root and use an apache alias to reference it.<br />
<span id="more-38"></span><br />
<code>[root@app3 ~]# cd /var/www<br />
[root@app3 ~]# wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
[root@app3 ~]# tar xzf phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
</code><br />
Now that&#8217;s a lengthy directory name!  Let&#8217;s create a link to that directory with a more friendly name.<br />
<code><br />
[root@app3 ~]# ln -s phpMyAdmin-2.11.5.2-all-languages-utf-8-only phpMyAdmin<br />
</code></p>
<p>SELinux may generate a number of errors regarding this new directory that will be referenced by the apache web server.  Let&#8217;s correct the security context of the entire phpMyAdmin directory structure.<br />
<code><br />
[root@app3 ~]# chcon -R -h -t httpd_sys_content_t \<br />
> phpMyAdmin-2.11.5.2-all-languages-utf-8-only<br />
</code></p>
<p>Configure the phpMyAdmin installation to use http authentication.  We&#8217;ll make sure it is secure by forcing SSL encryption using apache directives in a later step.<br />
<code><br />
[root@app3 ~]# cd phpMyAdmin<br />
[root@app3 ~]# cp config.sample.inc.php config.inc.php<br />
[root@app3 ~]# vi config.inc.php<br />
</code></p>
<p>Change the line:<br />
<code>$cfg['Servers'][$i]['auth_type'] = &#8216;cookie&#8217;;</code><br />
to:<br />
<code>$cfg['Servers'][$i]['auth_type'] = &#8216;http&#8217;;</code></p>
<p>Now we need to configure the apache web server.  To keep things modular, create a file <code>phpmyadmin.conf</code> in <code>/etc/httpd/conf.d</code>.  Any configuration directives in this file will automatically be loaded into the main apache configuration when the daemon is restarted.<br />
<code><br />
[root@app3 ~]# vi /etc/httpd/conf.d/phpmyadmin.conf<br />
</code></p>
<p>The <code>phpmyadmin.conf</code> file should contain the following directives.  Just modify the paths to suit your installation.<br />
<code></p>
<pre>
Alias /phpmyadmin /var/www/phpMyAdmin
&lt;Directory "/var/www/phpMyAdmin"&gt;
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    SSLRequireSSL
&lt;/Directory&gt;
</pre>
<p></code></p>
<p>Restart apache and see if your installation works.<br />
<code><br />
[root@app3 ~]# service httpd restart<br />
</code></p>
<p>If there are problems, check your logs.  It is possible that SELinux may be complaining about something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/02/install-phpmyadmin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mount an ISO file</title>
		<link>http://www.alethe.com/brad/2008/01/mount-an-iso-file/</link>
		<comments>http://www.alethe.com/brad/2008/01/mount-an-iso-file/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 14:50:24 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=31</guid>
		<description><![CDATA[You can mount a CD or DVD image in Linux so that it appears like a regularly inserted disc.  Use the following command:
prompt# mount Fedora-8-x86_64-DVD.iso /mnt/isofile/ -o ro,loop=/dev/loop0
Ensure that the /mnt/isofile directory exists before trying to mount the ISO to that location.
]]></description>
			<content:encoded><![CDATA[<p>You can mount a CD or DVD image in Linux so that it appears like a regularly inserted disc.  Use the following command:</p>
<p><code>prompt# mount Fedora-8-x86_64-DVD.iso /mnt/isofile/ -o ro,loop=/dev/loop0</code></p>
<p>Ensure that the /mnt/isofile directory exists before trying to mount the ISO to that location.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/01/mount-an-iso-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VNC over SSH</title>
		<link>http://www.alethe.com/brad/2007/05/vnc-over-ssh/</link>
		<comments>http://www.alethe.com/brad/2007/05/vnc-over-ssh/#comments</comments>
		<pubDate>Sat, 26 May 2007 03:12:32 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Apple OS X]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=34</guid>
		<description><![CDATA[Sometimes it is useful to manage a Linux server remotely using VNC.  A simple and secure method for doing so is to tunnel the VNC connection using Secure Shell.  The following instructions have been tested on Redhat Enterprise Linux 5 AS.
On the server side:
First, we need to ensure the vncserver is actually running. [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is useful to manage a Linux server remotely using VNC.  A simple and secure method for doing so is to tunnel the VNC connection using Secure Shell.  The following instructions have been tested on Redhat Enterprise Linux 5 AS.</p>
<p><strong>On the server side:</strong><br />
First, we need to ensure the vncserver is actually running.  SSH to the server or logon at the console as your regular user account.  No root privileges are necessary.  Once logged in, just type <code>vncserver</code>.  You should see something like this:<br />
<span id="more-34"></span><br />
<code>
<pre>[bm@app3 ~]$ vncserver 

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /home/bm/.Xauthority

New &#8216;app3.domain.com:1 (app3)&#8217; desktop is app3.domain.com:1

Creating default startup script /home/bm/.vnc/xstartup
Starting applications specified in /home/bm/.vnc/xstartup
Log file is /home/bm/.vnc/app3.domain.com:1.log
</pre>
<p></code></p>
<p>If this is the first time you&#8217;ve run the application, you&#8217;ll be prompted to set a password for vnc clients, and it will also create default X Windows session configurations.  You probably don&#8217;t want to use the defaults, so kill the current vnc server instance and edit those files.<br />
<code><br />
[bm@app3 ~] vncserver -kill :1<br />
Killing Xvnc process ID 29181<br />
[bm@app3 ~]$ cat .vnc/xstartup<br />
#!/bin/sh</p>
<p># Uncomment the following two lines for normal desktop:<br />
<strong># unset SESSION_MANAGER<br />
# exec /etc/X11/xinit/xinitrc</strong></p>
<p>[ -x /etc/vnc/xstartup ] &#038;&#038; exec /etc/vnc/xstartup<br />
[ -r $HOME/.Xresources ] &#038;&#038; xrdb $HOME/.Xresources<br />
xsetroot -solid grey<br />
vncconfig -iconic &#038;<br />
xterm -geometry 80&#215;24+10+10 -ls -title &#8220;$VNCDESKTOP Desktop&#8221; &#038;<br />
twm &#038;<br />
</code></p>
<p>Uncomment the lines in bold and then start <code>vncserver</code> again.</p>
<p><strong>On the client side:</strong><br />
Open up a shell window (on your Linux/Mac OS X client) and configure your tunnel to forward the server&#8217;s VNC port (e.g., 5901/tcp) to your localhost.  Please note that the VNC port range starts at 5900 and increases by screen number.  For example, if you are trying to connect to myserver.domain.com:23 (i.e., screen 23), you will need to reference port 5923/tcp.  For the purpose of this article, we&#8217;re assuming there is only one VNC instance running on the server, and the screen number is :1.</p>
<p><code>client:~ user$ ssh remoteserver.domain.com -L 5901/127.0.0.1/5901</code></p>
<p>Now, use your VNC client to connect to localhost:1 or localhost port:5901.</p>
<p>There are several good VNC clients for Mac OS X and Windows, and most distributions of Linux already have VNC installed.</p>
<p><strong>Free VNC Applications:</strong></p>
<ul>
<li><a href="http://www.tightvnc.com/">TightVNC</a>(multi-platform)</li>
<li><a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a>(Mac OS X)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2007/05/vnc-over-ssh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Override Content</title>
		<link>http://www.alethe.com/brad/2006/04/override-content/</link>
		<comments>http://www.alethe.com/brad/2006/04/override-content/#comments</comments>
		<pubDate>Sun, 23 Apr 2006 23:35:27 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Typo3 Snippets]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=18</guid>
		<description><![CDATA[
Recently I was working on a portion of a web site that required dynamic menus.  However, I needed to override those dynamic menus for certain pages in the web site with custom menus.  It is possible to achieve this using typoscript.

The typoscript I created works like this:

If content exists in the left column [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=alethe-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=1904811418&#038;fc1=999&#038;IS2=1&#038;lt1=_blank&#038;lc1=d8d7d3&#038;bc1=22201d&#038;bg1=22201d&#038;f=ifr" style="width:120px;height:240px;float:right;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>Recently I was working on a portion of a web site that required dynamic menus.  However, I needed to override those dynamic menus for certain pages in the web site with custom menus.  It is possible to achieve this using typoscript.<br />
<span id="more-18"></span><br />
The typoscript I created works like this:</p>
<ul>
<li>If content exists in the left column (i.e., styles.content.getLeft), display it</li>
<li>If no content exists, display a dynamic menu listing links to all sub-pages of the current page</li>
</ul>
<p>The whole listing of typoscript in the SETUP section of the template is shown below:</p>
<pre><code>
config.xhtml_cleaning = all
config.prefixLocalAnchors = all
config.intTarget = _self
plugin.tx_automaketemplate_pi1 {
  content = FILE
  content.file = fileadmin/template/infosys/template_root.html
  # Define dynamic portions of html template
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title
    SPAN.class.depth = 1
    SPAN.class.subtitle = 1
    SPAN.class.rightNav = 1
    DIV.id.quickBlock = 1
    DIV.id.menuBlock = 1
    DIV.id.loginBlock = 1
    DIV.id.mainbar = 1
  }

  # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/template/infosys/
}

# Create default navigation menu
temp.menu_1 = HMENU
temp.menu_1.special = directory
temp.menu_1.special.data = global:id
temp.menu_1.1 = TMENU
temp.menu_1.1 {
  # Normal state properties
  NO.stdWrap.htmlSpecialChars = 1

  # Enable active state and set properties:
  ACT = 1
  ACT.stdWrap.htmlSpecialChars = 1
}

temp.overlayContentLeft = COA
temp.overlayContentLeft {
  10 < styles.content.getLeft
  10.stdWrap.ifEmpty.cObject = COA
  10.stdWrap.ifEmpty.cObject {
    10 = TEXT
    10.data = leveltitle:-1
    10.wrap = &lt;h1&gt; | &lt;/h1&gt;
    20 < temp.menu_1
  }
}

# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_BODY
  subparts {
    # Set subtitle
    subtitle = TEXT
    subtitle.data = leveltitle:1
    # Import main page content
    mainbar < styles.content.get
    # Populate site depth path
    depth = HMENU
    depth.special = rootline
    depth.1 = TMENU
    depth.1.NO.linkWrap = | /  |*||*|  |
    # Populate the IT menu
    menuBlock < temp.overlayContentLeft
    # Populate the Quick Links menu
    quickBlock < styles.content.getRight
  }
}

# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_HEADER
}

# Default PAGE object:
page = PAGE
page.typeNum = 0
page.config.doctype = xhtml_trans
page.10 < temp.mainTemplate
page.headerData.10  < temp.headTemplate
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2006/04/override-content/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Navigation Menu for Site Depth</title>
		<link>http://www.alethe.com/brad/2006/04/dynamic-site-depth-navigation-menu/</link>
		<comments>http://www.alethe.com/brad/2006/04/dynamic-site-depth-navigation-menu/#comments</comments>
		<pubDate>Sun, 23 Apr 2006 17:56:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Typo3 Snippets]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=17</guid>
		<description><![CDATA[
Include the following typoscript in your root page template to dynamically generate a text based navigation menu that provides the full path of the current page from the root of the site.

depth = HMENU
depth.special = rootline
depth.1 = TMENU
depth.1.NO.linkWrap = &#124; /  &#124;*&#124;&#124;*&#124;  &#124;

This will give a root line something like this:
&#160;&#160;&#160;&#160;&#160; Home / [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=alethe-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=1904811418&#038;fc1=999&#038;IS2=1&#038;lt1=_blank&#038;lc1=d8d7d3&#038;bc1=22201d&#038;bg1=22201d&#038;f=ifr" style="width:120px;height:240px;float:right;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>Include the following typoscript in your root page template to dynamically generate a text based navigation menu that provides the full path of the current page from the root of the site.</p>
<pre>
depth = HMENU
depth.special = rootline
depth.1 = TMENU
depth.1.NO.linkWrap = | /  |*||*|  |
</pre>
<p>This will give a root line something like this:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Home / Services / </p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2006/04/dynamic-site-depth-navigation-menu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flush DNS Cache</title>
		<link>http://www.alethe.com/brad/2006/04/flush-dns-cache/</link>
		<comments>http://www.alethe.com/brad/2006/04/flush-dns-cache/#comments</comments>
		<pubDate>Wed, 12 Apr 2006 16:32:47 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
		
		<category><![CDATA[Apple OS X]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=7</guid>
		<description><![CDATA[You can clear the DNS cache on OS X by entering the following command at the shell prompt.
lookupd -flushcache
On a windows 2000/XP/2003 system you would type the following from a command prompt.
ipconfig /flushdns
]]></description>
			<content:encoded><![CDATA[<p>You can clear the DNS cache on OS X by entering the following command at the shell prompt.</p>
<pre>lookupd -flushcache</pre>
<p>On a windows 2000/XP/2003 system you would type the following from a command prompt.</p>
<pre>ipconfig /flushdns</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2006/04/flush-dns-cache/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
