<?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>Katipo Developers Blog &#187; sysadmin</title>
	<atom:link href="http://blog.katipo.co.nz/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.katipo.co.nz</link>
	<description></description>
	<lastBuildDate>Fri, 04 Jun 2010 02:39:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing MongoDB on Mac OS X using Homebrew</title>
		<link>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/</link>
		<comments>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 01:20:42 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[Homebrew]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=108</guid>
		<description><![CDATA[I&#8217;ve moved from MacPorts to Homebrew which includes a recipe for installing MongoDB. After installing Homebrew, just run this as your normal user:
brew install mongodb
If you prefer to store your MongoDB data all under your home directory, you might find Mislav&#8217;s gist suits your needs instead:
http://gist.github.com/265272
If you prefer installing from source, check out this post:
http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x
Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve moved from MacPorts to <a href="http://github.com/mxcl/homebrew">Homebrew</a> which includes a recipe for installing MongoDB. After installing Homebrew, just run this as your normal user:</p>
<div class="codesnip-container" >brew install mongodb</div>
<p>If you prefer to store your MongoDB data all under your home directory, you might find Mislav&#8217;s gist suits your needs instead:</p>
<p><a href="http://gist.github.com/265272">http://gist.github.com/265272</a></p>
<p>If you prefer installing from source, check out this post:</p>
<p><a href="http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x">http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x</a></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OPACs for HLT &#8211; netbooting WebConverger on ASUS EEEBox b202</title>
		<link>http://blog.katipo.co.nz/2009/07/17/opacs-for-hlt-netbooting-webconverger-on-asus-eeebox-b202/</link>
		<comments>http://blog.katipo.co.nz/2009/07/17/opacs-for-hlt-netbooting-webconverger-on-asus-eeebox-b202/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 09:44:22 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[koha]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=56</guid>
		<description><![CDATA[The OPACs at HLT have been failing one by one, so some replacements are in order.  The previous OPACs ran Mozilla in kiosk mode on a hand modified Debian install sufficiently rickety that after ~4 years I didn&#8217;t really want to touch it.
Somewhat surprisingly, the task (taking some hardware and netbooting it into a teenage-vandal-proof [...]]]></description>
			<content:encoded><![CDATA[<p>The OPACs at <a href="http://www.library.org.nz/">HLT</a> have been failing one by one, so some replacements are in order.  The previous OPACs ran Mozilla in kiosk mode on a hand modified Debian install sufficiently rickety that after ~4 years I didn&#8217;t really want to touch it.</p>
<p>Somewhat surprisingly, the task (taking some hardware and netbooting it into a teenage-vandal-proof web kiosk) didn&#8217;t appear to be a solved problem &#8211; there are still a lot of people rolling their own, I&#8217;ve done that once, I didn&#8217;t really want to do it again.</p>
<p>Webconverger almost fits the bill, with a couple of caveats:<span id="more-56"></span></p>
<ol>
<li>it doesn&#8217;t have direct support for netbooting</li>
<li><a title="it doesn't work with the EEEBox b202" href="http://groups.google.com/group/webc-users/browse_thread/thread/82d8bd5a7ac09c1e#%20)">it doesn&#8217;t work with the EEEBox b202</a></li>
</ol>
<p>As Webc is based on Debian Live (which does support PXE booting), and the b202 works fine with Ubuntu, both these issues seemed like they should be soluble, and after much mucking about, that proved true.</p>
<p>First up, there&#8217;s no way that I can see to get Webc to netboot without rebuilding it, so you need to be comfortable with that <a title="process." href="http://webconverger.org/develop/">process.</a>  Be warned that you will consume a fair amount of bandwidth downloading packages (multiple times if you don&#8217;t have a local cache), and that the build process is slooooow.</p>
<p>Solving the non functioning X display was relatively straightforward. First, you need to amend your X configuration.  Add a symlink and a file to the includes tree:
<div class="codesnip-container" >ls -l config/chroot_local-includes/etc/X11<br />
lrwxrwxrwx 1 root simon   13 2009-07-09 18:10 X -> /usr/bin/Xorg<br />
-rw-r&#8211;r&#8211; 1 root simon 1194 2009-07-09 18:10 xorg.conf</div>
<p>inside the xorg.conf you need something like:
<div class="codesnip-container" >Section &#8220;Device&#8221;<br />
Identifier	&#8220;Configured Video Device&#8221;<br />
Option &#8220;monitor-LVDS&#8221; &#8220;LVDS&#8221;<br />
EndSection<br />
Section &#8220;Monitor&#8221;<br />
Identifier	&#8220;LVDS&#8221;<br />
Option &#8220;Ignore&#8221; &#8220;true&#8221;<br />
EndSection<br />
Section &#8220;Monitor&#8221;<br />
Identifier	&#8220;Configured Monitor&#8221;<br />
EndSection<br />
Section &#8220;Screen&#8221;   Identifier	&#8220;Default Screen&#8221;<br />
Monitor	&#8220;Configured Monitor&#8221;<br />
EndSection</div>
<p>then, edit scripts/config and add &#8220;noxautoconfig&#8221; to the &#8211;bootappend-live line, and rebuild.</p>
<p>noxautoconfig disables autogeneration of the X config every time the machine boots &#8211; it isn&#8217;t ideal, in that it makes your build less portable, but it does give you a working display.  Hopefully, the Intel Xorg driver will be updated soon to make this unnecessary (it appears to be assuming that the b202 has a mobile graphics chipset, therefore it must have an LMDS display).</p>
<p>Netbooting Webc is also comparatively simple &#8211; the only major gotcha is that the stock Webc iptables ruleset blocks NFS, which means that your box will hang just before X starts up.   HLT don&#8217;t need iptables in their environment,  so I took the path of least resistance and removed the iptables package completely &#8211; alternatively, you could amend config/chroot_local-includes/etc/iptables.conf to allow NFS.</p>
<p>So to enable netbooting, you make changes as per the Debian live manual &#8211; add something like:</p>
<div class="codesnip-container" >-b net \<br />
&#8211;net-root-path &#8220;/srv/debian-live&#8221; \<br />
&#8211;net-root-server &#8220;192.168.1.1&#8243; \</div>
<p>to scripts/config, then edit config/chroot_local-packageslists/webconverger and remove the &#8220;iptables&#8221; entry.  Finally, if DNS resolution doesn&#8217;t work, you may need to remove &#8220;nonetworking&#8221; from the &#8211;bootappend-live line in scripts/config.  Rebuild webc, and be happy.</p>
<p><strong>Other local changes:</strong></p>
<p>Removed iptables, splashy, cups, iceweasel-webconverger and all the wireless drivers from the package list, and added cron, msttcorefonts and iceweasel-webcyourlibrary.  I needed cron because I wanted to be able to power down the kiosks after the library is closed.</p>
<p>I made some further changes to scripts/config file:</p>
<div class="codesnip-container" >&#8211;bootappend-live &#8220;quiet silent nosudo noxautoconfig homepage=http://www.library.org.nz/ video=vesa:ywrap,mtrr vga=792 nopersistent quickreboot timezone=Pacific/Auckland noblank kioskresetstation=2 swapon&#8221; \<br />
-k 686 \</div>
<p> the timezone is necessary for the cron jobs to work correctly, noblank turns off the screen blanking, swapon enables any swap partitions on the hard drive, and kioskresetstation restarts Iceweasel after two minutes of idleness.  The -k 686 causes the system to boot the 686 optimised kernel &#8211; it&#8217;s not critical, the default 486 kernel also works.  All good.</p>
<p>After making changes to the tree, I run</p>
<div class="codesnip-container" >$ sudo lh_clean &#8211;purge; lh_config ; sudo lh_build</div>
<p>to redo the build.  It&#8217;s a slow process, particularly if you use &#8211;purge.  Once built, to install I run:</p>
<div class="codesnip-container" >$ sudo rm -r /srv/webconverger /srv/debian-live ; sudo tar -C /srv -xzf binary-net.tar.gz ; sudo mv /srv/webconverger/debian-live /srv ; sudo rm -r /tftpboot/pxe/debian-live ; sudo mv /srv/webconverger/tftpboot/debian-live /tftpboot/pxe ; sudo cp prompt.cfg /tftpboot/pxe/debian-live/i386/boot-screens</div>
<p>I copy the prompt.cfg because I couldn&#8217;t work out how to turn off the pxelinux prompt from within debian-live &#8211; this just overwrites the installed file with a simple file that says:</p>
<div class="codesnip-container" >default live<br />
prompt 0<br />
noescape 1</div>
<p><strong>Hardware setup</strong></p>
<p>(mostly these are notes to myself so that when I have to repeat the process in the future I won&#8217;t forget steps):</p>
<p>Updated the BIOS (press Alr-F2 as the machine boots to run the updater), then made some changes in the BIOS &#8211; enabled LAN BootROM, disabled WLAN, Enabled ACPI 2.0 support, enabled Power on by LAN, Full screen logo disabled, Express gate disabled.</p>
<p>I used <a href="http://sourceforge.net/projects/billix/">Billix</a> to boot Ubuntu, shrink the second NTFS partition to 17.2GB, make an ext3 fs (15GB) and the remainder (1.7GB) into  swap, and installed Ubuntu server.  None of this is crucial, but I wanted grub installed, and wanted some swap space, and ubuntu is as good a way of achieving this as any.  Changes to /boot/grub/menu.lst: timeout 15, hiddenmenu, password (), alternative=false, lockold=true, howmany=1, memtest86=false, then run sudo update-grub.  Then add &#8220;title Reboot/nreboot&#8221; as the first option, and &#8220;lock&#8221; to all the remaining options.</p>
<p>I wanted grub because sometimes on warm boot the ethernet interface doesn&#8217;t bring up link, and PXE falls through to the hard drive.  I don&#8217;t know why this is &#8211; it might be a BIOS issue, it might be an incompatibility between my test switch and the b202 &#8211; either way, with grub I can force the machine to reboot and try again, rather than falling through to an unconfigured Windows install.</p>
<p>Verify grub is giving the correct behavior (password within 15 seconds to boot Windows or Ubuntu, otherwise reboot), go back to the BIOS, change the Boot device priority, first: Network boot, second HDD, USB/CDROM disabed, and set a Supervisor password on the BIOS so that it can&#8217;t be modified.  Reboot</p>
<p>When the PXE config text comes up, press Shift F10 to configure, disable the Config message, and set the Show message time to 1 Sec.  Add the MAC of the machine to DHCP/WOL configs, and test.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/07/17/opacs-for-hlt-netbooting-webconverger-on-asus-eeebox-b202/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How much disk space does your Rails Database use?</title>
		<link>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:26:48 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=40</guid>
		<description><![CDATA[The other day I was asked how much disk space a particular Kete project&#8217;s production database used.  I didn&#8217;t have an answer, so I started searching for one.
In my case, the db software is MySQL and getting a report about various aspects of a db&#8217;s tables boils down to this query:
show table status;
The output [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was asked how much disk space a particular Kete project&#8217;s production database used.  I didn&#8217;t have an answer, so I started searching for one.</p>
<p>In my case, the db software is MySQL and getting a report about various aspects of a db&#8217;s tables boils down to this query:</p>
<div class="codesnip-container" >show table status;</div>
<p>The output of this query has way more information than I need, plus to get the total number of bytes used you have to add all the values up anyway, so I decided to make a rake task to make this repeatable and return something succinct.</p>
<p>I have added the new rake task to the Kete app&#8217;s codebase.  If you aren&#8217;t a Kete user, but need this functionality for your Ruby on Rails app, you can find it here:</p>
<p><a href="http://svn.kete.net.nz/projects/kete/trunk/lib/tasks/db-disk-usage-report.rake">http://svn.kete.net.nz/projects/kete/trunk/lib/tasks/db-disk-usage-report.rake</a></p>
<p>Note there is a formatting method taken from the Rails Helpers, I would love to not duplicate this definition.  If anyone has a recommendation for the best way to pull this method into this rake task, I would appreciate it.  Probably a simple include statement, but I didn&#8217;t get around to figuring out the correct incantation.</p>
<p>I would also love to hear how best to make this handle other database software, for example PostgreSQL, too.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server Setup and Deployment for Rails using Capistrano, Mongrel, and Nginx using Mac OS X for Development and Debian Etch for Production</title>
		<link>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:12:44 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=30</guid>
		<description><![CDATA[As previously mentioned, I have written a guide on how to set up Kete (also applicable to other Rails apps though Kete includes some extra required software and niceties to make it easier) for Development on Mac OS X.  This guide also includes best practices for Deployment.  So the following guide can be [...]]]></description>
			<content:encoded><![CDATA[<p>As previously mentioned, I have written a guide on how to set up Kete (also applicable to other Rails apps though Kete includes some extra required software and niceties to make it easier) for Development on Mac OS X.  This guide also includes best practices for Deployment.  So the following guide can be seen as the first half of the story:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x">http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x</a></p>
<p>But what about the host that you are deploying to?  I cover that for Debian Etch in the following guide:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/15-preparing-a-debian-etch-host-to-be-deployed-to-for-kete">http://kete.net.nz/documentation/topics/show/15-preparing-a-debian-etch-host-to-be-deployed-to-for-kete</a></p>
<p>You might also be curious what software Kete requires.  Here&#8217;s a breakdown:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/19-technical-requirements">http://kete.net.nz/documentation/topics/show/19-technical-requirements</a></p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the Kete Stack on Mac OS X, including MacPorts, Ruby on Rails, Ruby-Zoom, and Zebra</title>
		<link>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:06:30 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=37</guid>
		<description><![CDATA[I&#8217;ve added a guide over at Kete.net.nz for how to install Kete for development on Mac OS X.  You can find hit here:
http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x
If anything doesn&#8217;t work for you, please let me know.
Cheers,
Walter
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added a guide over at Kete.net.nz for how to install Kete for development on Mac OS X.  You can find hit here:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x">http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x</a></p>
<p>If anything doesn&#8217;t work for you, please let me know.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ERC (emacs IRC client) Set Up in Aquamacs</title>
		<link>http://blog.katipo.co.nz/2007/09/30/erc-emacs-irc-client-set-up-in-aquamacs/</link>
		<comments>http://blog.katipo.co.nz/2007/09/30/erc-emacs-irc-client-set-up-in-aquamacs/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 03:57:12 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=39</guid>
		<description><![CDATA[I&#8217;m going to outline how to set up Aquamacs for my IRC requirements with the built in ERC emacs IRC client so that it automates joining the server and channels I want, with some other bells and whistles (the bell part, literally!).  All of these steps have .emacs file equivalent, so you could use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to outline how to set up Aquamacs for my IRC requirements with the built in ERC emacs IRC client so that it automates joining the server and channels I want, with some other bells and whistles (the bell part, literally!).  All of these steps have .emacs file equivalent, so you could use it as a starting pointing point for figuring out how to set them, even if you don&#8217;t use Aquamacs (Mac OS X GUI emacs).</p>
<p>Here are the steps:<br />
<span id="more-39"></span></p>
<p>First select Aquamacs -&gt; Preferences from the menu bar.  You&#8217;ll get a &#8220;*Customize Group: Emacs*&#8221;, click on &#8220;Goto Group&#8221; link next to Applications section.  Do the same next to the Erc section of the next buffer.  Now we are in &#8220;*Customize Group: Erc*&#8221; buffer this is where we&#8217;ll do most of our work.</p>
<p>If you want a server other than the default irc.freenode.net, next to &#8220;Erc Server&#8221; click &#8220;Value Menu:&#8221; and select &#8220;Server&#8221; from the pop-up menu.  Type in your server into the field.  We&#8217;ll save this when we save all the options for this buffer later.</p>
<p>I use the default, so I didn&#8217;t need to change the Erc Port settings, but if do, repeat the same process that you did for the server with the Erc Port settings.</p>
<p>My nick is the same as my unix login user, i.e. the default.  So again, set if you need to, I didn&#8217;t.</p>
<p>You get the idea for the standard fields.  So I will only go into detail about things that have a different process.  For example, you may want to experiment with the Erc Modules options, in which case, click &#8220;Show Values&#8221; and check or uncheck the options you want (note that some may hose your settings, if not properly supported by your set up, the *Messages* buffer is a good place to get the rundown if things go wrong).</p>
<p>I like my name highlighted and to receive a bell, so that I know when someone is trying to get a hold of me if I&#8217;m working in another window.  To do this, click &#8220;Goto Group&#8221; next to Erc Match.  Then select &#8220;keyword&#8221; from the menu you that pops up from &#8220;Value Menu&#8221; next to &#8220;Erc Current Nick Highlight Type&#8221; section.</p>
<p>The default Erc Beep Match Types is set to current-nick.  So nothing to do there, but you need to click on &#8220;Show Value&#8221; for Erc Text Matched Hook and check &#8220;erc-beep-on-match&#8221;.</p>
<p>We&#8217;re done in Erc Match group.  To save our settings, scroll back to the top of the buffer, click &#8220;Save for Future Sessions&#8221;, answer prompt with &#8220;yes&#8221;, then click &#8220;Finish&#8221; to dismiss that set of settings.  Do this again for each group we go into, when we are done with it.</p>
<p>Time to set the channels to autojoin.  Back in the &#8220;*Customize Group: Erc*&#8221; buffer, click &#8220;Goto Group&#8221; next to &#8220;Erc Autojoin&#8221;.</p>
<p>Autojoin should already be on, i.e. display &#8220;on (non-nil)&#8221;.  So we only have to add to &#8220;Erc Autojoin Channels Alist&#8221;.  Click &#8220;Show Value&#8221; next to that section.  Use the &#8220;INS&#8221; and &#8220;DEL&#8221; buttons and the corresponding fields to insert and delete the server and channels.</p>
<p><i>Note that erc-autojoin-mode didn&#8217;t actually work for me which maybe related to my irc server&#8217;s set up.  Make sure your server name is the same as where you actually get logged into, not a DNS redirect or something.  Also private channels that require invites take more work.  I just use an emacs for them.  See below.</i></p>
<p>When you are done, do the save and finish steps for that group buffer.</p>
<p>We&#8217;re almost done with the Customization interface for Erc.  Lastly, turn on sound in Erc so that we can hear our alerts.  Click &#8220;Goto Group&#8221; next to Erc Sound, then toggle the value for Erc Sounds Mode to &#8220;on (non nil)&#8221;.  Save that group and finish.</p>
<p>Do this again for the parent group&#8217;s buffer, too, &#8220;*Customize Group: Erc*&#8221;.  Hit &#8220;Finish&#8221; for all the other parent groups, then restart Aquamacs.</p>
<p>Out of the box Aquamacs doesn&#8217;t support beeping (sound isn&#8217;t properly set up).  To get beeping when your nick is used, you need to the additional steps outlined here:</p>
<p><a href="http://www.emacswiki.org/cgi-bin/emacs/ErcSound#toc7">Playing with Sound on Mac OS X</a></p>
<p>Now we&#8217;ll record a couple macro for joining channels and setting up buffers split into various &#8220;windows&#8221; within the frame.  You can find background on this step:</p>
<p><a href="http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs110.htm">http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs110.htm</a><br />
and<br />
<a href="http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs112.htm">http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs112.htm</a></p>
<p>Basically it boils down to this; figure out what steps you want to automate, record the macro, name the macro, save the macro to ~/Library/Preferences/Aquamacs Emacs/Preferences.el (or ~/.emacs), and you&#8217;re done.</p>
<p>Let&#8217;s go through the steps with some details, starting after you have figured out what you want to automate (in my case starting erc and then joining channels while putting them in different areas of the frame) are:</p>
<ul>
<li>Start the recording process by typing &#8220;Control-x (&#8221;</li>
<li>Do the steps you are automating</li>
<li>End the recording process by typing &#8220;Control-x )&#8221;</li>
<li>Name the macro with &#8220;Meta-x name-last-kbd-macro&#8221; (make sure to be smart about not using a name that is already used by emacs)</li>
<li>Open ~/Library/Preferences/Aquamacs Emacs/Preferences.el for editing, go to someplace suitable in the file and do &#8220;Meta-x insert-kbd-macro&#8221;, save the file</li>
<li>restart Aquamacs and test</li>
</ul>
<p>Because some of the steps needed to wait until the IRC server connection was established before they could be run, I had to split the steps into two macros, one for connecting to the server and joining the first public channel which triggers and invite to a private channel, and lastly the other for all others steps after that.</p>
<p>Macros can take a few tries to get right, but are immensely handy timesaver for things like this.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/09/30/erc-emacs-irc-client-set-up-in-aquamacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Subversion with Piston to do vendor branch management for an entire open source Ruby on Rails application</title>
		<link>http://blog.katipo.co.nz/2007/06/08/using-subversion-with-piston-to-do-vendor-branch-management-for-an-entire-open-source-ruby-on-rails-application/</link>
		<comments>http://blog.katipo.co.nz/2007/06/08/using-subversion-with-piston-to-do-vendor-branch-management-for-an-entire-open-source-ruby-on-rails-application/#comments</comments>
		<pubDate>Thu, 07 Jun 2007 21:13:50 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=36</guid>
		<description><![CDATA[People are moving away from managing their Rails plugins with svn externals towards Piston&#8217;s easy vendor branch management approach.
But what if you want to use Piston&#8217;s easy version of Subversion&#8217;s vendor branch management for dealing with the code for an entire Rails application based on an open source project like Mephisto, Collaboa, or in my [...]]]></description>
			<content:encoded><![CDATA[<p>People are moving away from managing their Rails plugins with svn externals towards <a href="http://piston.rubyforge.org/">Piston&#8217;s</a> easy vendor branch management approach.</p>
<p>But what if you want to use Piston&#8217;s easy version of <a href="http://svnbook.red-bean.com/en/1.0/ch07s04.html">Subversion&#8217;s vendor branch management</a> for dealing with the code for an entire Rails application based on an open source project like Mephisto, Collaboa, or in my case <a href="http://kete.net.nz/">Kete</a>?<span id="more-36"></span></p>
<p>It is a common workflow pattern to set up a client project based on an existing application that has an external repository, modify to suit, and run with it.  Quite often people will base their new client project repository on an &#8220;svn import&#8221; from a moment in time and then either have to merge in improvements from the base open source project&#8217;s progress by hand, or coming up with their own scheme for keeping the two repositories in sync.  This is because there is no explicit dependency on the old repository in the new client repository, only initial or periodic code dumps from the parent project.  In other words, a big pain.</p>
<p>Others use tools like <a href="http://svk.bestpractical.com/">SVK</a> to do local mirrors of the parent open source project.  However, you still end up relying on individual developers to be good about their merging in of source project&#8217;s codebase in a methodical manner.  My goal was to have a systematic tool so that any developer update the third party code, deal with any conflicts with custom code, commit it back to the client repository, and all other developers would receive it when they next updated.  In other words, a dependency managed directly in the subversion repository for the client project.</p>
<p>I was looking for a solution that was as simple as Piston&#8217;s management of the vendor directory and realized that there must be a way to just use Piston.  So I emailed <a href="http://blog.teksol.info/">François Beausoleil</a>, the developer of Piston, and he replied with a blog post that outlined the solution in no time at all.</p>
<p>You can find it at <a href="http://blog.teksol.info/articles/2007/06/07/using-piston-to-manage-external-applications">http://blog.teksol.info/articles/2007/06/07/using-piston-to-manage-external-applications</a>.</p>
<p>I had spent a fair amount of time looking for the answer, so I hope this helps others with the same problem.</p>
<p>Enjoy,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/06/08/using-subversion-with-piston-to-do-vendor-branch-management-for-an-entire-open-source-ruby-on-rails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching from svn externals to vendor branch managment for plugins via Piston</title>
		<link>http://blog.katipo.co.nz/2007/06/06/switching-from-svn-externals-to-vendor-branch-managment-for-plugins-via-piston/</link>
		<comments>http://blog.katipo.co.nz/2007/06/06/switching-from-svn-externals-to-vendor-branch-managment-for-plugins-via-piston/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 02:43:28 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=35</guid>
		<description><![CDATA[From a howto on Robby on Railshere.  You&#8217;ll want to read http://www.rubyinside.com/advent2006/12-piston.html for more commands and reasons to go this route.

First get the Piston gem:
$ sudo gem install -y piston
Now take your svn externals and convert them to being vendor branches managed by Piston:
piston convert
If you have been lazy and haven&#8217;t updated your externals [...]]]></description>
			<content:encoded><![CDATA[<p>From a howto on Robby on Rails<a href="http://www.robbyonrails.com/articles/2007/01/16/every-second-counts-with-a-piston-in-your-trunk">here</a>.  You&#8217;ll want to read <a href="http://www.rubyinside.com/advent2006/12-piston.html">http://www.rubyinside.com/advent2006/12-piston.html</a> for more commands and reasons to go this route.<br />
<span id="more-35"></span></p>
<p>First get the Piston gem:</p>
<div class="codesnip-container" >$ sudo gem install -y piston</div>
<p>Now take your svn externals and convert them to being vendor branches managed by Piston:</p>
<div class="codesnip-container" >piston convert</div>
<p>If you have been lazy and haven&#8217;t updated your externals for awhile, you may need to run &#8220;svn up vendor&#8221; first or perhaps a lot more to get things in order.</p>
<p>After everything is convert commit your changes to subversion and you are ready to roll with piston:</p>
<div class="codesnip-container" >svn ci -m &#8220;switching to vendor branch management for rails and plugins via piston from svn externals&#8221; vendor</div>
<p>Enjoy,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/06/06/switching-from-svn-externals-to-vendor-branch-managment-for-plugins-via-piston/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto Use Awstats with Nginx and Multiple Ruby on Rails Apps Under Mongrel Clusters</title>
		<link>http://blog.katipo.co.nz/2007/05/10/howto-use-awstats-with-nginx-and-multiple-ruby-on-rails-apps-under-mongrel-clusters/</link>
		<comments>http://blog.katipo.co.nz/2007/05/10/howto-use-awstats-with-nginx-and-multiple-ruby-on-rails-apps-under-mongrel-clusters/#comments</comments>
		<pubDate>Wed, 09 May 2007 23:21:59 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=34</guid>
		<description><![CDATA[I have a host where Nginx listens on port 80 and dishes out requests to various apps depending on what their host name is.  It also does appropriate load balancing. Primarily I use this for hosting various instances of Kete Ruby on Rails apps, but I also use it for supporting the subversion repository [...]]]></description>
			<content:encoded><![CDATA[<p>I have a host where Nginx listens on port 80 and dishes out requests to various apps depending on what their host name is.  It also does appropriate load balancing. Primarily I use this for hosting various instances of Kete Ruby on Rails apps, but I also use it for supporting the subversion repository under Apache and a few other RoR apps, too.  I wanted to setup up web log statistics for all of the above and I wanted to do it in such a way that it&#8217;s easy to add another web app to view statistics for.</p>
<p>Awstats is wicked easy to setup if you live in the LAMP world, but I could find a decent tutorial that covered my setup.  So here goes&#8230;<span id="more-34"></span></p>
<p><strong>Requirements</strong></p>
<p>Besides the software listed in the title, this tutorial also assumes that you are running Debian Etch and have Apache2 setup (although not on port 80).</p>
<p><strong>Install Awstats</strong></p>
<p>On Debian Etch this is a one liner as root.</p>
<div class="codesnip-container" >apt-get install awstats</div>
<p><strong>Set up Apache for Awstats</strong></p>
<div class="codesnip-container" >cd /usr/share/doc/awstats/examples/<br />
cp apache.conf /etc/apache2/sites-available/awstats.conf<br />
ln -s /etc/apache2/sites-available/awstats.conf /etc/apache2/sites-enabled/</div>
<p><strong>Configure A Domain</strong></p>
<p>You&#8217;ll need to do this for every domain you want to get statistics for.  This assumes you are still root and in the directory from the last section.</p>
<div class="codesnip-container" >gzip -d awstats.model.conf.gz<br />
cp awstats.model.conf /etc/awstats/awstats.your_domain.conf</div>
<p>Now open /etc/awstats/awstats.your_domain.conf with your favorite text editor, as root.  This is where we get into the Nginx specific stuff comes in.  Change the LogFile parameter like so (based on using the default Nginx storage of log files):</p>
<div class="codesnip-container" >LogFile=&#8221;/usr/local/nginx/logs/access.your_domain.log&#8221;</div>
<p>there are few more that you need to change to match your domain:</p>
<div class="codesnip-container" >SiteDomain=&#8221;your_full_domain&#8221;</div>
<p>and</p>
<div class="codesnip-container" >HostAliases=&#8221;localhost 127.0.0.1 REGEX[your_domain\.com$]&#8220;</div>
<p>and</p>
<div class="codesnip-container" >DirData=&#8221;/some/dir/where/www-data/has/read-and-write/your_domain&#8221;</div>
<p>You&#8217;ll need to do the following to make the matching directory that you specified in the DirData line:</p>
<div class="codesnip-container" >mkdir /some/dir/where/www-data/has/read-and-write/your_domain</div>
<p>In my case, I had to also chmod and chown the new directory, too.</p>
<p><em>Important Note: I have left the ability to update statistics off from the web, but allowed anyone to read statistics.  This is fine for my clients, but may not be for yours.  There are additional steps involved to lock it down, if needed</em></p>
<p>Again, note that you have to repeat the configuration for every domain.</p>
<p><strong>Configure Nginx for the Awstats Web Server</strong></p>
<p>Don&#8217;t forget to add DNS for whatever domain name you decide to go with.</p>
<p>In my case, I already had Nginx pointing at Apache running on port 8000 for HTTP access to my SVN repository.  I simply tacked &#8220;stats.your_domain&#8221; onto my server_name line in /usr/local/nginx/conf/nginx.conf and restarted Nginx with /etc/init.d/nginx stop and start.</p>
<p>See <a href="http://blog.katipo.co.nz/?p=32">this post</a> for details.</p>
<p><strong>Set up Logrotate for Nginx</strong></p>
<div class="codesnip-container" >cd /etc/logrotate.d/<br />
cp apache2 nginx</div>
<p>Now edit /etc/logrotate.d/nginx.  Change &#8220;/var/log/apache2/&#8221; to &#8220;/usr/local/nginx/logs/&#8221; and &#8220;/var/run/apache2.pid&#8221; to &#8220;/usr/local/nginx/logs/nginx.pid&#8221;.  Also &#8220;/etc/init.d/apache2 restart&#8221; to &#8220;/etc/init.d/nginx restart&#8221; and &#8220;create 640 root adm&#8221; to &#8220;create 664 root staff&#8221;.  Awstats user, www-data, needs permission to read the logs.</p>
<p>We also want to update our stats just before we run the weekly logrotate.  Thus we add this before the postrotate line:</p>
<div class="codesnip-container" >prerotate<br />
/usr/lib/cgi-bin/awstats.pl -config=your-domain-name -update<br />
endscript</div>
<p>Your will need to add a awstats.pl update call for each domain here, between prerotate and endscript.</p>
<p><strong>Run Awstats on Existing Log</strong></p>
<p>If you haven&#8217;t already, you probably want to do this:</p>
<div class="codesnip-container" >chmod 644 /usr/local/nginx/logs/*.log</div>
<p>For each of your domains, do this:</p>
<div class="codesnip-container" >/usr/lib/cgi-bin/awstats.pl -config=your_domain -update</div>
<p><strong>Set up Cronjob of Domain</strong></p>
<p>Edit /etc/cron.d/awstats.  Replace what is in there with this:</p>
<div class="codesnip-container" >0,10,20,30,40,50 * * * * www-data /usr/lib/cgi-bin/awstats.pl -config=horowhenua -update &gt;/dev/null</div>
<p>This will update your stats every ten minutes.</p>
<p><strong>Rails Production Log Rotation</strong></p>
<p>Lastly, for the domains that are Ruby on Rails apps in production, we&#8217;ll want to rotate their Rails production log. http://nubyonrails.com/articles/2007/01/03/a-hodel-3000-compliant-logger-for-the-rest-of-us</a></p>
<p>Follow the instructions up to &#8220;Once More with Feeling&#8221; then add crob job &#8211;&gt;</p>
<p>I&#8217;m running a small variant of what you can find here: <a href="http://tinyurl.com/3y9x87">rotate production logs</a></p>
<p>Ok, just repeat steps necessary to add domains.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/05/10/howto-use-awstats-with-nginx-and-multiple-ruby-on-rails-apps-under-mongrel-clusters/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing Collaboa .6 on Debian Etch</title>
		<link>http://blog.katipo.co.nz/2007/01/29/installing-colloboa-on-debian-etch/</link>
		<comments>http://blog.katipo.co.nz/2007/01/29/installing-colloboa-on-debian-etch/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 21:13:11 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=33</guid>
		<description><![CDATA[This assumes that you have already installed things outlined here.
$ sudo apt-get install swig
$ sudo apt-get install libsvn-ruby1.8
$ sudo gem install redcloth
$ sudo gem install syntax
$ sudo gem install -y xhtmldiff
$ cd /path/to/where/you/have/your/apps
$ svn co http://svn.collaboa.org/svn/collaboa/trunk/ your_app_name_for_collaboa
$ cd your_app_name_for_collaboa
$ cp config/database.yml.sample config/database.yml

Create your databases and database user. Edit config/database.yml to match.
$ RAILS_ENV=&#8221;production&#8221; rake db:schema:load
$ RAILS_ENV=&#8221;production&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>This assumes that you have already installed things outlined <a href="http://blog.katipo.co.nz/?p=21">here</a>.</p>
<div class="codesnip-container" >$ sudo apt-get install swig<br />
$ sudo apt-get install libsvn-ruby1.8<br />
$ sudo gem install redcloth<br />
$ sudo gem install syntax<br />
$ sudo gem install -y xhtmldiff<br />
$ cd /path/to/where/you/have/your/apps<br />
$ svn co http://svn.collaboa.org/svn/collaboa/trunk/ your_app_name_for_collaboa<br />
$ cd your_app_name_for_collaboa<br />
$ cp config/database.yml.sample config/database.yml</div>
<p><span id="more-33"></span></p>
<p>Create your databases and database user. Edit config/database.yml to match.</p>
<div class="codesnip-container" >$ RAILS_ENV=&#8221;production&#8221; rake db:schema:load<br />
$ RAILS_ENV=&#8221;production&#8221; ruby db/default_content.rb</div>
<p>Start the server and browse over to it.  This is dependent on your setup, but might be as simple as the following:</p>
<div class="codesnip-container" >$ script/server</div>
<p>&#8230;and then loading up http://localhost:3000/ in a web browser.  Login as &#8220;admin&#8221; with the password &#8220;admin&#8221;.  On the resulting page click &#8220;Admin&#8221; in the top right of the menu bar.  Next, click on &#8220;repositories&#8221; and add your repository(ies).  Remember that these need to have a local filesystem path.  They are not svn URLs.</p>
<p>Go back to &#8220;Administration&#8221;, click on &#8220;Users&#8221;, edit the admin user to have a different password.  Add yourself as an admin user via the permissions section.  Logout, log back in as yourself.</p>
<p>Go back to Admin, add your first project.  Add yourself to the project as an assignable user if appropriate.  I went ahead and created my first milestone while I was at it and added some other users to the system and on the project.</p>
<p>Enjoy,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/01/29/installing-colloboa-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
