<?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>Krotscheck.net &#187; startup</title>
	<atom:link href="http://www.krotscheck.net/tag/startup/feed" rel="self" type="application/rss+xml" />
	<link>http://www.krotscheck.net</link>
	<description>Michael Krotscheck's insights, ideas, and inspirations about web technology, life, and the kitchen sink.</description>
	<lastBuildDate>Fri, 03 Feb 2012 05:10:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>What makes a &#8216;Rockstar&#8217; Developer?</title>
		<link>http://www.krotscheck.net/2010/01/10/what-makes-a-rockstar-developer.html</link>
		<comments>http://www.krotscheck.net/2010/01/10/what-makes-a-rockstar-developer.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:11:30 +0000</pubDate>
		<dc:creator>Michael Krotscheck</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[entrepreneurship]]></category>
		<category><![CDATA[rockstar]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://www.krotscheck.net/2010/01/10/what-makes-a-rockstar-developer.html</guid>
		<description><![CDATA[I&#8217;ve recently been involved in a discussion about what makes a rockstar developer for a startup. This has always surprised me- the reality of the matter is that there are no rockstars, only people who think of themselves as rockstars, and those are the last people you want in charge of your product. So I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been involved in a discussion about what makes a rockstar developer for a startup. This has always surprised me- the reality of the matter is that there are no rockstars, only people who think of themselves as rockstars, and those are the last people you want in charge of your product. So I figure, as someone who&#8217;s been around the block a few times, it would be good to come up with a list of what actually makes for a &#8220;rockstar&#8221; developer. If I miss anything, feel free to contribute in the comments.</p>
<h4>1- They don&#8217;t think of themselves as rock stars.</h4>
<p>Arrogance is perhaps a key requirement in being an entrepreneur, but overconfidence will drain your cash pool faster than hookers and blow.</p>
<h4>2- They have a proven track record of multiple shipped products.</h4>
<p>You don&#8217;t want a hotshot kid out of school, you want a seasoned professional, preferably one who knows how to write applications for the industry you&#8217;re trying to reach.</p>
<h4>3- They care more about frameworks than plumbing.</h4>
<p>Unless you&#8217;re trying to design a complex new mathematical algorithm (in which case you should probably be partnering with a university research lab), you want someone who can grasp a system rather than a method. If this guy ends up in deep technical discussions about the optimal way of implementing a sort, you&#8217;ve got the wrong guy.</p>
<h4>4- They&#8217;re not willing to work for free</h4>
<p>Risk management and strategic thinking is key to long-term project viability. If you have someone willing to work for equity, they&#8217;re willing to take risks with your payment processing gateway just as easily as they&#8217;re taking a risk on you.</p>
<h4>5- They believe in development process and best practices to speed up their work.</h4>
<p>The last thing you want is someone who&#8217;s trying to reinvent the wheel. Mind you, this also likely means that the first two weeks or so of development you&#8217;ll see a lot of development support tools get set up and used before code actually starts, but that&#8217;ll give you time to get your documentation in order.</p>
<h4>6- They have a positive attitude.</h4>
<p>If someone bitches, they&#8217;re looking to blame themselves. Instead, you want them to identify their concern as a problem they can solve.</p>
<h4>7- They get uncomfortable when you ask about their social life.</h4>
<p>&#8217;cause, well, currently it&#8217;s still socially odd to prefer coding on a saturday night.</p>
<h4>8- You don&#8217;t want Alphabet/Acronym soup in their technical skills.</h4>
<p>Lots of languages means little depth in each, and depth = speed. Pick a serverside language (PHP, .Net, Ruby, etc), pick a database (MySQL, SQLServer, Postgres, etc), and pick a frontend (Flex, Mootools, JQuery, etc). Focus on that. If a dev has only a few languages this does not mean they&#8217;re stupid- it means they know how to focus.</p>
<h4>9- They&#8217;re involved in the community.</h4>
<p>Speaking, attending, whatever, you need to make sure their technical skills don&#8217;t stagnate, and that they&#8217;re willing to accept ideas from outside.</p>
<h4>10- You respect them</h4>
<p>Respect means you are willing to listen when they tell you you&#8217;re full of it, and that&#8217;s key in a partnership. You&#8217;re not looking for a monkey you can put in a corner who can bang out some code- you&#8217;re looking for a partner who&#8217;ll act as a technical sounding board.</p>
<div class="hr"></div>
<p>So now I have this question: What makes for a rockstar business partner?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krotscheck.net/2010/01/10/what-makes-a-rockstar-developer.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Bootstrapping a Startup: Zend and WordPress Auth Integration</title>
		<link>http://www.krotscheck.net/2009/05/16/bootstrapping-a-startup-zend-and-wordpress-auth-integration.html</link>
		<comments>http://www.krotscheck.net/2009/05/16/bootstrapping-a-startup-zend-and-wordpress-auth-integration.html#comments</comments>
		<pubDate>Sat, 16 May 2009 11:00:47 +0000</pubDate>
		<dc:creator>Michael Krotscheck</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.krotscheck.net/2009/04/22/bootstrapping-a-startup-zend-and-wordpress-auth-integration.html</guid>
		<description><![CDATA[Three weeks ago, Columbus hosted Startup Weekend, and one of the presenters (blah name here) effectively stated that the first step of a startup should be to get something out there to gauge interest. This is fair- fact is there’s no point in throwing development hours at a project if you don’t know whether it’ll [...]]]></description>
			<content:encoded><![CDATA[<p>Three weeks ago, Columbus hosted Startup Weekend, and one of the presenters (blah name here) effectively stated that the first step of a startup should be to get something out there to gauge interest. This is fair- fact is there’s no point in throwing development hours at a project if you don’t know whether it’ll gain traction. This also gives you an opportunity to gather metrics and information that you can take to potential investors.</p>
<p>The real challenge, however, is “Getting Something Out There” that you can build on. I don’t mean setting up a blog or a couple of static pages, I mean putting in place a scaffolding that you don’t have to replace in its entirety as your business concept matures. The optimal solution then seems to be to use an established software package that can be extended to suit your needs.</p>
<p>Easier said than done. Every CMS out there claims to be extendable, yet not all are created equal. Furthermore extensibility usually requires that you build within their own framework, which then locks you into a third party whom you don’t have control over.</p>
<p>This can be overcome by developing your business services independently, and create a loose integration between your application and your CMS. By doing this you’re suddenly free to proceed with your own plans without the added worry of being locked into a platform.</p>
<p>So why did I choose WordPress and Zend? Well, WordPress has an easily understood plugin structure as well as an active developer community, plus its plugins allow you to do pretty much anything your heart desires. Zend was chosen because it’s a professionally supported application framework with quite a few corporate backers, and it’s written in the same language as WordPress- PHP (Plus, it’s what I know- Added Bonus).</p>
<p>The rest of this post is going to get technical, so I hope those of you who aren’t as geeky as I don’t mind. In essence I describe how to accomplish a loose WordPress-to-Zend integration with all the benefits I described above.</p>
<h3>Step 0: Assumptions</h3>
<p>Before I begin, there are some assumptions I’m going to make.</p>
<ol>
<li>You know how a Zend MVC application is structured.</li>
<li>Your Zend code base will be hosted on the same server as your WordPress install.</li>
<li>You are running application stacks on the same primary domain. (blog.fancybrandname.com and www.fancybrandname.com works)</li>
<li>Your Zend application will handle user authentication records. This is because you don’t necessarily want to be restricted to WordPress’ table structure.</li>
<li>Your application uses the MVC Templating System that comes with Zend.</li>
<li>The WordPress integration code will live in the plugins directory on the WordPress side and (with one notable exception) in the ~library/ directory on the Zend side.</li>
</ol>
<p>Most importantly, please understand that this implementation is NOT for the faint of heart, and requires additional code on your part. I cannot easily make any assumptions about how user authentication is handled within your Zend application, nor what models or methods you have built to simplify object retrieval.</p>
<h3>Step 1, Database: Create a linking table</h3>
<p>The first fundamental requirement is that we need some way of linking the WordPress user table (usually named wp_users) to the user table in the zend application. Usually this is done via a linking table, that might look something like this:</p>
<div class="code">
<pre>
CREATE TABLE `user_id_link_table` (
  `id_zend` bigint(20) unsigned NOT NULL,
  `id_wordpress` bigint(20) unsigned NOT NULL,
  KEY `id_zend ` (`id_zend `),
  KEY `id_wordpress ` (`id_wordpress `)
);
</pre>
</div>
<h3>Step 2, Zend and WordPress: Configure the Cookie Domain</h3>
<p>To make sure your authentication cookies are available across your two domains, you’ll need to make sure both WordPress and Zend are looking for the same cookie. The way to do this is to set a wildcard Cookie domain so it transfers from one domain to another. If you look through the various configuration files and session initialization methods, you might see entries like “www.yourdomain.com” or “blog.yourdomain.com” near a reference to a cookie domain. To make sure they transfer, replace all instances with “.yourdomain.com” (the period at the beginning is important). That should ensure that your cookies are portable.</p>
<h3>Step 3, Zend: Setting up an integration controller</h3>
<p>The first thing we need to do is make sure that your Zend Application is fully loaded. Since you might want to use view helpers in your page templates, this means that we actually have to set up a ‘dummy’ controller that is used for integration purposes only, but which doesn’t try to output anything. This is easily done:</p>
<div class="code">
<p>File: ~controllers/IntegrationController.php</p>
<pre>
&lt;?php
/**
 * The Integration Controller.
 */
class IntegrationController extends Zend_Controller_Action
{
    /**
     * Index action. Sets up the entire framework but disables output.
     */
    public function indexAction()
    {
        $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender();
    }
}
</pre>
</div>
<h3>Step 4, Zend: Extending the AutoLoader</h3>
<p>The fourth step is that we need to extend the Zend AutoLoader, because otherwise it will get confused when WordPress tries to load its plugins. Since we don’t really know which plugins will be loaded ( and thus we can’t explicitly include them in our $PATH ), we’re simply going to restrict the Zend Autoloader to restrict its activities to certain namespaces.</p>
<p>This file is called ~library/Wordpress/Loader.php</p>
<div class="code">
<p>File: ~library/Wordpress/Loader.php</p>
<pre>
&lt;?php
require_once('Zend/Loader.php');

/**
 * The WordPress loader class is a quick filter that ensures only specific application
 * libraries are passed through to load handling.
 */
class WordPress_Loader extends Zend_Loader
{
    /**
     * Override of the loadClass method.
     *
     * @param string $class
     * @param string|array $dirs
     */
    public static function loadClass($class, $dirs = null)
    {
        $parts = split("_", $class );

        switch ( $parts[0] )
        {
            case 'Zend':
            case 'Wordpress':
            case 'YourNamespace':
                parent::loadClass($class, $dirs);
        }
    }

    /**
     * This handler has to be here for Zend_Loader invocation purposes
     *
     * @param class $class
     * @return string|boolean
     */
    public static function autoload($class)
    {
        try {
            self::loadClass($class);
            return $class;
        } catch (Exception $e) {
            return false;
        }
    }
}
?&gt;
</pre>
</div>
<p>Once we’ve extended our AutoLoader, we now have to properly invoke it in our Zend Bootstrapper.</p>
<p class="note">NOTE: You may have to adjust the following code somewhat so it fits in with your application. My own application has a Bootstrap Class within which this is a private method.</p>
<div class="code">
<p>File: ~bootstrap.php</p>
<pre>
/**
 * Application Bootstrapper.
 */
class Bootstrap
{
    private function setAutoLoad()
    {
        require_once ( 'Zend/Loader.php' );
        // Notice that I'm still calling Zend_Loader, but I'm passing the new Classname.
        Zend_Loader::registerAutoload('Wordpress_Loader');
    }
}
</pre>
</div>
<h3>Step 5, Zend: Creating a Session Model</h3>
<p>This fifth step is necessary if you’re going to delegate all authentication tasks to the Zend application rather than to WordPress itself. By treating our user sessions like a CRUD-based application, we can abstract it entirely into a Model rather than keeping the code within a Controller. By doing this we can invoke the method from anywhere, including a WordPress plugin.</p>
<p class="note">NOTE: I’m putting this session class into the WordPress namespace, while it really should go into a namespace appropriate to your application.</p>
<div class="code">
<p>File: ~library/Wordpress/Model/Session.php</p>
<pre>
&lt;?php
/**
 * The session model wraps basic session creation and destruction methods
 * into one single interface.
 */
class WordPress_Model_Session extends WordPress_Model_Abstract
{
    /**
     * Creates a new session (aka logs in a user)
     *
     * @param string $user
     * @param string $password
     * @return
     */
    public function create ( $user, $password )
    {
        // Get our authentication adapter and check credentials
        $adapter    =   $this-&gt;_getAuthAdapter( $user, $password );
        $auth       =   Zend_Auth::getInstance();
        $result     =   $auth-&gt;authenticate($adapter);

        if ( !$result-&gt;isValid() )
        {
            return false;
        }
        else
        {
            // We're authenticated! Add your own logic here.

            return true;
        }
    }

    /**
     * Destroys a session (aka logs out a user)
     */
    public function destroy ( )
    {
        Zend_Session::forgetMe();
        Zend_Auth::getInstance()-&gt;clearIdentity();
    }

    /**
     * Constructs an instance of the auth adapter for this model.
     *
     * @return Zend_Auth_Adapter_DbTable
     */
    protected function _getAuthAdapter( $login, $password )
    {
        // Put your authentication plugin loader code here.

        return $adapter;
    }
}
</pre>
</div>
<h3>Step 4, Zend: Add an integration method to your Zend Bootstrapper</h3>
<p>The last thing we need to do is create a method in our bootstrapper that lets us load the entire application without Zend trying to parse the URL into which it was loaded. To do this, we create our own HTTP Request instance with a URL that invokes the Controller and Action we created in step 3, thus effectively ‘fooling’ the FrontController into thinking it was invoked from somewhere else.</p>
<div class="code">
<p>File: ~/bootstrap.php</p>
<pre>
/**
 * Application Bootstrapper.
 */
class Bootstrap
{
    /**
     * Executes the application in a bootstrapped integration state.
     */
    public function integrate()
    {
        // Construct a 'Dummy' Url to use for our Request.
        $uri = sprintf ( 'http://%s/integration/index',$_SERVER['HTTP_HOST'] );
        // Create a new request object
        $request = new Zend_Controller_Request_Http( $uri );
        // Dispatch our FrontController
        $this-&gt;_frontController-&gt;dispatch( $request );
    }
}
</pre>
</div>
<p>At this point, we’re done with all the work we need to do on the Zend side of things. On to the WordPress Plugin!</p>
<h3>Step 6, WordPress: Create a plugin</h3>
<p>The sixth step is to make sure that your entire Zend Application is available to WordPress. This is a security risk- the instant someone discovers a vulnerability in WordPress they’ve got access to everything, so make sure you have a competent PHP developer who knows how to secure an application.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
&lt;?php
/*
Plugin Name: Zend Integration Plugin
Version: 1.0.0
Description: Allows WordPress to authenticate users against the a Zend Session Model
Author: Michael Krotscheck
Author URI: http://www.krotscheck.net/
*/

class ZendIntegrationPlugin
{
    /**
     * Constructor. Initializes this class.
     */
    function __construct()
    {

    }
}

// Load the plugin hooks, etc.
$zend_integration_plugin = new ZendIntegrationPlugin();
</pre>
</div>
<h3>Step 7, WordPress: Load the Zend Framework</h3>
<p>The next step is to load your Zend application. By creating a method that explicitly loads our Bootstrapper and then invoking the integration method we created in Step 3 above, we load all necessary classes and dependencies without them interfering with WordPress.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
class ZendIntegrationPlugin
{
    function __construct()
    {
        // .... previous code ....
        $this-&gt;Wordpress_framework_init();
    }

    /**
     * Initialize the Zend framework for inclusion.
     */
    public function WordPress_framework_init()
    {
        // Import the Zend Bootstrapper. This path needs to be absolute.
        require_once ( '@APPLICATIONROOT@/bootstrap.php' );

        // Create a new Bootstrapper instance and invoke the integration method.
        $bootstrap = new Bootstrap ( );
        $bootstrap-&gt;integrate();
    }
}
</pre>
</div>
<h3>Step 8, WordPress: Disable Unnecessary Functions</h3>
<p>Since we’re delegating all session authentication tasks to your Zend application, we need to explicitly disable many of WordPress’ default functionality related to password and account management. We do this by using the application hooks created explicitly for that purpose.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
&lt;?php

class ZendIntegrationPlugin
{
    function __construct()
    {
        // ... previous code ...

        // Disable Lost Password, Retrieve Password, and Password Reset
        add_action('lost_password', array(&amp;$this, 'disable_function'));
        add_action('retrieve_password', array(&amp;$this, 'disable_function'));
        add_action('password_reset', array(&amp;$this, 'disable_function'));

        // Remove Password Fields from the wordpress user profile.
        add_filter('show_password_fields', array(&amp;$this, 'disable_password_fields'));
    }

    /**
     * Used to disable certain display elements, e.g. password
     * fields on profile screen.
     */
    function disable_password_fields($show_password_fields)
    {
        return false;
    }

    /*
     * Used to disable certain login functions, e.g. retrieving a
     * user's password.
     */
    function disable_function()
    {
        die('Disabled');
    }
}
</pre>
</div>
<h3>Step 9, WordPress: Autoload the session</h3>
<p>This is perhaps the most complex piece of the plugin, because we have to do three things: First, we have to detect whether the authentication states between your Zend application and WordPress match. If they don’t, we have to either create a wordpress session or destroy it. The tricky bit here is that WordPress requires use of its own user database, so we have to retrieve basic information from the Zend User tables and construct a WordPress user should it not already exit.</p>
<p>Unfortunately, I cannot say how your Zend application is built nor what models exist that would allow you to retrieve a user record. As such I’ve inserted pseudocode in the method below that describes what needs to happen rather than make guesses about your implementation.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
&lt;?php

class WordPressAuthenticationPlugin
{
    function __construct()
    {
        // ... previous code ...

        add_filter('plugins_loaded', array(&amp;$this, 'auto_login'));
    }

    /**
     * This method runs after the plugins is loaded, and attempts to detect
     * an out-of-sync session.
     */
    public function auto_login()
    {
        $isZendAuthenticated = Zend_Auth::getInstance()-&gt;hasIdentity();
        $isWordpressAuthenticated = is_user_logged_in();

        // Check to see if we're logged out of Zend but still logged in to WordPress
        if ( !$isZendAuthenticated &amp;&amp; $isWordpressAuthenticated )
        {
            // Log out of WordPress.
            wp_logout();
            wp_clearcookie();
            set_current_user(null);
        }

        // Check to see if we're logged in to Zend but not WordPress
        if ( $isZendAuthenticated &amp;&amp; !$isWordpressAuthenticated )
        {
            // Retrieve the user record from Zend
            $yourUserObject = yourUserRetrievalMethod();
            $wordpress_user_id = yourWordpressIdRetrievalMethod($user);

            // Check for the wordpress user ID, create a new user if necessary.
            if ( $wordpress_user_id == NULL )
            {
                // Retrieve the user creation scripts.
                require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'registration.php');

                // Create a user object, using the hashed password value (It matter doesn't what you use as long as it's unique)
                wp_create_user($yourUserObject-&gt;login, $yourUserObject-&gt;password, $yourUserObject-&gt;email);

                // Check for a successful insert
                $wordpress_user_id = username_exists($login);
                if ( !$user_id )
                {
                    die("Error creating user!");
                }
                else
                {
                    yourWordpressIdUpdateMethod($user, $user_id);
                }
            }

            // Now that we know we have an existing wordpress user record that matches our Zend Table,
            // try to create a wordpress session
            $wpUser = new WP_User($wordpress_user_id, $yourUserObject-&gt;login);
            $wpPassword = md5($yourUserObject-&gt;password);
            wp_login($yourUserObject-&gt;login, $wpPassword, true);
            wp_setcookie($yourUserObject-&gt;login, $wpPassword, true);
            wp_set_current_user($wpUser-&gt;ID, $yourUserObject-&gt;login);
            return;
        }
    }
}
</pre>
</div>
<h3>Step 10, WordPress: Enable Login via WordPress</h3>
<p>At this point we are maintaining the authenticated session across our applications, but we don’t yet have WordPress authenticating users against our Zend user table. As above, I can’t make assumptions about how your authentication is set up, but I can show you which application hooks to set up, leaving the rest of the logic for you to fill in.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
&lt;?php

class WordPressAuthenticationPlugin
{
    function __construct()
    {
        // ... previous code ...

        add_filter('check_password', array(&amp;$this, 'check_password'), 10, 4);
    }

    /**
     * Override Check Password
     */
    public function check_password($check, $password, $hash, $user_id)
    {
        // Retrieve a user by the WordPress User ID. You can use any class in your Zend application.
        $user = findZendUserByWordpressId ( $user_id );

        // Check for a valid return data.
        if ( $user )
        {
            // Try to log in.
            $sessionModel = new WordPress_Model_Session();
            return $sessionModel-&gt;create( $user-&gt;login, $password );
        }

        return false;
    }
}
</pre>
</div>
<h3>Step 11, WordPress: Enable Logout via WordPress</h3>
<p>The very last vanity task to perform is to enable logging out via the WordPress buttons. Again we use an action handler, and in this case we explicitly call the Session destroy method we created in Step 5.</p>
<div class="code">
<p>File: ~/wp-content/plugins/zend/zend.php</p>
<pre>
&lt;?php

class WordPressAuthenticationPlugin
{
    function __construct()
    {
        // ... previous code ...

        add_action('wp_logout', array(&amp;$this, 'logout'));
    }

    /**
     * Runs Logout routines against the Zend controller.
     */
    public function logout ()
    {
        $sessionModel = new WordPress_Model_Session();
        $sessionModel-&gt;destroy();
    }
}
</pre>
</div>
<div class="hr">&nbsp;</div>
<p>And that&#8217;s it. With all these pieces in place your Zend application should now be integrated with your WordPress intall. Congratulations! Now your startup has a fully functional, plugin ready CMS without being tied to a commercial solution for the long term.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krotscheck.net/2009/05/16/bootstrapping-a-startup-zend-and-wordpress-auth-integration.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Idea Foundry</title>
		<link>http://www.krotscheck.net/2008/07/10/idea-foundry.html</link>
		<comments>http://www.krotscheck.net/2008/07/10/idea-foundry.html#comments</comments>
		<pubDate>Fri, 11 Jul 2008 00:22:11 +0000</pubDate>
		<dc:creator>Michael Krotscheck</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[inspiration]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://www.krotscheck.net/?p=2121</guid>
		<description><![CDATA[<p>As a bit of an information sponge, I’ve carefully developed the ability to cross reference different knowledge domains and apply solutions from one to another. The upside of this is that many see me as a very creative individual, when I’m really just a very complex comparison algorithm. The far more problematic downside is that my mind generates so many awesome things to pursue, implement, investigate or create that I’m frequently crippled trying to pursue them all.</p><p>This spits in the face of my own personal philosophies: “Inspiration, no matter how trivial, should be pursued and encouraged”. I just don’t have enough energy, time, or brain capacity to pursue all this crap, whether substantial or whimsical, so I figured I’d start posting some of the ones I really love (but don’t have the capacity to pursue) here, just in case someone else wants to pick something up. I’ll be labeling them with the project names I used when I first started investigating them, so if you see a blog post come through called “Project [something or other]” you’ll know that it’s an idea open for grabs.</p>]]></description>
			<content:encoded><![CDATA[<p>As a bit of an information sponge, I’ve carefully developed the ability to cross reference different knowledge domains and apply solutions from one to another. The upside of this is that many see me as a very creative individual, when I’m really just a very complex comparison algorithm. The far more problematic downside is that my mind generates so many awesome things to pursue, implement, investigate or create that I’m frequently crippled trying to pursue them all.</p>
<p>This spits in the face of my own personal philosophies: “Inspiration, no matter how trivial, should be pursued and encouraged”. I just don’t have enough energy, time, or brain capacity to pursue all this crap, whether substantial or whimsical, so I figured I’d start posting some of the ones I really love (but don’t have the capacity to pursue) here, just in case someone else wants to pick something up. I’ll be labeling them with the project names I used when I first started investigating them, so if you see a blog post come through called “Project [something or other]” you’ll know that it’s an idea open for grabs.</p>
<p>I’m really not happy about publicizing them. None of these ideas will do anyone any good if I keep them to myself, yet I’m still possessive… and admitting that I do not have the capacity or time to pursue them myself is little better than admitting defeat.</p>
<p>Lastly, I make no guarantees about the profitability or viability of any of these ideas. It sounds like legal boilerplate (and to some extent is), yet once you hear some of them you’ll understand what I mean: For example, I once was infatuated about starting a chain of high-end dairy bars to challenge Starbucks. Profitable? Unlikely- milk isn’t caffeinated… unless you have a very hyperactive cow.</p>
<p>Bovine jokes aside, I hope you find something interesting, or at the very least something inspiring.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krotscheck.net/2008/07/10/idea-foundry.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Launching Cruise Control during Startup on OSX</title>
		<link>http://www.krotscheck.net/2008/06/22/launching-cruise-control-during-startup-on-osx.html</link>
		<comments>http://www.krotscheck.net/2008/06/22/launching-cruise-control-during-startup-on-osx.html#comments</comments>
		<pubDate>Mon, 23 Jun 2008 04:25:30 +0000</pubDate>
		<dc:creator>Michael Krotscheck</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[auto launch]]></category>
		<category><![CDATA[cruise control]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://www.practicalflash.com/tutorials/launching-cruise-control-during-startup-on-osx/</guid>
		<description><![CDATA[<p>I spent a good amount of time today trying to figure out how to turn my "old" iMac into a development environment, which included installing Cruise Control. Since I didn't want to run the launch script manually, I tried (and failed) to find someone who's successfully gotten cruise to autostart on boot. A bit of investigation later and I came up with a solution, drawn from an excellent blog post on <a href="http://egopoly.com/2008/03/26/add-your-own-command-script-to-mac-os-x/">adding your own osx boot launch scripts</a>, an archive script on <a href="http://confluence.public.thoughtworks.org/display/CC/RunningCruiseControlFromUnixInit">launching cruise on unix init</a>, and the tacit information in the MySQLCOM Bootstrapper contained in the OSX Binary Distribution.</p>]]></description>
			<content:encoded><![CDATA[<p>I spent a good amount of time today trying to figure out how to turn my &#8220;old&#8221; iMac into a development environment, which included installing Cruise Control. Since I didn&#8217;t want to run the launch script manually, I tried (and failed) to find someone who&#8217;s successfully gotten cruise to autostart on boot. A bit of investigation later and I came up with a solution, drawn from an excellent blog post on <a href="http://egopoly.com/2008/03/26/add-your-own-command-script-to-mac-os-x/">adding your own osx boot launch scripts</a>, an archive script on <a href="http://confluence.public.thoughtworks.org/display/CC/RunningCruiseControlFromUnixInit">launching cruise on unix init</a>, and the tacit information in the MySQLCOM Bootstrapper contained in the OSX Binary Distribution.</p>
<h3>Step 1: Download and Install Cruise Control</h3>
<p>You can download Cruise Control from <a href="http://cruisecontrol.sourceforge.net/">Sourceforge</a>. For the purpose of this demo I&#8217;ve used the binary distribution, though you can compile your own. Once you&#8217;ve downloaded your distribution, unzip it into a convenient directory. I&#8217;ve used the base applications directory: /Applications/CruiseControl.</p>
<h3>Step 2: Create a User</h3>
<p>It&#8217;s best practice to not run cruise as root, so open up your user accounts and create a new user called Cruise Control.</p>
<h3>Step 3: Create a folder in the StartupItems directory.</h3>
<pre>
$ sudo mkdir /Library/StartupItems/CruiseControl
</pre>
<h3>Step 4: Create the Parameters File</h3>
<p>Create a file called /Library/StartupItems/CruiseControl/StartupParameters.plist. This file will contain your startup launch configuration information- in other words it&#8217;s a file describing your startup task.</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	&lt;key&gt;Description&lt;/key&gt;
	&lt;string&gt;Cruise Control&lt;/string&gt;
	&lt;key&gt;OrderPreference&lt;/key&gt;
	&lt;string&gt;None&lt;/string&gt;
	&lt;key&gt;Provides&lt;/key&gt;
	&lt;array&gt;
		&lt;string&gt;CruiseControl&lt;/string&gt;
	&lt;/array&gt;
	&lt;key&gt;Uses&lt;/key&gt;
	&lt;array&gt;
		&lt;string>Network&lt;/string&gt;
	&lt;/array&gt;
	&lt;/dict&gt;
&lt;/plist&gt;
</pre>
<h3>Step 5: Create/Configure the launch script</h3>
<p>The launch script needs to be command line executable with the following three options: start, stop, reset. I&#8217;ve included my sample here, but I recommend you adjust it to match your own configuration and user name.</p>
<pre>
#!/bin/sh
#
# Error out when no parameter given
if [ -z $1 ] ; then
	echo "Usage: $0 [start|stop|restart] "
	exit 1
fi

# Source the common setup functions for startup scripts
test -r /etc/rc.common || exit 1
. /etc/rc.common

###################################################################################################
# USER CONFIGURATION

# The user under which CruiseControl should run.
CC_USER=cruisecontrol

# Cruise Install Directory
CC_INSTALL_DIR=/Applications/CruiseControl

# Directory for the config.xml file.
CC_WORK_DIR=$CC_INSTALL_DIR

# Logfile Directory
CC_LOGFILE_DIR=$CC_INSTALL_DIR

# Port under which Cruise should run
CC_WEBPORT=8080

# JMX Port. It's suggested you don't change this unless the port is already in use.
CC_JMXPORT=8082

# Port for the RMI gateway, leave blank to disable.
CC_RMIPORT=

###################################################################################################
# DO NOT MODIFY ENTRIES BELOW THIS LINE

NAME=cruisecontrol
DESC="CruiseControl - continuous integration build loop"

PATH=/sbin:/usr/sbin:/usr/bin:/bin
export PATH

CC_DAEMON=$CC_INSTALL_DIR/cruisecontrol.sh
CC_CONFIG_FILE=$CC_WORK_DIR/config.xml
CC_LOG_FILE=$CC_LOGFILE_DIR/cruisecontrol.log
CC_COMMAND="$CC_DAEMON -configfile $CC_CONFIG_FILE -webport $CC_WEBPORT -jmxport $CC_JMXPORT -rmiport $CC_RMIPORT -user youruser -password supersecret"

# overwrite settings from default file
if [ -f /etc/default/cruisecontrol ]; then
  . /etc/default/cruisecontrol
fi

# does the executable exist?
test -f $CC_DAEMON || (echo "The executable $CC_DAEMON does not exist!" &#038;&#038; exit 0)

if [ `id -u` -ne 0 ]; then
        echo "Not starting/stopping $DESC, you are not root."
        exit 4
fi

# Get the PID output from the startup script
if [ -f $CC_INSTALL_DIR/cc.pid ]; then
	CC_PID=`cat $CC_INSTALL_DIR/cc.pid`
else
	echo "No cc.pid file found.  CC process may not be controllable from this script!"
fi

StartService ()
{
	cd $CC_INSTALL_DIR
	su $CC_USER -c "/bin/sh -c \"$CC_COMMAND >> $CC_LOG_FILE 2>&#038;1\"" &#038; RETVAL=$?
	echo "$NAME started with jmx on port ${CC_JMXPORT}"
}

StopService ()
{
	if [ -n "$CC_PID" ] &#038;&#038; ps -p ${CC_PID} > /dev/null ; then
		kill -9 ${CC_PID}
		RETVAL=$?
	else
		echo "$NAME is not running"
		RETVAL=1
	fi
}

RestartService ()
{
	RunService "stop"
	RunService "start"
}

RunService "$1"
</pre>
<h3>Step 6: Set permissions</h3>
<p>Given that the startup script will ignore anything that isn&#8217;t owned by root, and right now cruise still doesn&#8217;t have write access to the cruise install dir, we have to make a few adjustments to our file structure to make this work.</p>
<pre>
$ sudo chown -R cruisecontrol /Applications/CruiseControl
$ sudo chown -R root /Library/StartupItems/CruiseControl
$ sudo chmod 755 /Library/StartupItems/CruiseControl/CruiseControl
</pre>
<p>That&#8217;s it. I hope this was helpful</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krotscheck.net/2008/06/22/launching-cruise-control-during-startup-on-osx.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

