<?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>Cosine Jeremiah and his Musings &#187; Projects</title>
	<atom:link href="http://cosine.org/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://cosine.org</link>
	<description>Life and Ruby and Security</description>
	<lastBuildDate>Sat, 10 Apr 2010 08:48:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AVLTree 0.1.4 Released</title>
		<link>http://cosine.org/2008/11/16/avltree-014-released/</link>
		<comments>http://cosine.org/2008/11/16/avltree-014-released/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 09:11:35 +0000</pubDate>
		<dc:creator>Cosine Jeremiah</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[avltree]]></category>

		<guid isPermaLink="false">http://www.cosine.org/?p=79</guid>
		<description><![CDATA[This morning I released AVLTree version 0.1.4.  The difference from version 0.1.3 is an idea from modifications made to the code by the Samhain folks to improve performance.
If you are not familiar with my AVLTree project, it is a C library that implements AVL trees and provides an interface for indexing and iterating over [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I released <a href="http://www.cosine.org/project/AVLTree/">AVLTree</a> version <a href="http://www.cosine.org/project/AVLTree/AVLTree-0.1.4.tar.gz">0.1.4</a>.  The difference from version 0.1.3 is an idea from modifications made to the code by the <a href="http://www.la-samhna.de/">Samhain</a> folks to improve performance.</p>
<p>If you are not familiar with my AVLTree project, it is a C library that implements AVL trees and provides an interface for indexing and iterating over objects.  I like to think of it as my little C answer to the hashes and dictionary objects available in more advanced languages.</p>
]]></content:encoded>
			<wfw:commentRss>http://cosine.org/2008/11/16/avltree-014-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Templating in Excel</title>
		<link>http://cosine.org/2008/10/10/excel-template/</link>
		<comments>http://cosine.org/2008/10/10/excel-template/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 04:59:15 +0000</pubDate>
		<dc:creator>Cosine Jeremiah</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.cosine.org/?p=62</guid>
		<description><![CDATA[I wrote a little spreadsheet template language for Excel VBA (Visual Basic for Applications).  What for?  Say you have a report you create often, and you&#8217;re thinking of making a macro in Excel to help automate its generation.  You want to report on the sales of your widgets from multiple locations, and [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a little spreadsheet template language for Excel VBA (Visual Basic for Applications).  What for?  Say you have a report you create often, and you&#8217;re thinking of making a macro in Excel to help automate its generation.  You want to report on the sales of your widgets from multiple locations, and you already have a template in mind for how the report should look:</p>
<div id="attachment_63" class="wp-caption alignnone" style="width: 323px"><a href="http://www.cosine.org/wp-content/uploads/2008/10/templatekicker-widget-template.jpg"><img src="http://www.cosine.org/wp-content/uploads/2008/10/templatekicker-widget-template.jpg" alt="Template of Widget Report in Excel" title="templatekicker-widget-template" width="313" height="191" class="size-full wp-image-63" /></a><p class="wp-caption-text">Template of Widget Report in Excel</p></div>
<p>I thought it would be so nice to be able to do this that I wrote the VBA to do it.  I call it TemplateKicker.  To use it, I copy the TemplateKicker module and the TemplateKickerVariables class module into my spreadsheet from <a href="/ex/2008/10/10/TemplateKicker.xls">TemplateKicker.xls</a> (this file also contains the example shown here).  Then I write a macro to insert the values for each location I am reporting on:</p>
<pre>
Public Sub Widget_Report()
    Dim Vars As TemplateKickerVariables
    Dim LocationIDs As Variant
    Dim WidgetSales As Variant
    Dim Index As Integer

    LocationIDs = Array("A-12345", "B-22222", "C-33333", "D-2R2", "E-5555")
    WidgetSales = Array(34, 12, 15, 6, 39)

    Set Vars = New TemplateKickerVariables
    For Index = 1 To 5
        Vars.SetVar "location:" &#038; Index &#038; ".id", LocationIDs(Index - 1)
        Vars.SetVar "location:" &#038; Index &#038; ".widgets.sold", WidgetSales(Index - 1)
    Next Index

    KickWorksheet(ActiveWorkbook, Sheets("Sheet1"), Vars).Name = "Widgets"
End Sub
</pre>
<p>One run of the macro later, and I have a new worksheet with the results:</p>
<div id="attachment_64" class="wp-caption alignnone" style="width: 323px"><a href="http://www.cosine.org/wp-content/uploads/2008/10/templatekicker-widget-report.jpg"><img src="http://www.cosine.org/wp-content/uploads/2008/10/templatekicker-widget-report.jpg" alt="Widget Report after running macro" title="templatekicker-widget-report" width="313" height="231" class="size-full wp-image-64" /></a><p class="wp-caption-text">Widget Report after running macro</p></div>
<p>TemplateKicker also has the following features that I will showcase in upcoming blog posts:</p>
<ul>
<li>Nested ForEach loops</li>
<li>Rows to insert between items being looped over</li>
<li>Generation of named ranges for use in formulas</li>
</ul>
<p>Even with all this, however, TemplateKicker does have some limitations:</p>
<ul>
<li>The template language is somewhat &#8220;fragile&#8221;&mdash;spaces must be exactly placed.</li>
<li>Errors are not reported.  Bad syntax or variable names produce undefined results.</li>
</ul>
<p>Still, I think this is a great start to doing some pretty awesome things in Excel VBA.  I do not know if I will develop it further, but if you find it interesting please let me know!</p>
<p>As a side note, <a href="http://www.cosinewave.com/">CosineWave Technologies Inc.</a> now also offers VBA solutions for business automation now. <img src='http://cosine.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Please drop me a line if you have need for some tools to automate your workflow when using Microsoft products (or many other products for that matter)!</p>
<p><!-- adman --></p>
]]></content:encoded>
			<wfw:commentRss>http://cosine.org/2008/10/10/excel-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portforw</title>
		<link>http://cosine.org/2007/07/29/portforw/</link>
		<comments>http://cosine.org/2007/07/29/portforw/#comments</comments>
		<pubDate>Sun, 29 Jul 2007 16:03:20 +0000</pubDate>
		<dc:creator>Cosine Jeremiah</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.cosine.org/2007/07/29/portforw/</guid>
		<description><![CDATA[One of the things I coded in Perl a while ago that I was planning to port to Ruby at some point was a little port forwarding utility called portforw (GPL license).  I provided a link to download it here because perhaps you may find it useful, too, if you also need such a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I coded in Perl a while ago that I was planning to port to Ruby at some point was a little port forwarding utility called <a href="http://www.cosine.org/project/fwpass/portforw">portforw</a> (<a href="http://www.cosine.org/project/fwpass/portforw.license">GPL license</a>).  I provided a link to download it here because perhaps you may find it useful, too, if you also need such a utility.  I consider it moderately well writtenâ€”I can be somewhat proud of it and somewhat embarrassed by it at the same time.  I was going to clean it up when I made the Ruby port (which at one point I wrote quite a bit of code for, but now it languishes).</p>
<p>Portforw does what it sounds like: it forwards connections from one place to another.  But simply forwarding connections is not the limit of portforw&#8217;s abilities; if connection forwarding was all I needed I would have used the port redirect feature with some host-based firewall software.  Portforw also filters the data as it passes through, allowing it to pass connections through different kinds of proxies.</p>
<p><span id="more-11"></span> Using portforw is rather simple.  If you want to forward port 5901 to another system, call it my-win-box, you invoke it:</p>
<p><code>portforw 5901//my-win-box</code></p>
<p>You can change the destination port that connections are forwarded:</p>
<p><code>portforw 5901//my-win-box:5900</code></p>
<p>You can make portforw listen on just a single interface, possibly loopback:<br />
<code></code></p>
<p><code>portforw 127.0.0.1:5901//my-win-box:5900</code></p>
<p>You can setup multiple ports to forward, all handled by one process:<br />
<code></code></p>
<p><code>portforw 5901//my-win-box 5902//your-win-box 5903//his-win-box</code></p>
<p>Or make it a poor-man&#8217;s netcat by having standard input and output bridged to the remote port:<br />
<code></code></p>
<p><code>portforw -f /fd:0,1//my-telnet-box:23</code></p>
<p>If you want to make your forwarding connection through an HTTP proxy, a telnet proxy, or tunneled through an SSL connection, it is possible using portforw (though not necessarily trivial).  To forward the connection through an HTTP proxy, for instance, you would need a separate program to prepare the HTTP header containing the CONNECT statement ahead of time and then pass that header to portforw as part of the data.  Add a flag to tell portforw to filter out the HTTP response header from the active data stream, and your connection is complete.  It is quite a kludge, but it admirably handled the task at hand when I needed these features.</p>
<p>If you end up using portforw for anything interesting or have questions about some of the filter flags, I would appreciate it if you let me know (my email address is in the footer).  If ever sufficient interest in portforw surfaces, I might get back to that Ruby port! <img src='http://cosine.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://cosine.org/2007/07/29/portforw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capistrano and Administration</title>
		<link>http://cosine.org/2007/07/18/capistrano-administration/</link>
		<comments>http://cosine.org/2007/07/18/capistrano-administration/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 23:00:41 +0000</pubDate>
		<dc:creator>Cosine Jeremiah</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.cosine.org/2007/07/18/capistrano-evolution/</guid>
		<description><![CDATA[Know what Capistrano is?  I did a presentation on it in February, so I know a little about it.  At the time I was investigating it as a hopeful candidate that could assist with configuration management for general systems administration for an environment of about 150 Solaris systems.  I discovered that Capistrano [...]]]></description>
			<content:encoded><![CDATA[<p>Know what Capistrano is?  I did a <a href="http://www.cosinewave.net/ruby/cap" title="Using Capistrano">presentation</a> on it in February, so I know a little about it.  At the time I was investigating it as a hopeful candidate that could assist with configuration management for general systems administration for an environment of about 150 Solaris systems.  I discovered that Capistrano is a fantastic program and a great tool for application deployment.  Honestly there is no reason you should ever put up with the act of moving an application to production being more than a few keystrokes, and using Capistrano makes that possible.  However, Capistrano was unable to help out such a large Unix environment.</p>
<p>Capistrano has no facility for continuing tasks upon failure.  In a large Unix environment, stuff needs to happen even if only 98% of the systems are up.  What about the 2% not available?  They can get the update later when they&#8217;re back.  We needed a tool that can just do the work and get it done on the 98% and report on who failed.  Later, when the failed systems are back online, the tool should automatically update them on the next run.  Then we can go about fixing the issues causing those 2% of systems to fail and rest assured that all our changes will be pushed soon.</p>
<p><span id="more-7"></span> I intend to fill this gap.  Jamis Buck, the maintainer of Capistrano, also wrote the Net::SSH module for Ruby.  It is a spectacular module.  With it, I plan to write an agentless tool that runs from a central server and uses SSH to log into each system for whatever task necessary.  Couple it with some tools to manage users, groups, system configurations, and software installations, and a new tool to conquer the world will be born.</p>
<p>If you want to conquer the world with me, let me know! <img src='http://cosine.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I have written a similar tool before.  Back when I worked at Abbott I wrote a little tool we called confmgt.  I used Perl because when I started the project around 1999 or 2000 that was the best language I knew.  Additionally, Perl was installed on every Research and Development Unix system in the company, so I could count on it being present.  The original version ran on a central server and used rdist to push files to target hosts after performing some non-trivial logic on which files to include in and exclude from the transfer.</p>
<p>Eventually the tool grew and features were added, and by version 3.0 (the last major version when I left Abbott) the program used rsync by default and could be run either from central server or from the host being updated.  More complicated configurations required features to include more customization in how distribution areas were laid out.  Despite still being written in Perl, I was very proud of the 3.0 release of confmgt.  It was a masterpiece of Perl and of programming in general.  With this release other Unix administrators were no longer coming to me and asking for new features; instead they came, asked, and then left knowing how to do what they were requesting.  I have rarely felt greater pride in my work.</p>
<p>So now I am going to repeat myself, but this time in Ruby.  Instead of rsync I will use Net::SFTP.  The configuration file will likely be similar to Capistrano&#8217;s so that people familiar with one can use the other easily (as it should be!).  It is time to change the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://cosine.org/2007/07/18/capistrano-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
