<?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>Justin Carmony &#187; Justin Carmony</title>
	<atom:link href="http://www.justincarmony.com/blog/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justincarmony.com/blog</link>
	<description>Web Designer &#38; Software Engineer</description>
	<lastBuildDate>Wed, 01 Feb 2012 04:30:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Making a Distributed Workforce Work</title>
		<link>http://www.justincarmony.com/blog/2012/01/31/making-a-distributed-workforce-work/</link>
		<comments>http://www.justincarmony.com/blog/2012/01/31/making-a-distributed-workforce-work/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 04:30:16 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[distributed workforce]]></category>
		<category><![CDATA[employees]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1097</guid>
		<description><![CDATA[I&#8217;ve been mulling over this blog post in my mind for quite awhile. I&#8217;ve been working exclusively for distributed companies since 2008. Also know as telecommuting and virtual workforce, it basically is when you have employees working for you regardless of location. Whether it is home, a co-working space, or another office space they prefer, ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/02/04/the-skill-of-making-habits/' rel='bookmark' title='The Skill of Making Habits'>The Skill of Making Habits</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/03/mac-keyboard-quirks-making-mac-more-like-windows/' rel='bookmark' title='Mac Keyboard Quirks &#8211; Making Mac more like Windows'>Mac Keyboard Quirks &#8211; Making Mac more like Windows</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/06/29/lifehacker-making-your-mac-sing/' rel='bookmark' title='Lifehacker &#8211; Making your Mac sing!'>Lifehacker &#8211; Making your Mac sing!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been mulling over this blog post in my mind for quite awhile. I&#8217;ve been working exclusively for distributed companies since 2008. Also know as telecommuting and virtual workforce, it basically is when you have employees working for you regardless of location. Whether it is home, a co-working space, or another office space they prefer, its when an employee can work for a company other then the office.</p>
<p>I&#8217;ve met and talked with several companies that have had a great success with this approach. Toni Schneider, CEO at <a href="http://automattic.com/">Automattic</a>, has written about the <a href="http://toni.org/2010/03/08/5-reasons-why-your-company-should-be-distributed/">5 reasons why your company should be distributed</a>. </p>
<p>But on the flip side, I&#8217;ve met a few developers, managers, and owners who have horror stories of how it &#8220;didn&#8217;t work out at all.&#8221; They talk about how these workers were too distant from their team, how they didn&#8217;t communicate well, and struggled to get them to produce. </p>
<p>These are legitimate concerns and challenges face businesses. However, I think there is one key thing businesses can do to help minimize these challenges and make their attempts to bring in a distributed workforce a reality. At to show how it can be done, we&#8217;ll use our fictional company, Muppets Software Inc:</p>
<h3>Our Example: The Muppets</h3>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/836_D_03870_R.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/836_D_03870_R-300x200.jpg" alt="" title="DISNEY THE MUPPETS" width="300" height="200" class="alignnone size-medium wp-image-1098" /></a></p>
<p>Muppets Software is a company that produces the finest websites. They have a small office out in California and are doing pretty well. Their team consists of:</p>
<p><strong>Kermit &#8211; The Manager</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Kermit-the-frog.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Kermit-the-frog-150x150.jpg" alt="" title="Kermit-the-frog" width="150" height="150" class="alignnone size-thumbnail wp-image-1101" /></a></p>
<p><strong>Fozzie &#8211; Lead Developer</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Fozzie2.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Fozzie2-150x150.jpg" alt="" title="Fozzie2" width="150" height="150" class="alignnone size-thumbnail wp-image-1102" /></a></p>
<p><strong>Rizzo &#8211; Junior Developer</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/RizzoTheRat.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/RizzoTheRat-150x150.jpg" alt="" title="RizzoTheRat" width="150" height="150" class="alignnone size-thumbnail wp-image-1103" /></a></p>
<p><strong>Gonzo &#8211; Lead Sys-Admin</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Gonzo2.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Gonzo2-150x150.jpg" alt="" title="Gonzo2" width="150" height="150" class="alignnone size-thumbnail wp-image-1104" /></a></p>
<p><strong>Miss Piggy &#8211; Sales</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Miss-piggy-the-muppets.png"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Miss-piggy-the-muppets-150x150.png" alt="" title="Miss-piggy---the-muppets" width="150" height="150" class="alignnone size-thumbnail wp-image-1105" /></a></p>
<p>Things are going very well, but they are getting too busy, and to expand they need to bring on another developer. After a great deal of searching, they find an excellent candidate: </p>
<p><strong>Beaker &#8211; Awesome Developer</strong></p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Beaker.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2012/01/Beaker-150x150.jpg" alt="" title="Beaker" width="150" height="150" class="alignnone size-thumbnail wp-image-1106" /></a></p>
<p>There is only one problem, he lives in New York and can&#8217;t move to California. But he seems perfect, so Kermit decides to try having him be a remote worker. Fozzie and Rizzo think he&#8217;ll be good, so they hire him. It starts off pretty well at first, and they assign Beaker to help Fozzie with the new Sesame Street website. They decide to use a ticket system to help better manage what they need to get done, and set off to work.</p>
<p>After a time it seems Beaker would drop the ball and not get something done. It would be 4 PM in California, and Fozzie couldn&#8217;t get ahold of Beaker, so he would just have Rizzo do it. The next day Fozzie talked to Beaker, to find out Beaker hadn&#8217;t been in the impromtu meeting where this change was requested and didn&#8217;t know about it. </p>
<p>As time goes on, Gonzo starts to get annoyed with Beaker. It seems he would always come into the office with a list of things asking to be done. Since company policy says only Gonzo can make changes on production servers, he is suppose to be the only one to do it. Fozzie and Rizzo both have access to the production servers, and they have an unspoken agreement that the developers can make small changes to production servers as long as they stick their head in Gonzo&#8217;s cube and run it by him first. Of course, Beaker is unaware of this fact, so he continues to write requests to Gonzo.</p>
<p>Its coming down to crunch time with the Sesame project, and Miss Piggy is worried that they&#8217;ll miss their deadline. She keeps asking for last minute changes to make the site better for the client, so several nights she buys pizza for the office and she stays up late with the Developers to work overtime. She even calls Beaker to have him help out, but he is always the one to leave early, and seems the least effective out of everyone.</p>
<p>After the Sesame project, Gonzo, Fozzie, Rizzo and Miss Piggy talk with Kermit about their concerns with Beaker. They say he is a nice guy, but its been hard working with him. They say there isn&#8217;t one big incident, but rather it is just an overall vibe. </p>
<p>Kermit calls up Beaker and has a nice chat with him. Beaker says he feels bad the others feel this way, and shares some of his frustrations as well. He has a hard time staying up so late with the team on these late-night pushes, and many times tickets aren&#8217;t updated with the information he needs. Kermit sees his point, but doesn&#8217;t really know what to do to solve the problems. They&#8217;ve talked many times about keeping the ticket system up-to-date, but when things get busy, its so easy for the in-house employees to forget.</p>
<p><strong>What to do?</strong></p>
<p>I&#8217;ve seen and heard these problems, and I&#8217;ve even been in Beaker&#8217;s shoes in the past with a short-term project. </p>
<p>The bottom line is that it boils down to a problem with communication. It is so hard for remote developers to keep up with everything when there is a lot of communication that is happening outside of his reach. He isn&#8217;t at lunch with the other co-workers, or around the water cooler. He listens mostly to the meetings since it is so hard to get a word in without being there.</p>
<p>So what would be my recommendation? <strong>Turn your entire company into a distributed company.</strong></p>
<p>Wait, what? I&#8217;m not suggesting a company immediately close it&#8217;s offices. But allow the rest of your employees telecommute as well. I&#8217;d say at least 3 out of the 5 days a week. </p>
<p>As a manager, this is a scary thing. But what this does is naturally change the communication channels. So instead of awkward channels of communication forced on the employees to use, these channels become the channels of communication that empower their own work. They get to enjoy the benefits of telecommuting, regardless of where they live, just like Beaker.</p>
<p>When everyone uses the same channels of communication, all of a sudden being 10 miles away or 1000 miles away does not matter. It will become a much more natural process to send emails, update tickets, and chat online. Even when people are in the office, these channels will tend to stay the primary methods of communication.</p>
<p>Almost all of the most successful distributed companies are 100% distributed, not just 10%. I really do think that is the key. Even with Dating DNA, where I lived in Utah and the rest of the team (all 3 of them) lived in San Diego, we were a very distributed team. Our iPhone Dev only met face-to-face with the owner/project manager of the company once or twice a year, even though they lived 15 minutes from each other. Even when we go to expand our team, I like knowing that if we found the perfect match for a new employee, we can hire them regardless of physical boundaries.</p>
<p>Now, this isn&#8217;t a silver bullet approach. There is a lot more to making a distributed workforce work. <strong>However,</strong> I think the <strong>key</strong> is for this paradigm shift in thought: we&#8217;re not just hiring a remote worker, we becoming a distributed company.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/02/04/the-skill-of-making-habits/' rel='bookmark' title='The Skill of Making Habits'>The Skill of Making Habits</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/03/mac-keyboard-quirks-making-mac-more-like-windows/' rel='bookmark' title='Mac Keyboard Quirks &#8211; Making Mac more like Windows'>Mac Keyboard Quirks &#8211; Making Mac more like Windows</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/06/29/lifehacker-making-your-mac-sing/' rel='bookmark' title='Lifehacker &#8211; Making your Mac sing!'>Lifehacker &#8211; Making your Mac sing!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2012/01/31/making-a-distributed-workforce-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMS Nagios Notifications with PHP &amp; Twilio</title>
		<link>http://www.justincarmony.com/blog/2012/01/30/sms-nagios-notifications-with-php-twilio/</link>
		<comments>http://www.justincarmony.com/blog/2012/01/30/sms-nagios-notifications-with-php-twilio/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 01:12:14 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[twilio]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1089</guid>
		<description><![CDATA[I&#8217;ve had a few requests to share my Nagios SMS notifications using Twilio. I&#8217;m almost embarrassed to share them, since they are so dead simple. There was another plugin out there to do the same, but it was a lot more advanced and more work to setup, so I wrote my own in PHP. In ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/05/04/setting-up-nagios-for-servers/' rel='bookmark' title='Setting up Nagios for Servers'>Setting up Nagios for Servers</a></li>
<li><a href='http://www.justincarmony.com/blog/2009/10/11/presentation-real-life-scaling/' rel='bookmark' title='Presentation: Real Life Scaling'>Presentation: Real Life Scaling</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/02/24/bestbuy-gives-me-8770-wait-just-87-00/' rel='bookmark' title='BestBuy Gives Me $8,770 &#8212; Wait, Just $87.00'>BestBuy Gives Me $8,770 &#8212; Wait, Just $87.00</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a few requests to share my <a href="http://www.nagios.org/">Nagios</a> SMS notifications using <a href="http://www.twilio.com/">Twilio</a>. I&#8217;m almost embarrassed to share them, since they are so dead simple. There was another plugin out there to do the same, but it was a lot more advanced and more work to setup, so I wrote my own in PHP.</p>
<p>In the past I would just use my iPhone&#8217;s email-to-txt email address. However, when I received the txt message, it wasn&#8217;t formated very pretty, and it would have a different &#8220;From Number.&#8221; So if we had a crazy day, I would have 20-30 message threads in my iPhone all about Nagios. I&#8217;ve been lazy in the past, and didn&#8217;t clear them out until I had about 200 of them, and it was a lot of &#8220;swipe, delete, swipe, delete, swipe, delete&#8221; to get rid of them.</p>
<p>What I like out this setup is with Twilio, I can buy a phone number for $1 a month. So all my notifications come through the same number. I&#8217;m also planning a way to call/text the number and it will read/send the current status and list the hosts that are down.</p>
<p>First thing is to get your Twilio account setup. Its pretty easy, and when I signed up (a long time ago) I got $30 in credit, not sure if they are doing that still for new customers. Either way you can add a credit card and say how much credit you want to add when your account dips below a certain amount. </p>
<p>Now, you can buy a number and set it up. Even if you&#8217;re only sending text messages, Twilio wants you to have a &#8220;SMS Request URL&#8221; before you can send any text messages. So I just put in a URL to my site that does nothing (yet). You&#8217;ll need to grab your Account SID and Token.</p>
<p><strong>How it Works</strong></p>
<p>I threw <a href="https://github.com/JustinCarmonyDotCom/Nagios-SMS-Requests-with-PHP-Twilio">the code up on GitHub</a>. There are a few things you&#8217;ll need to do:</p>
<p>First in sendTextMsg.php change your configurations to match your phone number, account SID and token. Here is the entire sendTextMsg.php file:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

require('twilio-php/Services/Twilio.php');

/* Start Configs */

$sid = &quot;A123.....&quot;;
$token = &quot;29d6b9f.......&quot;;
$twilio_number = '4045550101';

/* End Configs */

# Get the Argvs
$phone  = $argv[1];
$msg    = $argv[2];
$msg    = str_replace('\n', &quot;\n&quot;, $msg);

$client = new Services_Twilio($sid, $token);
try
{
    $message = $client-&gt;account-&gt;sms_messages-&gt;create(
        $twilio_number, // From a valid Twilio number
        $phone, // Text this number
        $msg
    );
} catch (Exception $ex)
{
    var_dump($ex);
}
</pre>
<p>As you can see, it is super simple. All you need to do is put this script somewhere with the Twilio PHP libraries (or just use my github code with all of it in there). Then, in your Nagios configurations add the commands:</p>
<code class="code">define command{
    command_name    notify-host-by-txt
    command_line    /usr/bin/php /path/to/sendTxtMsg/sendTxtMsg.php &quot;$CONTACTPAGER$&quot; &quot;Nagios Alert\nType: $NOTIFICATIONTYPE$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nWhen: $LONGDATETIME$&quot;
}

define command{
    command_name    notify-service-by-txt
    command_line    /usr/bin/php /path/to/sendTxtMsg/sendTxtMsg.php &quot;$CONTACTPAGER$&quot; &quot;Nagios Alert\nType: $NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nWhen: $LONGDATETIME$&quot;
}</code>
<p>Then you need to add it to your contacts:</p>
<code class="code">define contact {
        contact_name                    justin
        alias                           Justin Carmony
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        
        # Add the new commands to your list
        service_notification_commands   notify-service-by-email,notify-service-by-txt
        host_notification_commands      notify-host-by-email,notify-host-by-txt
        email                           justin@example.com
        
        # Add a pager number, cause we rock it old school 
        # like that: http://static.howstuffworks.com/gif/restaurant-pager-motorola.jpg
        pager                           4045551234
}</code>
<p>Simple, easy, and works very well. You can test the script by simply executing the command:</p>
<code class="code">php /path/to/sendTxtMsg.php 4045551234 &quot;This is my test.\nI am awesome.\n&quot;</code>
<p>Enjoy!</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/05/04/setting-up-nagios-for-servers/' rel='bookmark' title='Setting up Nagios for Servers'>Setting up Nagios for Servers</a></li>
<li><a href='http://www.justincarmony.com/blog/2009/10/11/presentation-real-life-scaling/' rel='bookmark' title='Presentation: Real Life Scaling'>Presentation: Real Life Scaling</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/02/24/bestbuy-gives-me-8770-wait-just-87-00/' rel='bookmark' title='BestBuy Gives Me $8,770 &#8212; Wait, Just $87.00'>BestBuy Gives Me $8,770 &#8212; Wait, Just $87.00</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2012/01/30/sms-nagios-notifications-with-php-twilio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Nginx Configuration Trick</title>
		<link>http://www.justincarmony.com/blog/2012/01/13/debugging-nginx-configuration-trick/</link>
		<comments>http://www.justincarmony.com/blog/2012/01/13/debugging-nginx-configuration-trick/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 02:24:49 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[syste]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1081</guid>
		<description><![CDATA[Today I had an issue where I was trying to debug a problem with an nginx configuration, I came up with a simple trick. One of the hardest parts of nginx configurations, especially with rewrites, is you might not know which &#8220;location&#8221; directive is not working as expected. In PHP, sometimes you would just add ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2011/01/24/php-nginx-and-output-flushing/' rel='bookmark' title='PHP, Nginx, and Output Flushing'>PHP, Nginx, and Output Flushing</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/10/24/setting-up-nginx-php-fpm-on-ubuntu-10-04/' rel='bookmark' title='Setting Up Nginx &amp; PHP-FPM on Ubuntu 10.04'>Setting Up Nginx &#038; PHP-FPM on Ubuntu 10.04</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/05/31/simple-trick-history-command/' rel='bookmark' title='Simple Trick: History Command'>Simple Trick: History Command</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I had an issue where I was trying to debug a problem with an <a href="http://nginx.org/">nginx</a> configuration, I came up with a simple trick. One of the hardest parts of nginx configurations, especially with rewrites, is you might not know which &#8220;location&#8221; directive is not working as expected.</p>
<p>In PHP, sometimes you would just add something like this:</p>
<pre class="brush: php; title: ; notranslate">
echo &quot;I'm here!&quot;;
exit();
</pre>
<p>However, in Nginx configuration files, it isn&#8217;t as easy&#8230;</p>
<p>&#8230; or is it?</p>
<p>One thing that works well is the rewrite directive. You can append variables to the URL to be rewritten. Another great thing is a rewrite statement can go just about anywhere. So lets say we were trying to debug this location statement:</p>
<code class="code">location ~ /api/.*\.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  /path/to/www/$fastcgi_script_name;
}</code>
<p>Now lets say its returning a 404, and I&#8217;m not 100% sure what the actual value of $fastcgi_script_name is. I can add this to it:</p>
<code class="code">location ~ /api/.*\.php$ {
    ## ADD HERE
    redirect ^ http://www.google.com/?q=$fastcgi_script_name last; break;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  /path/to/www/$fastcgi_script_name;
}</code>
<p>This will redirect your HTTP request to Google.com and put the value in the query textfield. Bingo, I can easily see the actual value! Pretty helpful when you have a large, complex server definition.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2011/01/24/php-nginx-and-output-flushing/' rel='bookmark' title='PHP, Nginx, and Output Flushing'>PHP, Nginx, and Output Flushing</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/10/24/setting-up-nginx-php-fpm-on-ubuntu-10-04/' rel='bookmark' title='Setting Up Nginx &amp; PHP-FPM on Ubuntu 10.04'>Setting Up Nginx &#038; PHP-FPM on Ubuntu 10.04</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/05/31/simple-trick-history-command/' rel='bookmark' title='Simple Trick: History Command'>Simple Trick: History Command</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2012/01/13/debugging-nginx-configuration-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Letter to Senator Lee</title>
		<link>http://www.justincarmony.com/blog/2012/01/13/letter-to-senator-lee/</link>
		<comments>http://www.justincarmony.com/blog/2012/01/13/letter-to-senator-lee/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 19:19:47 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[pipa]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[sopa]]></category>
		<category><![CDATA[utah]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1079</guid>
		<description><![CDATA[My letter to Senator Lee: Senator Lee, My name is Justin Carmony, and I am the C.T.O. for Dating DNA, LLC, a company that makes iPhone Apps. This is my first time writing a senator, but I feel it is important to convey my thoughts on SOPA and PIPA. We have struggled with people downloading ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/08/28/comcast-limit-to-250gb-a-month-for-residential/' rel='bookmark' title='Comcast Limit to 250GB a month for Residential'>Comcast Limit to 250GB a month for Residential</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/02/02/google-apps-dropping-ie-6/' rel='bookmark' title='Google Apps Dropping IE 6'>Google Apps Dropping IE 6</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/21/yahoo-vs-rhapsody-why-yahoo-lost/' rel='bookmark' title='Yahoo vs. Rhapsody &#8211; Why Yahoo Lost'>Yahoo vs. Rhapsody &#8211; Why Yahoo Lost</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><em>My letter to Senator Lee:</em></p>
<p>Senator Lee,</p>
<p>My name is Justin Carmony, and I am the C.T.O. for Dating DNA, LLC, a company that makes iPhone Apps. This is my first time writing a senator, but I feel it is important to convey my thoughts on SOPA and PIPA.</p>
<p>We have struggled with people downloading our Apps from 3rd Party Websites and not paying for them. We are able to monitor and track these &#8220;cracked&#8221; apps when they connect to our services, and these &#8220;cracked apps&#8221; number in the hundreds of thousands over time. That is potentially millions of dollars in lost revenue. </p>
<p>However, I do NOT support SOPA, PIPA, or bills like it that give &#8220;blacklist&#8221; or &#8220;takedown&#8221; authority without due process.</p>
<p>Even though we struggle with piracy, these bills will do very little in preventing unauthorized distribution of copyrighted materials. However, they are extremely dangerous in terms of abuse against legitimate businesses. Even though the cost of piracy can be great, we already have tools and laws to help us minimize piracy. We work hard at providing a great service, and we&#8217;ve even successfully turned &#8220;pirates&#8221; into &#8220;legal, legitimate customers.&#8221; SOPA &#038; PIPA will do very little in helping us stop real piracy, but will also expose us to &#8220;takedowns claims&#8221; without any oversight or due process.</p>
<p>There is already testimonies on legal records of Media Companies such as Warner Music and Universal Music group admitting to using DMCA to take down content they had no copyright ownership to. Their motives instead were to silence groups being critical of them. (see &#8220;A Business Person&#8217;s SOPA Primer&#8221; &#8212; <a href="http://avoidingagoatrodeo.com/2011/12/26/a-businesspersons-sopa-primer/">http://avoidingagoatrodeo.com/2011/12/26/a-businesspersons-sopa-primer/</a>)</p>
<p>Please, as my elected representative, pull your support of SOPA. Our small business would not survive a &#8220;takedown&#8221; if a competitor used SOPA with false claims. We depend on the internet to keep us in business. I hope you can see, and understand, that due process and legal oversight should still apply to the internet.</p>
<p>Thank you,</p>
<p>Justin Carmony<br />
Utah Citizen</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/08/28/comcast-limit-to-250gb-a-month-for-residential/' rel='bookmark' title='Comcast Limit to 250GB a month for Residential'>Comcast Limit to 250GB a month for Residential</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/02/02/google-apps-dropping-ie-6/' rel='bookmark' title='Google Apps Dropping IE 6'>Google Apps Dropping IE 6</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/21/yahoo-vs-rhapsody-why-yahoo-lost/' rel='bookmark' title='Yahoo vs. Rhapsody &#8211; Why Yahoo Lost'>Yahoo vs. Rhapsody &#8211; Why Yahoo Lost</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2012/01/13/letter-to-senator-lee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Workers with Redis &amp; Solo</title>
		<link>http://www.justincarmony.com/blog/2012/01/10/php-workers-with-redis-solo/</link>
		<comments>http://www.justincarmony.com/blog/2012/01/10/php-workers-with-redis-solo/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 18:20:10 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[solo]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[workers]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1072</guid>
		<description><![CDATA[I&#8217;ve come across an awesome combination of tools for managing PHP Workers, and thought I&#8217;d share. Why Workers? Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don&#8217;t want to make the user wait after pressing a button. This is ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2011/05/23/mysql-redis-and-a-billion-rows-a-love-story/' rel='bookmark' title='MySQL, Redis, and a Billion Rows &#8211; A Love Story'>MySQL, Redis, and a Billion Rows &#8211; A Love Story</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/01/07/creating-chatroom-walls-with-redis-and-php/' rel='bookmark' title='Creating Chatroom / Walls with Redis &amp; PHP'>Creating Chatroom / Walls with Redis &#038; PHP</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/01/10/debugging-with-php-stack-traces-and-redis/' rel='bookmark' title='Debuging with PHP, Stack Traces, and Redis'>Debuging with PHP, Stack Traces, and Redis</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come across an awesome combination of tools for managing PHP Workers, and thought I&#8217;d share.</p>
<h3>Why Workers?</h3>
<p>Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don&#8217;t want to make the user wait after pressing a button. This is where &#8220;Workers&#8221; can come in. They are independent scripts that run along side of your application, performing tasks, or &#8220;jobs.&#8221; </p>
<p>An example is with Dating DNA and our score system. We generate scores between users to show how compatible they are with each other. When a user signs up, or makes a significant change to their profile questionnaire, we need to run a job to query our database, build a list of potential users, and generate scores. This takes 10-20 seconds, and while it is pretty fast, we don&#8217;t want to make the user wait for that. So we queue up a job for the user, divide up the work among several workers, and process the work.</p>
<h3>General Concept</h3>
<p>For this post, we&#8217;ll use the example of generating reports. Lets say on your internal website there is a button that you can click and it will email the user a report, and the report takes 2-3 minutes to generate. When the button is clicked, your code will insert the job into the queue. Meanwhile, workers are monitoring the queue. A worker script will pull the job off the queue, process the report, and send the email when its done.</p>
<p>For the queue management, we&#8217;ll use Redis. To let PHP read and write data to Redis, we&#8217;ll use the PHP Library <a href="https://github.com/nrk/predis">predis</a>. In our examples we&#8217;ll use PHP 5.3, however predis has a PHP 5.2 backport if you are not running 5.3.</p>
<h3>Adding Jobs</h3>
<p>To add jobs, we&#8217;ll need to connect to our Redis server:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Connecting to Redis
 */

const REDIS_HOST = '127.0.0.1';
const REDIS_PORT = 6379;

$predis = new Predis\Client(array(
    'scheme' =&gt; 'tcp',
    'host'   =&gt; REDIS_HOST,
    'port'   =&gt; REDIS_PORT,
));
</pre>
<p>We&#8217;ll assume in all of our examples that we&#8217;ve done the following above &#038; connected to Redis. <span id="more-1072"></span></p>
<p>Now, to manage our queues we&#8217;ll use the Redis Datatype LIST. Whats awesome about lists is that regardless of size, adding or removing at the start or end of a list is extremely fast. So if your queue has 10 items, or 10,000,000 items, Redis wil be able to push and pop entries quickly.</p>
<p>We&#8217;ll have three queues, one for each priority: high, normal, and low. For the Redis key names, we&#8217;ll use queue.priority.high, queue.priority.normal, etc. When interacting with lists, you work with the ends, one called right, the other called left. So we&#8217;ll add items on the right with the RPUSH (Right Push) command, and we&#8217;ll pull items off the left with the BLPOP (Blocking Left Pop) command. We won&#8217;t worry about the pulling items just yet.</p>
<p>You store strings as the values for the list. My personal preference is to store JSON objects so you can easily pass variables needed to perform the job.</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Adding items to the queue
 */

$job = new stdClass();
$job-&gt;id = 1;
$job-&gt;report = 'general';
$job-&gt;email = 'test@example.com';

// Add the job to the high priority queue
$predis-&gt;rpush('queue.priority.high', json_encode($job));

// Or, you could add it to the normal or low priority queue.
$predis-&gt;rpush('queue.priority.normal', json_encode($job));
$predis-&gt;rpush('queue.priority.low', json_encode($job));
</pre>
<p>Simple enough! Having different queue priorities is very beneficial in managing which jobs should get done first. For example, you might have an Executive&#8217;s request go into the high priority queue so they get the report quickly. You might also have a weekly cron that queues up reports to be sent automatically, so those can go in the low priority as to not disrupt people trying to get a manual report.</p>
<p>Now, on to the worker&#8217;s code.</p>
<h3>Processing Jobs</h3>
<p>For now, lets say we have a script running in the PHP CLI (Command Line Interface) that you started by running this command on the server:</p>
<code class="code">php /path/to/worker.php</code>
<p>First thing is we want this worker to work continuously, so we can do a while loop:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Simple Continuous While Loop
 */

// Always True
while(1)
{
	/* ... perform tasks here ...  */
}
</pre>
<p>We&#8217;ll worry about making them more intelligent later. Now, let&#8217;s have our worker check the queue. You can do so with the BLPOP command:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Checking the Queue
 */
$job = $predis-&gt;blpop('queue.priority.high'
						, 'queue.priority.normal'
						, 'queue.priority.low'
						, 10);
</pre>
<p>What we&#8217;re telling PHP to do is to check each queue in order of priority: high, normal, and then low. If it finds an item, it will immediately return an array with the name of the queue it came from, and the string of data that was pulled.</p>
<p>The B in BLPOP is &#8220;blocking.&#8221; What that means is that Redis will wait until either an item enters one of the queues, or the timeout is reached. In this case, the timeout is 10 seconds. So instead of polling (checking every few seconds in a loop), we check and wait, and after 10 seconds it will return null and we can check again.</p>
<p>What this gives us is near instantaneous queues. As soon as something is available, it is passed to the workers that are listening. You can also have multiple workers, and it will pass jobs to the first listening worker, and the next job to the next worker, so you don&#8217;t have to worry about multiple workers getting the same queued item.</p>
<p>After $predis->blpop() returns, if it has an array, it returned an item. If not, the timeout had been reached. We can check to see if a Job was returned, and if so to process the job:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Checking to see if a Job was returned
 */

if($job)
{
	// Index 0 of the array holds which queue was returned
	$queue_name = $job[0];
	// Index 1 of the array holds the string value of the job.
	// Since we are passing it JSON, we'll decode it:
	$details = json_decode($job[1]);

	/* ... do job work ... */
}
</pre>
<p>Now we can have multiple workers listening to the same queues and scale our workload. Redis is very fast &#038; efficient, and you could have hundreds or even thousands of workers listening to a single redis server.</p>
<h3>Continuously Running Workers</h3>
<p>There are a lot of options when it comes to deploying these workers. You can use a framework like Gearman, but for simple things, I like very simple solutions. I came across a <a href="http://josephscott.org/archives/2011/09/solo/">blog post by Joseph Scott</a> about a little 10 line perl script called <a href="http://timkay.com/solo/solo">solo</a>. What it does is it will run a command, and to ensure that no one else is running that same exact command, it will lock a configurable port. This is awesome because the you don&#8217;t have to work about lock files or filesystem tricks, the kernel handles it all. </p>
<p>So what you can do is create a cronjob using solo to execute your script. First copy solo somewhere, I put it in my /usr/local/bin on my linux server. Then add this to your cron job using the command &#8220;crontab -e -u (which user to use)&#8221;:</p>
<code class="code">* * * * * /usr/local/bin/solo -port=5001 php /path/to/worker.php</code>
<p>What this will do is try to run this command every minute. Solo will check to see if the port is already in use, and if it is, it will exit. Otherwise, it will lock the port and then execute the command. The port will stay locked as long as the command is executing. Once the command terminates, the port will unlock.</p>
<p>Now, PHP is a great language, but it has been known to have some memory leaks while running a long time in a single instance. So we can have our scripts exit periodically to be restarted by our cron job. So lets make our &#8220;while(1)&#8221; statement a little smarter:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * A Smarter While Statement
 */

// Set the time limit for php to 0 seconds
set_time_limit(0);

/*
 * We'll set our base time, which is one hour (in seconds).
 * Once we have our base time, we'll add anywhere between 0
 * to 10 minutes randomly, so all workers won't quick at the
 * same time.
 */
$time_limit = 60 * 60 * 1; // Minimum of 1 hour
$time_limit += rand(0, 60 * 10); // Adding additional time

// Set the start time
$start_time = time();

// Continue looping as long as we don't go past the time limit
while(time() &lt; $start_time + $time_limit)
{
	/* ... perorm BLPOP command ... */
	/* ... process jobs when received ... */
}

/* ... will quit once the time limit has been reached ... */
</pre>
<p>One key thing to note is randomly shifting the time limit for the script. I like to do this because you don&#8217;t want your workers all stopping and starting at the same time. So if I have 8 workers, one might, but the 7 will continue until the 8th starts back up again via the cron job.</p>
<h3>Bells &#038; Whistles</h3>
<p>After using workers for awhile, here are a couple of ideas to enhance your workers &#038; system managing them. First off, you can add some monitoring for your queues. Using Redis a HASH, you can use them to store the state of your workers. </p>
<pre class="brush: php; title: ; notranslate">
/*
 * Assigning Worker IDs &amp; Monitoring
 *
 * Usage: php worker.php 1
 */

// Gets the worker ID from the command line argument
$worker_id = $argv[1];

// Setting the Worker's Status
$predis-&gt;hset('worker.status', $worker_id, 'Started');

// Set the last time this worker checked in, use this to
// help determine when scripts die
$predis-&gt;hset('worker.status.last_time', $worker_id, time());
</pre>
<p>Another problem with workers that run for a long time (several hours) is when you make a change to their code, they won&#8217;t reload that change until they exit. What I&#8217;ve found to successfully restart them is having a &#8220;version&#8221; number set in Redis that is checked at the end of every loop:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Using Versions to Check for Reloads
 */

$version = $predis-&gt;get('worker.version'); // i.e. number: 6

while(time() &lt; $start_time + $time_limit)
{
	/* ... check for jobs and process them ... */

	/* ... then, at the very end of the while ... */
	if($predis-&gt;get('worker.version') != $version)
	{
		echo &quot;New Version Detected... \n&quot;;
		echo &quot;Reloading... \n&quot;;
		exit();
	}
}
</pre>
<p>You would simply INCR (increment) worker.version and after finishing their last job, the worker would exit, and solo would start it up again.</p>
<p>You can also kill specific threads by having them check for their value in a hash:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Using Kill Switches to Check for Reloads
 */

while(time() &lt; $start_time + $time_limit)
{
	/* ... check for jobs and process them ... */

	/* ... then, at the very end of the while ... */
	// Check to see if a kill has been set.
	if($predis-&gt;hget('worker.kill', $worker_id))
	{
		// Make sure to unset the kill request before exiting, or
		// your worker will just keep restarting.
		$predis-&gt;hdel('worker.kill', $worker_id);

		echo &quot;Kill Request Detected... \n&quot;;
		echo &quot;Reloading... \n&quot;;
		exit();
	}
}
</pre>
<h3>Tweak to Solo &#038; Logging </h3>
<p>I made one small tweak in my version of solo, and that was to help it enable logging. Lets say I had three workers in my crontab:</p>
<code class="code"># crontab for user to run workers
* * * * * /usr/local/bin/solo -port=5001 php /path/to/worker.php 1 &gt;&gt; /tmp/worker.log.1
* * * * * /usr/local/bin/solo -port=5002 php /path/to/worker.php 2 &gt;&gt; /tmp/worker.log.2
* * * * * /usr/local/bin/solo -port=5003 php /path/to/worker.php 3 &gt;&gt; /tmp/worker.log.3</code>
<p>The &#8220;>> /tmp/worker.log.1&#8243; tells solo I want to log it&#8217;s output to a tmp file that I can tail and monitor their progress. This is great for debugging problems. However, when I did this, solo would write to the tmp file, and not the output from my script. To overcome this I changed the last line of solo:</p>
<pre class="brush: perl; title: ; notranslate">
# old
exec @ARGV;
# new
exec &quot;@ARGV&quot;;
</pre>
<p>This would ensure my script wrote out to the tmp file, and not just solo.</p>
<h3>Examples</h3>
<p>I&#8217;ve created an <a href="https://github.com/JustinCarmony/PHP-Workers-with-Redis-Solo-Examples">example on GitHub</a> that you can clone on your own machine. All you will need is PHP 5.3 and Redis installed.</p>
<p>To install redis, simple run these commands on your unix based system:</p>
<code class="code">wget http://redis.googlecode.com/files/redis-2.4.5.tar.gz
tar -xzvf redis-2.4.5.tar.gz
cd redis-2.4.5
make
make install</code>
<p>It will copy the redis binaries to /usr/local/bin.</p>
<p>To get a copy of the code, you can <a href="https://github.com/JustinCarmony/PHP-Workers-with-Redis-Solo-Examples/zipball/master">download them here</a>. <strong>HOWEVER, it doesn&#8217;t include predis! You&#8217;ll have to download and copy predis inside there via this link.</strong> It is much easier to clone it as so:</p>
<code class="code">git clone git://github.com/JustinCarmony/PHP-Workers-with-Redis-Solo-Examples.git php_example/
cd php_example
git submodule init
git submodule update</code>
<p>Then, using different terminal windows (or using screen), you can run different worker.php instances, use creator.php to insert jobs, and monitor.php to watch the progress. This is all done from the command line.</p>
<p>If you&#8217;re using windows, I suggest installed a VM of Ubuntu and using that. If you really want to use Redis on windows, there are some Windows Binaries you can google and download. Good luck!</p>
<p>Here is a video where I demo the example:</p>
<p><iframe width="640" height="480" src="http://www.youtube.com/embed/jhgGhBgY14U?hd=1" frameborder="0" allowfullscreen></iframe></p>
<p>(sorry for the poor mic quality)</p>
<h3>Final Thoughts</h3>
<p>I&#8217;ll post here shortly about how to run Redis in production with the init.d scripts and configuration files. One caveat to using solo is if your server has an application that randomly selects ports to use (i.e. VoIP, FTP), it might select one of your worker&#8217;s ports. But on a production server, you should have a good feel for which ports are available for locking.</p>
<p>If you want to learn more about Redis, <a href="http://redis.io/">check out their website</a>.  </p>
<p>Hopefully this will be helpful for anyone looking to use PHP Workers in an easy, simple way.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2011/05/23/mysql-redis-and-a-billion-rows-a-love-story/' rel='bookmark' title='MySQL, Redis, and a Billion Rows &#8211; A Love Story'>MySQL, Redis, and a Billion Rows &#8211; A Love Story</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/01/07/creating-chatroom-walls-with-redis-and-php/' rel='bookmark' title='Creating Chatroom / Walls with Redis &amp; PHP'>Creating Chatroom / Walls with Redis &#038; PHP</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/01/10/debugging-with-php-stack-traces-and-redis/' rel='bookmark' title='Debuging with PHP, Stack Traces, and Redis'>Debuging with PHP, Stack Traces, and Redis</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2012/01/10/php-workers-with-redis-solo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My 2011 Recap</title>
		<link>http://www.justincarmony.com/blog/2011/12/30/my-2011-recap/</link>
		<comments>http://www.justincarmony.com/blog/2011/12/30/my-2011-recap/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 02:00:20 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Goals]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1066</guid>
		<description><![CDATA[As I look back on 2011, its been a pretty fun year technology &#038; work wise. While I have a few more draft posts to finish up, I thought I&#8217;d hit some highlights from the past year. PHP Its been a fun year with the Utah PHP Usergroup. I look forward to it each month, ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2009/12/23/my-2009-technology-recap/' rel='bookmark' title='My 2009 Technology Recap'>My 2009 Technology Recap</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/05/14/attending-php-tek-2011/' rel='bookmark' title='Attending PHP Tek 2011'>Attending PHP Tek 2011</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/12/29/goal-for-2011-learn-c/' rel='bookmark' title='Goal for 2011: Learn C'>Goal for 2011: Learn C</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As I look back on 2011, its been a pretty fun year technology &#038; work wise. While I have a few more draft posts to finish up, I thought I&#8217;d hit some highlights from the past year.</p>
<h3>PHP</h3>
<p>Its been a fun year with the <a href="http://uphpu.org/">Utah PHP Usergroup</a>. I look forward to it each month, and if you&#8217;re in Utah, you definitely should come. We&#8217;ve had a lot of interesting talks, such as running your app in different clouds, several MySQL Forks and NoSQL stuff. </p>
<p>I also had a great time going to my first PHP specific conference. While I&#8217;ve attended and spoken at other conferences, Tek 11 was a lot of fun. Met a lot of smart and fun people.</p>
<p>As for work, I do almost exclusively PHP work. We power the Dating DNA website and APIs using PHP. All of the Clipish Apps&#8217; APIs are powered by PHP. Alienware Arena, The GeForce StarCraft II Pro/Am Tournament, Thermaltake eSports, and a few other gaming tournaments sites, all powered by PHP. </p>
<p>I&#8217;m hoping to blog more about PHP this year. While I use it all over the place, it seems I write more about all the other pieces that interface with and support PHP.</p>
<h3>New Technologies</h3>
<p>There have been a handful of new technologies gaining traction. We&#8217;ve been using Redis in production for quite awhile now, and finding more and more uses for it. I&#8217;ve played around quite a bite with node.js, and I see some potential for augmenting PHP with it. MongoDB, CouchDB, and a few other data stores have shown a lot of potential in situations that play to their strength. I&#8217;m still a major fan of MySQL, but it&#8217;s nice to good options for things that MySQL isn&#8217;t as strong at.</p>
<h3>New Goals</h3>
<p>I&#8217;ve been working out, eating well, and such for almost 8 weeks now as well as my wife. The net effect is I&#8217;ve lost 16 pounds, and my wife has lost quite a bit too. This was done over the holidays even. We still have some ways to go to get to our goals, but we&#8217;re hoping to be successful in 2012 and hit our target goals. We&#8217;re even starting to enjoy lifting, cardio, and eating right.</p>
<p>I&#8217;m also setting the goal to blog once a week this year. I&#8217;ve tried daily, and that is just too much, but once a week is manageable. Hopefully it&#8217;ll be relating the technologies I use, to help share the cool stuff we get to use in-house.</p>
<h3>Upcoming in 2012</h3>
<p>We&#8217;re launching a new product in 2012 for Dating DNA, hopefully within a month or so. I&#8217;m also hoping to go to a few conferences this year, and perhaps speak at a few of them. Also, on the fun side of things, we&#8217;ll be going on a cruise in April, and perhaps a trip to China in September. </p>
<p>I hope everyone had an excellent 2011, and and amazing 2012!</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2009/12/23/my-2009-technology-recap/' rel='bookmark' title='My 2009 Technology Recap'>My 2009 Technology Recap</a></li>
<li><a href='http://www.justincarmony.com/blog/2011/05/14/attending-php-tek-2011/' rel='bookmark' title='Attending PHP Tek 2011'>Attending PHP Tek 2011</a></li>
<li><a href='http://www.justincarmony.com/blog/2010/12/29/goal-for-2011-learn-c/' rel='bookmark' title='Goal for 2011: Learn C'>Goal for 2011: Learn C</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2011/12/30/my-2011-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helping Daniel Buy A Water Buffalo</title>
		<link>http://www.justincarmony.com/blog/2011/11/27/helping-daniel-buy-a-water-buffalo/</link>
		<comments>http://www.justincarmony.com/blog/2011/11/27/helping-daniel-buy-a-water-buffalo/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 19:44:58 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[charity]]></category>
		<category><![CDATA[donating]]></category>
		<category><![CDATA[water buffalo]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1056</guid>
		<description><![CDATA[I have a very good friend, Daniel Allen, who is living in China for 18 months for his work. It&#8217;s been very interesting to hear about how life is like in China, and how the culture is &#8220;on the other side of the world.&#8221; Well, this year for Christmas, Daniel wanted to help raise up ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/08/12/bad-pr-the-internet-and-censorship-just-take-it/' rel='bookmark' title='Bad PR, The Internet, and Censorship &#8211; Just Take It'>Bad PR, The Internet, and Censorship &#8211; Just Take It</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/12/24/merry-christmas-happy-holidays/' rel='bookmark' title='Merry Christmas &amp; Happy Holidays'>Merry Christmas &#038; Happy Holidays</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have a very good friend, Daniel Allen, who is living in China for 18 months for his work. It&#8217;s been very interesting to hear about how life is like in China, and how the culture is &#8220;on the other side of the world.&#8221;</p>
<p>Well, this year for Christmas, Daniel wanted to help raise up $250 for&#8230; a water buffalo. Yup, thats right, a Water Buffalo.</p>
<p>What in the world for? To donate for a family in a rural. Why? From the <a href="https://secure1.heifer.org/gift-catalog/water-buffalo.html">Heifer International website</a>:</p>
<blockquote><p>A water buffalo can lead a hungry family out of poverty and give them a chance for a bright future filled with hope and free from hunger.</p>
<p>In poor Filipino villages, water buffalo from Heifer provide draft power for planting rice and potatoes, milk for protein and manure for fertilizer and fuel. A farmer can plant four times more rice with a buffalo than by hand.</p>
<p>Water buffalo haul heavy loads to the market, where the sale of extra produce brings in vital income for clothing, medicine and school. By renting their buffalo to neighbors, Heifer partner families can earn money for home improvements. And one day, those same neighbors might receive a water buffalo of their own as recipients pass on the gifts of animals and training.</p>
<p>Protein-rich milk, strength to till soil, manure to enrich the land &#8230; so many benefits. And, in turn, water buffalo are happy just to graze on coarse grasses and other plants not suitable for harvesting.</p></blockquote>
<p>So <a href="http://danielsshoefactory.wordpress.com/help-me-help-you-help-me/">Daniel wants to raise the funds for one</a>!</p>
<blockquote><p>I need your help.</p>
<p>Well actually I need your help to help me to give someone a Water Buffalo.</p>
<p>Think about it for a second. You can say you gave someone a Water Buffalo for Christmas.  You know Water Buffaloes right?</p>
<p>Like this one:</p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2011/11/water-buffalo.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2011/11/water-buffalo-300x300.jpg" alt="" title="water-buffalo" width="300" height="300" class="alignnone size-medium wp-image-1057" /></a></p>
<p>While we were in Cambodia I noticed how much of the work is still done manually. Also in the few “Real China Adventures” we have had I have been amazed at what life is like outside the cities. Don’t get me wrong the people seem happy and content. But I am sure there are places they are not. And I think we should help them.</p>
<p>So I have started a Heifer International Team, Daniel’s Shoe Factory, and I would like you to help me raise $250 to give someone in South East Asia a water buffalo.</p>
<p>Want more information: <a href="https://secure1.heifer.org/gift-catalog/water-buffalo.html">Click Here</a></p>
<p>How to help me: <a href="http://sphere.heifer.org/c.swL1KcNZLxH/b.5547921/k.86F6/Team_Search/siteapps/teampage/ShowPage.aspx?c=swL1KcNZLxH&#038;b=5547921&#038;sid=beIMLTMnGdLNJQPrHlF">Click Here</a> and join or donate.</p>
<p>I am hoping to raise $250 by Jan 1st 2012.</p>
<p>So step up. Unless you yourself are in need of a water buffalo, then no worries.</p></blockquote>
<p>So lets help Daniel buy a Water Buffalo for a family in need for this Christmas!</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/08/12/bad-pr-the-internet-and-censorship-just-take-it/' rel='bookmark' title='Bad PR, The Internet, and Censorship &#8211; Just Take It'>Bad PR, The Internet, and Censorship &#8211; Just Take It</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/12/24/merry-christmas-happy-holidays/' rel='bookmark' title='Merry Christmas &amp; Happy Holidays'>Merry Christmas &#038; Happy Holidays</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2011/11/27/helping-daniel-buy-a-water-buffalo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video &#8211; Demystifying CSS &amp; WordPress</title>
		<link>http://www.justincarmony.com/blog/2011/11/19/video-demystifying-css-and-wordpress/</link>
		<comments>http://www.justincarmony.com/blog/2011/11/19/video-demystifying-css-and-wordpress/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:19:28 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1051</guid>
		<description><![CDATA[The great guys at Pole Vault Media and WordPress.tv have put up a video of my Demystifying CSS &#038; WordPress talk. Related posts:Demystifying CSS and WordPress WordPress 2.7 &#8211; I Love It! WordPress &#038; OOP


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/talks/demystifying-css-and-wordpress/' rel='bookmark' title='Demystifying CSS and WordPress'>Demystifying CSS and WordPress</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/12/10/wordpress-27-i-love-it/' rel='bookmark' title='WordPress 2.7 &#8211; I Love It!'>WordPress 2.7 &#8211; I Love It!</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/21/wordpress-oop/' rel='bookmark' title='WordPress &amp; OOP'>WordPress &#038; OOP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The great guys at <a href="http://www.polevaultmedia.com/">Pole Vault Media</a> and <a href="http://wordpress.tv/">WordPress.tv</a> have put up a <a href="http://wordpress.tv/2011/11/18/justin-carmony-demystifying-css-wordpress/">video</a> of my <a href="http://www.justincarmony.com/blog/talks/demystifying-css-and-wordpress/">Demystifying CSS &#038; WordPress talk</a>.</p>
<p><embed type="application/x-shockwave-flash" src="http://s0.videopress.com/player.swf?v=1.03" width="630" height="416" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=nY5qPxbg&amp;isDynamicSeeking=true"></embed></p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/talks/demystifying-css-and-wordpress/' rel='bookmark' title='Demystifying CSS and WordPress'>Demystifying CSS and WordPress</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/12/10/wordpress-27-i-love-it/' rel='bookmark' title='WordPress 2.7 &#8211; I Love It!'>WordPress 2.7 &#8211; I Love It!</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/21/wordpress-oop/' rel='bookmark' title='WordPress &amp; OOP'>WordPress &#038; OOP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2011/11/19/video-demystifying-css-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Eve of Modern Warfare 3</title>
		<link>http://www.justincarmony.com/blog/2011/11/07/on-the-eve-of-modern-warfare-3/</link>
		<comments>http://www.justincarmony.com/blog/2011/11/07/on-the-eve-of-modern-warfare-3/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 18:39:12 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Video Gaming]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[call of duty]]></category>
		<category><![CDATA[modern warfare]]></category>
		<category><![CDATA[Video Games]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1046</guid>
		<description><![CDATA[While I do work some in the Video Game Industry, I don&#8217;t write about it very often. However, I thought I would write some thoughts on Call of Duty: Modern Warfare 3: Ultimately, I&#8217;m approaching it with a great deal of hesitation. Here is why: When you start up a Video Game, much like watching ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/12/05/ghostbusters-the-video-game/' rel='bookmark' title='Ghostbusters &#8211; The Video Game'>Ghostbusters &#8211; The Video Game</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/30/im-boycotting-electronic-arts-ea-games/' rel='bookmark' title='I&#8217;m Boycotting Electronic Arts (EA) Games'>I&#8217;m Boycotting Electronic Arts (EA) Games</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/15/ea-lack-of-quality-out-of-touch/' rel='bookmark' title='EA &#8211; Lack of Quality &amp; Out of Touch'>EA &#8211; Lack of Quality &#038; Out of Touch</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>While I do work some in the Video Game Industry, I don&#8217;t write about it very often. However, I thought I would write some thoughts on Call of Duty: Modern Warfare 3:</p>
<p>Ultimately, I&#8217;m approaching it with a great deal of hesitation. Here is why:</p>
<p>When you start up a Video Game, much like watching a Movie, you will see some credits. In Modern Warfare 2, you&#8217;ll see Activision&#8217;s name, which is the Publisher, and Infinity Ward, which is the Game Development Studio. While the publisher can be involved in making (or ruining) a game, ultimately its up to the studio to produce a high quality game.</p>
<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2011/11/infinity_ward.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2011/11/infinity_ward.jpg" alt="" title="infinity_ward" width="300" height="124" class="alignnone size-full wp-image-1048" /></a></p>
<p>However, the Infinity Ward who made Modern Warfare 2 is not the same Infinity Ward who made Modern Warfare 3. Activision fired the lead game designer and a co-founder of Infinity Ward, and about half the staff resigned soon after that. <a href="http://venturebeat.com/2010/07/10/fired-infinity-ward-founders-accuse-activision-of-running-a-police-state-in-amended-lawsuit/">They are now in a lawsuit against Activision</a> who tried to withhold 60% of the staff&#8217;s bonuses.</p>
<p>As a Developer myself, there are two things I think are critical when working on a product, <em>especially</em> a video game: Design Direction and Talented Developers. From what I&#8217;ve read on the several news stories about staff leaving Infinity Ward, the majority were Leads and Seniors developers, animators, etc. So I would say the bulk of Infinity Ward&#8217;s talent left. Why does this matter?</p>
<p>Call of Duty, Call of Duty 2, Call of Duty 4: Modern Warfare, and Call of Duty: Modern Warfare 2 were are great games. Each added on top of the other, trying new things and bringing noticeable improvements to each installment. Also, while Infinity Ward grew, many of the core team members were the same throughout the series. So you had a great team, with a lot of talent, and experience working together to make great games.</p>
<p>Meanwhile, other Call of Duty games by other studios like Treyarch, released games like Call of Duty: World at War and Call of Duty: Black Ops. While these games weren&#8217;t bad games, they weren&#8217;t ground breaking either. They felt like minor updates instead of fresh, new material. </p>
<p>So now we have an Infinity Ward with half of their staff brand new, and trying to release a game on a very tight deadline. So I wouldn&#8217;t be surprised if there are technical issues at release, especially for the PC. From all the previews I&#8217;ve ready about Modern Warfare 3, it sounds like it really is just an updated version of MW2 with new maps and a new game play mode. </p>
<p>So while the videos and images of Call of Duty: Modern Warfare 3 look impressive, and the marketing behind it is great, I&#8217;m not holding my breath. But this will be the first time I won&#8217;t be purchasing Call of Duty: Modern Warfare 3 for PC, my personal choice for playing FPS games. I&#8217;ll likely pickup a copy of it for XBox 360 so I can play with friends, but here is my prediction: </p>
<p>Critics will give it high ratings (9+), actual players will give it okay ratings (7+), but Activision and Infinity Ward will have made their biggest mistake. They will have moved from being innovators to just producers. While they might sell millions of copies of this game, and they might pump out a few more titles, they open themselves to being displaced as the leader in the future. I&#8217;m hoping that future games will be able to bring in a breath of fresh air while Activision milks their franchise into the ground.</p>
<p>Who knows, maybe I&#8217;ll be proven wrong and Modern Warfare 3 will be great. I just have my doubts, especially when you have an exodus of senior talent from a company. I&#8217;ve seen that happen before, and rarely does the company produce the same quality as before.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/12/05/ghostbusters-the-video-game/' rel='bookmark' title='Ghostbusters &#8211; The Video Game'>Ghostbusters &#8211; The Video Game</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/30/im-boycotting-electronic-arts-ea-games/' rel='bookmark' title='I&#8217;m Boycotting Electronic Arts (EA) Games'>I&#8217;m Boycotting Electronic Arts (EA) Games</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/15/ea-lack-of-quality-out-of-touch/' rel='bookmark' title='EA &#8211; Lack of Quality &amp; Out of Touch'>EA &#8211; Lack of Quality &#038; Out of Touch</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2011/11/07/on-the-eve-of-modern-warfare-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Siege with User Authentication</title>
		<link>http://www.justincarmony.com/blog/2011/11/03/siege-with-user-login/</link>
		<comments>http://www.justincarmony.com/blog/2011/11/03/siege-with-user-login/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 16:33:02 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[siege]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=1043</guid>
		<description><![CDATA[If you want to stress test your application, the quickest and best way to do so is with siege. From the siege website: Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/07/14/setting-up-ssh-key-authentication-between-servers/' rel='bookmark' title='Setting up SSH Key Authentication Between Servers'>Setting up SSH Key Authentication Between Servers</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/10/local-lamp-developement-user-content/' rel='bookmark' title='Local LAMP Developement &amp; User Content'>Local LAMP Developement &#038; User Content</a></li>
<li><a href='http://www.justincarmony.com/blog/2009/11/27/my-php-user-group-experience/' rel='bookmark' title='My PHP User Group Experience'>My PHP User Group Experience</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you want to stress test your application, the quickest and best way to do so is with <a href="http://www.joedog.org/index/siege-home">siege</a>. From the siege website:</p>
<blockquote><p>Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It lets its user hit a web server with a configurable number of simulated web browsers. Those browsers place the server &#8220;under siege.&#8221;</p></blockquote>
<p>On Linux, you can install it easily via yum or apt. On OS X, you can install it easily via <a href="http://mxcl.github.com/homebrew/">homebrew</a> or <a href="http://www.macports.org/">macports</a>. I personally prefer homebrew. In your terminal just type:</p>
<code class="code">brew install siege</code>
<p>Now you can stress test a given app by simply using the siege command:</p>
<code class="code">siege -c 10 -n 10 http://www.example.com/</code>
<p>You can read the <a href="http://www.joedog.org/index/siege-manual">documentation</a> and <a href="http://www.joedog.org/index/siege-faq">faq</a> on their site to learn more. However, there is one question I get a lot when talking about siege: &#8220;How can I use siege to test users who are logged in?&#8221;</p>
<p>I would always recommend that they send a session header in the config, but today I learned there is an even easier way (although undocumented), thanks to <a href="http://serverfault.com/questions/292679/stress-login-area-with-siege">this question in Server Fault</a>. In your siege&#8217;s configuration you can add the login-url directive:</p>
<code class="code"># Login URL. This is the first URL to be hit by every siege
# client. This feature was designed to allow you to login to 
# a server and establish a session. It will only be hit once
# so if you need to hit this URL more then once, make sure it
# also appears in your urls.txt file.
#
# ex: login-url = http://eos.haha.com/login.jsp POST name=jeff&amp;pass=foo
#
# login-url =</code>
<p>Awesome! Now each connection will authenticate before continuing their siege. A very handy tool, especially if your load is generated by user account pages and such.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2010/07/14/setting-up-ssh-key-authentication-between-servers/' rel='bookmark' title='Setting up SSH Key Authentication Between Servers'>Setting up SSH Key Authentication Between Servers</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/10/10/local-lamp-developement-user-content/' rel='bookmark' title='Local LAMP Developement &amp; User Content'>Local LAMP Developement &#038; User Content</a></li>
<li><a href='http://www.justincarmony.com/blog/2009/11/27/my-php-user-group-experience/' rel='bookmark' title='My PHP User Group Experience'>My PHP User Group Experience</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2011/11/03/siege-with-user-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 35/134 queries in 0.046 seconds using memcached
Content Delivery Network via Rackspace Cloud Files: c747925.r25.cf2.rackcdn.com

Served from: www.justincarmony.com @ 2012-02-07 21:04:53 -->
