<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Uhhh, what?</title>
	<atom:link href="http://tedkulp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tedkulp.com</link>
	<description>Code, General Geekery, Life</description>
	<pubDate>Tue, 20 May 2008 16:40:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Quick tuneup</title>
		<link>http://tedkulp.com/2008/05/16/quick-tuneup/</link>
		<comments>http://tedkulp.com/2008/05/16/quick-tuneup/#comments</comments>
		<pubDate>Fri, 16 May 2008 11:39:06 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tedkulp.com/?p=8</guid>
		<description><![CDATA[I run both my redmine install and my Askerisk box on the same VPS.  It&#8217;s the 256 meg one from slicehost.  While this should be more than enough server for the couple of little things I do, I was more than underwhelmed with the performance from my redmine install.  I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>I run both my <a href="http://www.redmine.org/">redmine</a> install and my <a href="http://www.asterisk.org/">Askerisk</a> box on the same VPS.  It&#8217;s the 256 meg one from <a href="http://www.slicehost.com/">slicehost</a>.  While this should be more than enough server for the couple of little things I do, I was more than underwhelmed with the performance from my redmine install.  I decided to take a few minutes this morning and squeeze out some performance.</p>
<p>After these couple of changes, I noticed a big improvement on the speed at which pages were coming back.  <strong>+1</strong> for reading.  It really is fun-da-mental.</p>
<p><strong>mod_rails</strong></p>
<p>My redmine install is using the wonderfully simple <a href="http://www.modrails.com/">mod_rails</a> for apache2.  It was a dream to setup and works great&#8230;  however I needed to tweak some default settings in order for it not to take 3-4 seconds per page view.  I got these from the mod_rails <a href="http://www.modrails.com/documentation/Users%20guide.html#_configuring_passenger">documentation</a> (which is very good, BTW).</p>

<div class="wp_syntax"><div class="code"><pre class="apache">&lt;VirtualHost *&gt;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>...<span style="color: #66cc66;">&#93;</span>
&nbsp;
	RailsMaxPoolSize <span style="color: #ff0000;">2</span>  <span style="color: #adadad; font-style: italic;">#defaults to 20</span>
	RailsPoolIdleTime <span style="color: #ff0000;">600</span>  <span style="color: #adadad; font-style: italic;">#default to 120</span>
&nbsp;
&lt;/VirtualHost&gt;</pre></div></div>

<p>Basically, because of the nature of the app, it&#8217;s both not high traffic and needed a little more time before the processes were removed.  Redmine is one of those apps you hang out on for a little while and take time to write a decent ticket or set some complicated permissions.  Having the processes die in 120 seconds was frustrating, because it always seemed like you were waiting for them to spin back up.</p>
<p>Also, having 20 rails processes running would require a lot of swap space.   And given that myself and maybe one other person will ever be on it at one time, having more than 2 isn&#8217;t really necessary.  The lack of swapping makes it feel snappier.</p>
<p><strong>Logging</strong></p>
<p>One other tweak I always forget about when I push a site into production is to change the default logging.  By default, &#8220;production&#8221; rails logs as info, when really error is the better way to go.  It saves space and requires less disk I/O per page view.</p>
<p>Just open up config/environments/production.rd and add:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby">config.<span style="color:#9900CC;">log_level</span> = <span style="color:#ff3333; font-weight:bold;">:error</span></pre></div></div>

<p>to the bottom of the file.  Restart the app (touch tmp/restart.txt for mod_rails) and you&#8217;re good.</p>
]]></content:encoded>
			<wfw:commentRss>http://tedkulp.com/2008/05/16/quick-tuneup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Git on Windows?  Yep.</title>
		<link>http://tedkulp.com/2008/05/15/git-on-windows-yep/</link>
		<comments>http://tedkulp.com/2008/05/15/git-on-windows-yep/#comments</comments>
		<pubDate>Thu, 15 May 2008 14:25:26 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tedkulp.com/?p=7</guid>
		<description><![CDATA[In my post yesterday, I made a comment about not using git if I was doing full-on Windows development.  I heard bits and pieces about using git on Windows, but never really gave them a second thought.  However, I found this post yesterday that debunks that theory.
http://kylecordes.com/2008/04/30/git-windows-go/
Sweet!  No there&#8217;s no excuse.
]]></description>
			<content:encoded><![CDATA[<p>In my post yesterday, I made a comment about not using git if I was doing full-on Windows development.  I heard bits and pieces about using git on Windows, but never really gave them a second thought.  However, I found this post yesterday that debunks that theory.</p>
<p><a href="http://kylecordes.com/2008/04/30/git-windows-go/">http://kylecordes.com/2008/04/30/git-windows-go/</a></p>
<p>Sweet!  No there&#8217;s no excuse.</p>
]]></content:encoded>
			<wfw:commentRss>http://tedkulp.com/2008/05/15/git-on-windows-yep/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Picking Tools</title>
		<link>http://tedkulp.com/2008/05/14/picking-tools/</link>
		<comments>http://tedkulp.com/2008/05/14/picking-tools/#comments</comments>
		<pubDate>Wed, 14 May 2008 13:44:57 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
		
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://tedkulp.com/?p=6</guid>
		<description><![CDATA[One of the biggest challenges when putting a business together is figuring out which tools to use.  Between the mass of Web 2.0 services, simple Mac apps and big behemoth super-apps, it&#8217;s difficult to know what is what.  I need to pick tools that allow me to be flexible, productive and get the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest challenges when putting a business together is figuring out which tools to use.  Between the mass of Web 2.0 services, simple Mac apps and big behemoth super-apps, it&#8217;s difficult to know what is what.  I need to pick tools that allow me to be flexible, productive and get the hell out of my way.</p>
<p>The main things I need to cover as a freelance coder, support provider, business owner break into roughly the following categories: bookkeeping, project management, time keeping, code management, invoicing and communication.  Those are the main pieces I need to run a successful one-man business.  I&#8217;m sure there are other things I&#8217;ll find I need as I get further into it, but I&#8217;ll figure those out with time (CRM, for example?).</p>
<p>I believe I&#8217;ve made my selections. Some things requiring trying every different tool out there in order to properly make a solid selection, and some were love at first site.  Let me do a rundown&#8230;</p>
<p><span id="more-6"></span></p>
<p><strong>Bookkeeping</strong></p>
<p>Bookkeeping is easy, actually.  <a href="http://quickbooks.intuit.com/">Quickbooks</a>, as expensive as it is, is really the only way to go.  My accountant uses it.  Most business owners I know use it.  It&#8217;s the 100 lb. gorilla and there is no denying that I have to use it as well.  The biggest issue I had was deciding to use the Windows or Mac version.  In reality, the Mac would make 100x more sense, but Intuit screws up the Mac version pretty severely.  It&#8217;s not compatible with the Windows version&#8217;s files, it&#8217;s not updated nearly as often, and it doesn&#8217;t come with various different editions or have the option for the Payroll add-on.  So, I either need a Quickbooks VM (which might be a good idea, because it&#8217;s easy to backup), or a separate computer (which I should probably have a Windows box around the office anyway).</p>
<p><strong>Invoicing</strong></p>
<p>Invoicing was a little more difficult.  I&#8217;d love to use <a href="http://www.blinksale.com/home">Blinksale</a>, which is the tool I&#8217;ve been using for the past 2-3 years for all my side work.  It&#8217;s a brilliant little tool for doing quick invoicing.  However, given that I use Quickbooks now, doing double entry isn&#8217;t really worth it to me.  So, I&#8217;ll just be doing <a href="http://quickbooks.intuit.com/">Quickbooks</a> invoices for the foreseeable future, exporting them to PDF and emailing them to clients.</p>
<p><strong>Project Management</strong></p>
<p>This was terribly difficult to decide on.  If I was in a more &#8220;creative&#8221; or &#8220;consulting&#8221; type position, then I&#8217;d go with <a href="http://www.basecamphq.com/">Basecamp</a> in a second.  It&#8217;s sort of the &#8220;standard&#8221; for the hip little company that needs to communicate with their clients easily.  However, given that most of my work is related to coding, it&#8217;s not the best option.  Ticket tracking is really the way I&#8217;ll handle the majority of my communication through the development process, with light project management for handling tech specs, design docs, etc beforehand.</p>
<p>I then decided that I could use Lighthouse as my app of choice, because it&#8217;s basically a ticket tracker w/ more.  However, lighthouse doesn&#8217;t have any type of repository browser and it would require me to setup new users and new repositories to always push changesets to it so that they match up.  In theory, it&#8217;s not a big deal.  But in practice, I could have MAHY projects and having that extra overhead of setting it up every time sounds miserable to me.  It&#8217;s also not practical in cost with my situation&#8230;.  I need many projects and potentially many users.</p>
<p>However, after scouring the internets for awhile, I came across the perfect tool for what I need.  <a href="http://www.redmine.org/">Redmine</a> is a rails app that basically allows you to have ticket tracking, repository viewing and attaching tickets to changesets.  It also has document management, decent permissions and runs on my own server.  It&#8217;s also free.  I&#8217;ve been using it for my last 2 projects and it works wonderfully.  I can&#8217;t recommend it more highly.</p>
<p><strong>Code Management</strong></p>
<p>No decision to make.  I switched to <a href="http://git.or.cz/">git</a> about 6 months ago and haven&#8217;t looked back.  In addition, I&#8217;ve found the <a href="http://eagain.net/gitweb/?p=gitosis.git;a=blob;f=README.rst">gitosis</a> script allows me to easily create new repositories on my server, give commit access to clients if they need it, and I can then easily add that repository to my redmine project.  Git also gives me the advantage that if I need to use svn or cvs to work with a client&#8217;s existing repo, I can use the git tools to talk to those repos, but still have the power of git locally while I work.  Unless I was doing strict Windows development, I can&#8217;t imagine using any other tool.</p>
<p><strong>Time Keeping</strong></p>
<p>I&#8217;ve tried every time keeping app under the Web 2.0 sun in order to find the right tool.  Every one of them had a little nagging thing that didn&#8217;t work for me and I was almost resorting to writing my own just to get exactly what I want.  I then stumbled on <a href="http://keeptempo.com/">Tempo</a> after seeing it on a banner ad, and it&#8217;s just about perfect for what I need.  It has both Quickbooks and Blinksale integration, a nice clean interface using a little popup window and twitter/email integration.  It&#8217;s also cheaper than most of the other ones out there.  Done.</p>
<p><strong>Communications</strong></p>
<p>This is actually a topic in it&#8217;s own, as having many affordable, cheap, easy ways to communicate with clients is an absolute necessity.  This comes down to 4 things for me to do it properly.  Email, Office Phone, Cell Phone and Snail Mail.  I&#8217;ll hit each quickly.</p>
<p>For email, there is no contest&#8230; <a href="http://mail.google.com">Gmail</a> is still the most flexible way for my email needs.  I have many email addresses for many different things&#8230;  and yet I just forward every one of them to my gmail account.  The ability to store all that stuff, have a lightning fast search and decent IMAP support is well worth the cost of ignoring some web based ads.</p>
<p>The office phone setup is a several post series coming up later.  The summary is that I have an <a href="http://www.asterisk.org/">Askerisk</a> box on my VPS in a data center, a decent Linksys IP Phone and incoming/outgoing service through <a href="http://www.inphonex.com/">Inphonex</a>.  The fact that it sounds better than my land line at home, is totally flexible and MUCH cheaper than a landline says just about everything.  In the near future, I&#8217;ll write up exactly what it took for me to get it all working as well as it does now.  It took me a lot of time, but it&#8217;s totally worth it for the outcome that I got.</p>
<p>My cell phone is an iPhone.  It&#8217;s a bit pricy, but it&#8217;s the best cell phone I&#8217;ve ever owned.  I get email, RSS reader, twitter client&#8230;.  oh, and a nice phone to boot.  I wouldn&#8217;t trade it away, even for the price tag that it has or the stupidly slow EDGE network it&#8217;s on.</p>
<p>Snail Mail.  I have an old fashioned P.O. Box at the post office.  I check it every Monday.  It&#8217;s not terribly exciting, but it does allow me to keep the business and personal mail separate&#8230;. and is dirt cheap.</p>
<p><strong>Summary</strong></p>
<p>There you have it.  Decisions made.  Tools selected.  Productivity should skyrocket now.  Right?</p>
<p>It took me a long time to really research this toolset.  While it might not work for everyone, it certainly fits all of my criteria for allowing me to get the most done, with the least amount of resistance.  If a tool isn&#8217;t exactly what you need, you&#8217;ll never use it.  Also, all of these tools have only added a little bit to my monthly overhead, which is a plus.  Have to keep the bills down during this first, crucial year.</p>
]]></content:encoded>
			<wfw:commentRss>http://tedkulp.com/2008/05/14/picking-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Grabbing git patches via gmail</title>
		<link>http://tedkulp.com/2008/05/08/grabbing-git-patches-via-gmail/</link>
		<comments>http://tedkulp.com/2008/05/08/grabbing-git-patches-via-gmail/#comments</comments>
		<pubDate>Thu, 08 May 2008 15:45:07 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
		
		<category><![CDATA[Code]]></category>

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

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

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

		<guid isPermaLink="false">http://tedkulp.com/?p=5</guid>
		<description><![CDATA[I&#8217;m a rabid gmail user.  I pretty much funnel every piece of email I get from my various email addresses into google.  Yes, I drank the kool-aide(tm).  What&#8217;s it you ya?  Wanna fight about it?
Anyhoo, I wanted a system where I could use all of the goodness of git-am without having [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a rabid gmail user.  I pretty much funnel every piece of email I get from my various email addresses into google.  Yes, I drank the kool-aide(tm).  What&#8217;s it you ya?  Wanna fight about it?</p>
<p>Anyhoo, I wanted a system where I could use all of the goodness of git-am without having to actually use something other than my beloved gmail.  So, using a little python, libgmail and a hacked up &#8220;archive.py&#8221; script that came with libgmail, I set out to do what I wanted.  I am on a Mac, so I do get the added benefit of having all that unix email goodness built right in.</p>
<p>The basic idea is simple.  When a patch comes in that I care about, I tag it with &#8220;Patches&#8221; in gmail.  Then I drop to command line and run this script.  It basically logs in to gmail, looks for any messages tagged as &#8220;Patches&#8221; and copies them to my local (and usually unused) unix user&#8217;s inbox.  It then removes the &#8220;Patches&#8221; tag and adds the &#8220;Old Patches&#8221; tag.</p>
<p><span id="more-5"></span></p>
<p>The script looks like so:</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Grab email from a gmail label, load it into your local inbox, and</span>
<span style="color: #808080; font-style: italic;"># change the label to something else.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Author: ted@tedkulp.com</span>
<span style="color: #808080; font-style: italic;"># Based on code by: follower@myrealbox.com</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># License: GPL 2.0</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Allow us to run using installed `libgmail` or the one in parent directory.</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
	 <span style="color: #ff7700;font-weight:bold;">import</span> libgmail
	 <span style="color: #dc143c;">logging</span>.<span style="color: black;">warn</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Note: Using currently installed `libgmail` version.&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">ImportError</span>:
	 <span style="color: #808080; font-style: italic;"># Urghhh...</span>
	 <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>.<span style="color: black;">insert</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">realpath</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>,<span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">pardir</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
	<span style="color: #ff7700;font-weight:bold;">import</span> libgmail
	<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
	<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">getpass</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">getpass</span>
&nbsp;
	username = <span style="color: #483d8b;">'username'</span>
	password = <span style="color: #483d8b;">'password'</span>
	new_label = <span style="color: #483d8b;">'Patches'</span>
	old_label = <span style="color: #483d8b;">'Old Patches'</span>
	mbox_dir = <span style="color: #483d8b;">'/var/mail/tedkulp'</span> <span style="color: #808080; font-style: italic;">#Change to inbox for your user</span>
&nbsp;
	ga = libgmail.<span style="color: black;">GmailAccount</span><span style="color: black;">&#40;</span>username, password<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Please wait, logging in...&quot;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		ga.<span style="color: black;">login</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">except</span> libgmail.<span style="color: black;">GmailLoginFailure</span>:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Login failed. (Wrong username/password?)&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Log in successful.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
	result = ga.<span style="color: black;">getMessagesByLabel</span><span style="color: black;">&#40;</span>new_label, <span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">print</span>
	mbox = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>result<span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">thread</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">reversed</span><span style="color: black;">&#40;</span>result<span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">print</span>
			<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">thread</span>.<span style="color: #008000;">id</span>, <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">thread</span><span style="color: black;">&#41;</span>, <span style="color: #dc143c;">thread</span>.<span style="color: black;">subject</span>
&nbsp;
			<span style="color: #ff7700;font-weight:bold;">for</span> msg <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">reversed</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">thread</span><span style="color: black;">&#41;</span>:
				<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;	 &quot;</span>, msg.<span style="color: #008000;">id</span>, msg.<span style="color: black;">number</span>, msg.<span style="color: black;">subject</span>
				source = msg.<span style="color: black;">source</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>,<span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">lstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
				mbox.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">datetime</span>.<span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;From - %a %b %d %H:%m:%S %Y<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
				mbox.<span style="color: black;">append</span><span style="color: black;">&#40;</span>source<span style="color: black;">&#41;</span>
				mbox.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#TODO:Check if we need either/both?</span>
&nbsp;
			<span style="color: #dc143c;">thread</span>.<span style="color: black;">removeLabel</span><span style="color: black;">&#40;</span>new_label<span style="color: black;">&#41;</span>
			<span style="color: #dc143c;">thread</span>.<span style="color: black;">addLabel</span><span style="color: black;">&#40;</span>old_label<span style="color: black;">&#41;</span>
&nbsp;
		<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>mbox_dir, <span style="color: #483d8b;">&quot;a&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>mbox<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;No threads found in `%s`.&quot;</span> <span style="color: #66cc66;">%</span> new_label</pre></div></div>

<p>And then just like Linus does on <a href="http://www.kernel.org/pub/software/scm/git/docs/everyday.html">http://www.kernel.org/pub/software/scm/git/docs/everyday.html</a>, I can do stuff like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ mailx
<span style="color: #000000; font-weight: bold;">&amp;</span> s <span style="color: #000000;">2</span> <span style="color: #000000;">3</span> <span style="color: #000000;">4</span> <span style="color: #000000;">5</span> .<span style="color: #000000; font-weight: bold;">/</span>+to-apply
<span style="color: #000000; font-weight: bold;">&amp;</span> d <span style="color: #000000;">2</span><span style="color: #000000;">-5</span>
<span style="color: #000000; font-weight: bold;">&amp;</span> q
$ git checkout -b topic<span style="color: #000000; font-weight: bold;">/</span>one master
$ git am <span style="color: #000000;">-3</span> -i -s -u .<span style="color: #000000; font-weight: bold;">/</span>+to-apply</pre></div></div>

<p>Beautiful.</p>
<p><em>Edit</em></p>
<p>05/20/2008 - I&#8217;ve updated the code a bit.  There was a nesting issue that was causing messages to be pulled multiple times.  I&#8217;ve also added the current date at the time of the pull instead of the 1998 date, and also pulling them in opposite order so that they are pushed into the inbox in the order they were received.</p>
]]></content:encoded>
			<wfw:commentRss>http://tedkulp.com/2008/05/08/grabbing-git-patches-via-gmail/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
