<?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>Jason Meridth&#039;s Blog</title>
	<atom:link href="http://lostechies.com/jasonmeridth/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jasonmeridth</link>
	<description>Just another LosTechies site</description>
	<lastBuildDate>Tue, 15 Jan 2013 22:06:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Opportunity</title>
		<link>http://lostechies.com/jasonmeridth/2011/06/04/opportunity/</link>
		<comments>http://lostechies.com/jasonmeridth/2011/06/04/opportunity/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 06:06:10 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://lostechies.com/jasonmeridth/?p=241</guid>
		<description><![CDATA[I&#8217;ve been in major transition the last couple months. I decided to leave San Antonio and head to Dallas to work with Joe (@agilejoe) and Marcus (@marcusthebold), both are fellow LosTechies members, at One Technologies. Unfortunately, I&#8217;m heading back to&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2011/06/04/opportunity/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in major transition the last couple months.  I decided to leave San Antonio and head to Dallas to work with Joe (<a href="https://twitter.com/agilejoe">@agilejoe</a>) and Marcus (<a href="https://twitter.com/marcusthebold">@marcusthebold</a>), both are fellow LosTechies members, at <a href="https://onetechnologies.net">One Technologies</a>.  Unfortunately, I&#8217;m heading back to San Antonio for personal reasons and would love to help fill the gap I&#8217;m leaving.  Any other Alt.NET developers who love working at a fast pace, with smart people, on interesting products, should ping Joe or Marcus with your resume.</p>
<p>You won&#8217;t regret it.  I&#8217;ve worked with both guys twice now and it has truly been a pleasure.</p>
<p><a href="https://gist.github.com/eac742b1c77bf291335d">Here is the link to the gist </a>that Joe posted a while back with the job description.</p>
<p>Did I mention you get to work with <a href="https://github.com">Github</a>? :)
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2011/06/04/opportunity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git-Achievements on Windows</title>
		<link>http://lostechies.com/jasonmeridth/2010/09/25/git-achievements-on-windows/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/09/25/git-achievements-on-windows/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 02:30:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/09/24/git-achievements-on-windows.aspx</guid>
		<description><![CDATA[UPDATE: Needed to add newly clone git-achievements to your PATH env variable.&#160; Otherwise it will push an index.html file to your current repo and not the git-achievements repo.&#160; Thank you Adam for finding that. IMPORTANT: Make sure you save your&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/09/25/git-achievements-on-windows/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong>: <em>Needed to add newly clone git-achievements to your PATH env variable.&nbsp; Otherwise it will push an index.html file to your current repo and not the git-achievements repo.&nbsp; Thank you </em><a target="_blank" href="http://twitter.com/adymitruk"><em>Adam</em></a><em> for finding that.</em></p>
<p><strong><span style="text-decoration: underline">IMPORTANT:</span></strong> <em>Make sure you save your ~/.git-achievements-action.log and ~/.git-achievements.log files if you are transferring from your primary machine.&nbsp; If you make these files mobile you will be able to use multiple machines.&nbsp; I forgot mine and now have to start over with git-achievements.&nbsp; Meh.&nbsp; More fun.</em></p>
<ul>
<li>I&rsquo;m using Msysgit Bash CLI (<a target="_blank" href="/blogs/jason_meridth/archive/2009/06/01/git-for-windows-developers-git-series-part-1.aspx">up-to-date install instructions</a>) </li>
<li>I&rsquo;ve forked the <a target="_blank" href="http://github.com/icefox/git-achievements">git-achievements github repository</a>
<ul>
<li>notice it forks to a gh-pages branch, not a master branch </li>
<li>this allows github to fire jekyll off against your github account and generate your git-achievements page </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/clone_git_achievements_060FF7AD.png"><img height="180" width="698" src="//lostechies.com/jasonmeridth/files/2011/03/clone_git_achievements_thumb_44954553.png" alt="clone_git_achievements" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>&nbsp;
<ul>
<li>cloned repository locally into my C:code folder (resulting in /c/code/git-achievements by Git Bash CLI path terms) </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/vim_bashrc_486C487F.png"><img height="55" width="361" src="//lostechies.com/jasonmeridth/files/2011/03/vim_bashrc_thumb_0EE93888.png" alt="vim_bashrc" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>&nbsp;
<ul>
<li>~/ (tilde + forward slash means home directory, where the .bashrc file needs to be) </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>&nbsp;<a href="//lostechies.com/jasonmeridth/files/2011/03/vim_bashrc_export_2778D5D8.png"><img height="116" width="692" src="//lostechies.com/jasonmeridth/files/2011/03/vim_bashrc_export_thumb_18CE29F3.png" alt="vim_bashrc_export" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ul>
<li>add the newly clone git-achievements directory to your PATH environment variable </li>
<li>alias the git command to call git-achievements </li>
<li>git-achievements calls the real git.exe, this just allows it to wrap it and intercept calls </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/source_bashrc_6CB12D01.png"><img height="52" width="366" src="//lostechies.com/jasonmeridth/files/2011/03/source_bashrc_thumb_534929C7.png" alt="source_bashrc" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ul>
<li>source means to refresh/reapply </li>
<li>if you don&rsquo;t do this, your new changes won&rsquo;t take effect </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/echo_path_56E744A4.png"><img height="223" width="704" src="//lostechies.com/jasonmeridth/files/2011/03/echo_path_thumb_38305AB9.png" alt="echo_path" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ul>
<li>this outputs your PATH environment variable content. </li>
<li>Notice the git-achievements folder at the end. :) </li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/git_config_6F8D3358.png"><img height="37" width="362" src="//lostechies.com/jasonmeridth/files/2011/03/git_config_thumb_4133ADAB.png" alt="git_config" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ol>
<li>this allows uploads to your fork, on the gh-pages branch </li>
</ol>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/check_git_still_works_797224C3.png"><img height="75" width="372" src="//lostechies.com/jasonmeridth/files/2011/03/check_git_still_works_thumb_51CBA899.png" alt="check_git_still_works" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ol>
<li>to ensure you didn&rsquo;t break git </li>
</ol>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><a href="//lostechies.com/jasonmeridth/files/2011/03/git_achievements_help_45C9B865.png"><img height="146" width="590" src="//lostechies.com/jasonmeridth/files/2011/03/git_achievements_help_thumb_2BF58236.png" alt="git_achievements_help" border="0" style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" /></a>
<ol>
<li>shows the git achievements help </li>
<li>generates your first achievement as a &ldquo;Student&rdquo; (I already had mine) </li>
</ol>
</li>
</ul>
<p>Hope you guys have as much fun as I did.&nbsp; Yeah, yeah, I&rsquo;m a nerd.&nbsp; So what?&nbsp; ;)</p>
<p><a href="http://blog.jasonmeridth.com/git-achievements">http://blog.jasonmeridth.com/git-achievements</a></p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/09/25/git-achievements-on-windows/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Gotcha with Gitosis and python-setuptools</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/27/gotcha-with-gitosis-and-python-setuptools/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/27/gotcha-with-gitosis-and-python-setuptools/#comments</comments>
		<pubDate>Thu, 27 May 2010 04:58:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/27/gotcha-with-gitosis-and-python-setuptools.aspx</guid>
		<description><![CDATA[Today I decided to upgrade my slicehost slice from Intrepid Ibex to Lucid Lynx (Intrepid &#8594; Jaunty &#8594; Karmic &#8594; Lucid). Yeah, yeah, I&#8217;m a little behind. Anyways, It upgraded just fine. However when I was trying to push code&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/05/27/gotcha-with-gitosis-and-python-setuptools/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
Today I decided to upgrade my slicehost slice from Intrepid Ibex to Lucid Lynx (Intrepid &rarr; Jaunty &rarr; Karmic &rarr; Lucid). Yeah, yeah, I&rsquo;m a little behind. Anyways, It upgraded just fine. However when I was trying to push code to my gitosis instance (which I installed over a year ago), I got the following stack trace:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-27-at-12.06.50-AM.png" /></p>
<p>
This told me that I had been using python-setuptools for python 2.5. A little googling and praying that I wouldn&rsquo;t have to roll back to the snapshot I took before I started the upgrade (Thank God!), I found the solution. I went onto the gitosis slice, cloned the gitosis repository:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-27-at-12.07.06-AM.png" /></p>
<p>
and then ran the setup again:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-27-at-12.09.48-AM.png" /></p>
<p>and it fixed the issue. Did I mention how much I love google. Hope this helps someone else.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/27/gotcha-with-gitosis-and-python-setuptools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gitosis and Gitweb &#8211; Part 3 &#8211; Gitweb</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/27/gitosis-and-gitweb-part-3-gitweb/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/27/gitosis-and-gitweb-part-3-gitweb/#comments</comments>
		<pubDate>Thu, 27 May 2010 04:45:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[gitweb]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/27/gitosis-and-gitweb-part-3-gitweb.aspx</guid>
		<description><![CDATA[Gitosis and Gitweb &#8211; Part 1 Gitosis and Gitweb &#8211; Part 2 So we are setup, have a project, and have contributors via the first 2 parts. I know that we are all enamored by the UI of&#160;GitHub.com. I am.&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/05/27/gitosis-and-gitweb-part-3-gitweb/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a target="_self" href="/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-1-setup.aspx">Gitosis and Gitweb &ndash; Part 1<br /></a><a href="http://blog.jasonmeridth.com/2010/05/22/gitosis-and-gitweb-part-2.html"></a></p>
<p><a target="_self" href="/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-2-add-projects-and-contributors.aspx">Gitosis and Gitweb &ndash; Part 2</a></p>
<p>So we are setup, have a project, and have contributors via the first 2 parts.</p>
<p>I know that we are all enamored by the UI of&nbsp;<a href="http://github.com">GitHub.com</a>. I am. Unfortunately you can&rsquo;t get private repositories for free (In all fairness it&rsquo;s only $7/mo. &ndash; a&nbsp;<em>very</em>&nbsp;wise investment). I am aware of&nbsp;<a href="http://gitorious.com">Gitorious</a>&nbsp;like I mentioned in the first part, but I have no experience with that. I will after this series and update this series if I find it better. Again, I like to use the simplest thing that works. (Of course, &ldquo;simplest&rdquo; is in the eye of the beholder)</p>
<p>In this section I&rsquo;m going to show you how to install Gitweb, a UI tool that let&rsquo;s you view your repositories. I&rsquo;m also going to mention how to get it to auto-detect any new repositories and ensure they show up on the web UI. I learned how to do most of this from my co-worker <a target="_blank" href="http://twitter.com/ajmesserli">Antony Messerli</a>. He is a true Linux and problem-solving Jedi.</p>
<h2>Install Apache</h2>
<p>First, you need to ensure apache2 is installed. Check to see if you have an /etc/apache2 folder. If you do, you should be okay. If you don&rsquo;t, you need to install it.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.15-PM.png" /></p>
<p>For more in-depth advice, I always reference the&nbsp;<a href="http://articles.slicehost.com/2010/5/19/installing-apache-on-ubuntu">Slicehost Articles</a></p>
<p>Once you have that installed the daemon restarted, go to your slices ip address in the browser of your choice (i.e,. http://123.123.123.123) and you should something like &ldquo;It Works&rdquo;</p>
<p>Voila! You have apache running.</p>
<h2>Install the Package</h2>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.22-PM.png" /></p>
<p>This will install gitweb into /var/www/gitweb, create a conf file at /etc/gitweb.conf, and add three files to /usr/share/gitweb (git-favicon.png, git-logo.png, gitweb.css).</p>
<p>Note: If for some reason, the /var/www/gitweb folder&nbsp;<em>is not</em>&nbsp;created, you can clone the git source (git clone git://git.kernel.org/pub/scm/git/git.git) and then just copy the git/gitweb folder to /var/www/gitweb</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.28-PM.png" /></p>
<p>
You only need to edit the $projectroot variable in the /etc/gitweb.conf to point to your gitosis repositories folder:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.34-PM.png" /></p>
<p>
Since this isn&rsquo;t a post about Apache, I just add the gitweb directory setup to the base Apache config. Since Ubuntu includes the entire /etc/apache2/conf.d directory, I just added the following information into /etc/apach2/conf.d/gitweb:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.44-PM.png" /></p>
<p>
Restart Apache to make sure everything works</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.52-PM.png" /></p>
<p>The first time you go to your website again, you&rsquo;ll see Gitweb, but it&rsquo;ll say no projects are available. Fix mentioned below.</p>
<h3>Two Hacks (open to suggestions)</h3>
<p>1. I had to copy the git-favicon.png, git-logo.png, gitweb.css files from /usr/share/gitweb to /var/www/gitweb/. (if you had to do what is mentioned in the Note above, you don&rsquo;t have to do this, since the gitweb folder from the git source clone includes these files already)</p>
<p>2. I had to make the repositories that I wanted visible in gitweb have permissions of 755 (aka owner has read, write, execute. group and others have read, execute.)</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.47.58-PM.png" /></p>
<p>
Once that was done I can see the repository and it&rsquo;s information on Gitweb.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.48.07-PM.png" /></p>
<p>If you want to edit the project description from &#8220;Unnamed repository; edit this file &#8216;description&#8217; to name the repository.&#8221; go to the repositories description file (/home/git/repositories/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lostechies.git/description for this repo) and edit the file and save.</p>
<h3>Cron job</h3>
<p>I, again with the leadership of Ant, utilized a cron job he wrote to automatically make the repositories have permissions of 755. I do have some repositories, like gitosis-admin, that I do not ever want visible on Gitweb. The cron job excludes them. Here is the cron job code, showing that I don&rsquo;t want to show my personal.git and gitosis-admin.git repositories. This could be easily written in Ruby or any other &ldquo;scripting language&rdquo; of your choice:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.48.19-PM.png" /></p>
<p>I chose bash, so that I could take that time to learn it.<br />Translation: Find all the directories in my gitosis repository path (/home/git/repositories) and if they are not gitosis-admin or personal, change their permissions, recursively, to 0755.</p>
<p>I put this in a file called set_gitosis_permissions_to_view_on_gitweb.sh and put it in root&rsquo;s home folder, /root. I then called the file from root&rsquo;s crontab:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-26-at-11.48.26-PM.png" /></p>
<p>&nbsp;</p>
<p>This means that every 5 minutes, my bash file will set any new repositories to 0755. This is how to get Gitweb stood up. The next post will show how to hide it behind&nbsp;<span class="caps">HTTP</span>&nbsp;basic auth and a self-signed certificate.</p>
<p>Next Part: Hiding the Gitweb site</p>
<p>&nbsp;</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/27/gitosis-and-gitweb-part-3-gitweb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gitosis and Gitweb &#8211; Part 2 &#8211; Add Projects and Contributors</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-2-add-projects-and-contributors/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-2-add-projects-and-contributors/#comments</comments>
		<pubDate>Tue, 25 May 2010 03:02:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-2-add-projects-and-contributors.aspx</guid>
		<description><![CDATA[Gitosis and Gitweb &#8211; Part 1 So we are setup now thanks to Part 1. Gitosis repository contents If we issue the &#8220;find .&#8221; command locally inside the gitosis-admin directory we will see the following: We have the .git folder,&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-2-add-projects-and-contributors/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-1-setup.aspx">Gitosis and Gitweb &ndash; Part 1</a></p>
<p>So we are setup now thanks to Part 1.</p>
<h2>Gitosis repository contents</h2>
<p>If we issue the &ldquo;find .&rdquo; command locally inside the gitosis-admin directory we will see the following:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.11.04-PM.png" /></p>
<p>We have the .git folder, a gitosis.conf file, and a keydir with a pub key file.</p>
<h2>Add our first project</h2>
<p>Our project name for this example is lostechies. If you view the gitosis-admin.conf file you will see the initial content like so:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.11.11-PM.png" /></p>
<p>
This is the result of the following command from the last part:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.11.20-PM.png" /></p>
<p>That command puts the public ssh key into the keydirs directory and adds the associated username from the file to be the first member of the gisotis-admin project. Hence seeing user@local as the member. It matches the filename of the pub file in the keydir directory (user@local.pub). That&rsquo;s how gitosis relates members listed in the conf file to the keys in the keydir directory, filename minus the pub extension.</p>
<p>Let&rsquo;s edit this conf file to include our lostechies project:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.11.27-PM.png" /></p>
<p>
It looks exactly like the gitosis-admin one. Now we commit it just like we would normally when using Git. We can add, then commit or commit with the -am argument. This is possible since the gitosis-admin.conf file is already tracked by the repository.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.06-PM.png" /></p>
<p>
and push it to the remote gitosis-admin repository:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.12-PM.png" /></p>
<p>
We need to create the lostechies repository locally, add an initial item (<span class="caps">README</span>&nbsp;in this case), and push it remotely. Gitosis won&rsquo;t create the repository until something it pushed to it.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.20-PM.png" /></p>
<p>The lostechies repository now exists remotely. Currently my account is the only that has access. Let&rsquo;s add another contributor.</p>
<h2>Add our first contributors</h2>
<p>Say I want to allow my friend Joe to have commit (writable) access to my lostechies repository and I want my friend Ryan to only have readonly access. I tell them to send me their public ssh keys. I make sure the files are named joe.pub and ryan.pub. I then put them into my local gitosis-admin repository&rsquo;s keydir directory and then I edit the gitosis.conf file to be:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.27-PM.png" /></p>
<p>Notice that I had to create a whole new group (lostechies_ro) to setup Ryan&rsquo;s readonly access. You can&rsquo;t combine readonly and writable permissions in gitosis (wish we could &ndash; open source contribution there?).</p>
<p>Now I need to &ldquo;git add&rdquo; the new keys, and commit the changes to the conf file. Finally I push the changes.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.36-PM.png" /></p>
<p>
Now Joe or Ryan can clone this repository:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.43-PM.png" /></p>
<p>
<em><strong><span class="caps">NOTE</span>:</strong></em>&nbsp;Again, if they receive the following error:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.50-PM.png" /></p>
<p>The solution, involving the .ssh/config file is in the first post in this series.</p>
<p>That is how you create a repository and add users.</p>
<h2><span class="caps">DEBUG</span></h2>
<p>If you are unable to connect you have the option of editing the gitosis.conf file with more message verbosity by adding &ldquo;loglevel=<span class="caps">DEBUG</span>&rdquo; at the top of the conf file:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.14.58-PM.png" /></p>
<p>This will give you more information on the ouput when trying to push to the remote repository.</p>
<h2>Can&rsquo;t push changes</h2>
<p>As Scott Chacon states in his gitosis section of&nbsp;<a href="http://progit.org/book/ch4-7.html">Pro Git</a>:</p>
<blockquote>
<p>&ldquo;If you&rsquo;ve lost push access by pushing a messed-up configuration, you can manually fix the file on the server under /home/git/.gitosis.conf &mdash; the file from which Gitosis reads its info. A push to the project takes the gitosis.conf file you just pushed up and sticks it there. If you edit that file manually, it remains like that until the next successful push to the gitosis-admin project.&rdquo;</p>
</blockquote>
<p>The .gitosis.conf file in the git user&rsquo;s home directory is a symlink to the actual conf file in the gitosis-admin repository:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-10.15.03-PM.png" /></p>
<p>Next Part: Gitweb</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-2-add-projects-and-contributors/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Gitosis and Gitweb &#8211; Part 1 &#8211; Setup</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-1-setup/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-1-setup/#comments</comments>
		<pubDate>Tue, 25 May 2010 02:42:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-1-setup.aspx</guid>
		<description><![CDATA[I&#8217;ve had a number of people ask me where they should host their Git repositories. Of course, my default question back is, &#8220;Can the code be public or does it need to be private?&#8221;. Usually they say, &#8220;public&#8221;. Therefore, my&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-1-setup/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&rsquo;ve had a number of people ask me where they should host their Git repositories. Of course, my default question back is, &ldquo;Can the code be public or does it need to be private?&rdquo;. Usually they say, &ldquo;public&rdquo;. Therefore, my repsonse is&nbsp;<a href="http://github.com">Github.com</a>. If they say, &ldquo;private&rdquo; I still say Github. &nbsp;If they don&#8217;t <a target="_blank" href="http://github.com/security">&#8220;trust&#8221; Github</a>, which they should &#8211; click the link, then my response is&nbsp;<a href="http://eagain.net/gitweb/?p=gitosis.git;a=summary">Gitosis</a>&nbsp;and&nbsp;<a href="http://git.wiki.kernel.org/index.php/Gitweb">Gitweb</a>. This is by no means the only solution. I&rsquo;m aware of other ones like Gitorious. I&rsquo;ve never used Gitorious.</p>
<p>Back to Gitosis. My personal Gitosis server is a slice at&nbsp;<a href="http://slicehost.com">Slicehost.com</a>. You can use an Ubuntu server at home as long as you have remote access. I&rsquo;ve personally only used Gitosis with an Ubuntu slice, so I don&rsquo;t know if there are any quirks with other Linux distributions. After setting up a slice (after following the instructions&nbsp;<a href="http://articles.slicehost.com/2008/11/28/ubuntu-intrepid-setup-page-1">here</a>&nbsp;and&nbsp;<a href="http://articles.slicehost.com/2008/11/28/ubuntu-intrepid-setup-page-2">here</a>) I am ready to go.</p>
<p>Notice: This post is a combination of&nbsp;<a href="http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way">scie.nti.st&rsquo;s gitosis post</a>&nbsp;and&nbsp;<a href="http://progit.org/book/ch4-7.html">Scott Chacon&rsquo;s Pro Git gitosis section</a>. They are my de facto references. Maybe my own will be now. :)</p>
<p>&ldquo;Enough talk. Let&rsquo;s fight&rdquo; ~Po, Kung Fu Panda</p>
<h2>Intall Git</h2>
<p>After logging into your box, let&rsquo;s install Git (if not already installed):</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.40.03-PM.png" /></p>
<p>
Press enter or type &lsquo;Y&rsquo; and press enter and git will be installed. Type the following to confirm:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.40.16-PM.png" /></p>
<p>
and you&rsquo;ll see something like:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.40.35-PM.png" /></p>
<h2>Intall python-setuptools</h2>
<p>Also install the python-setuptools because we&rsquo;ll need them (gitosis is written in python):</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.40.43-PM.png" /></p>
<p>Press enter or type &lsquo;Y&rsquo; and press enter and python-setuptools will be installed.</p>
<h2>Download Gitosis</h2>
<p>We need to clone the gitosis source locally to install it:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.40.53-PM.png" /></p>
<h2>Install Gitosis</h2>
<p>Now let&rsquo;s install it:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.00-PM.png" /></p>
<p><a href="http://gist.github.com/352769" target="_blank">Gist</a>. Gitosis is now installed. Next steps are to create git user and handle a file permission on a git hook.</p>
<h2>Create Git User</h2>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.09-PM.png" /></p>
<p>
You&rsquo;ll see something like the following if it is successful</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.17-PM.png" /></p>
<h2>Use local, public ssh key</h2>
<p>You need to initially use your public ssh key (id_rsa.pub). If you have one, it will be at $<span class="caps">HOME</span>/.ssh/id_rsa.pub and if you have never generated one, you can do so by running the following command (accept the default location and you don&rsquo;t need to enter a passphrase when prompted):</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.30-PM.png" /></p>
<p>
Now you need to upload it to the server/slice. I usually use the scp (secure copy command):</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.43-PM.png" /></p>
<p>This will upload the local id_rsa.pub file to the /tmp/ folder on the server. Why there? So that the git user can use it. How is that possible? The folder has permissions of 777 (drwxrwxrwt) meaning everyone has read and write access to it.</p>
<h3>Sidenote:&nbsp;<span class="caps">SSH</span>&nbsp;Port</h3>
<p>If you have your sshd daemon running on a different port other than 22 (which is the default, but I highly suggest changing), then you need to use scp like this:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.49-PM.png" /></p>
<p>I believe the &ldquo;-P&rdquo; option must be capitalized.</p>
<h2>Initialize gitosis-admin repository</h2>
<p>On the server, issue the following command to set your public ssh key as the first authorized key of a new gitosis-admin repository:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.41.57-PM.png" /></p>
<p>
You will see something like the following:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.04-PM.png" /></p>
<p>This means it was successful.</p>
<p>Take note: If you put your id_rsa.pub file in a different location you need to use that instead of /tmp/id_rsa.pub</p>
<h2>Change Permissions on post-update hook</h2>
<p>You have to set the permissions on the post-update git hook of the gitosis-admin repository so that gitosis-admin can add new repository structures when they are added/removed to/from the gitosis.conf file.</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.11-PM.png" /></p>
<p>Note:&nbsp;<em>First round of this post, I didn&rsquo;t make this change. When I added a new project, it failed because this hook didn&rsquo;t have the right permissions.</em></p>
<h2>Clone gitosis-admin repository</h2>
<p>Now we&rsquo;re going to use Git to administrate this gitosis instance. I think that is pretty ingenius. Let&rsquo;s clone the gitosis-admin repository locally:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.31-PM.png" /></p>
<p>We are now in the gitosis-admin repository folder locally</p>
<h3>Two most common errors</h3>
<p><strong><span class="caps">FIRST</span>&nbsp;<span class="caps">ONE</span>:</strong></p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.41-PM.png" /></p>
<p>
it is because you have used a port for&nbsp;<span class="caps">SSH</span>&nbsp;other than port 22 (the default). To fix this, you need to edit your .ssh/config file and add the following:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.50-PM.png" /></p>
<p>Of course, you need to put in your server hostname and port number (i.e., mydomain.com and 12345)</p>
<p><strong><span class="caps">SECOND</span>&nbsp;<span class="caps">ONE</span>:</strong></p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.42.55-PM.png" /></p>
<p>
This has usually hit me because I locked down my /etc/ssh/sshd_config file to only allow in certain users or groups. I have to change the AllowUsers line in my file from:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.43.02-PM.png" /></p>
<p>
to</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.43.07-PM.png" /></p>
<p>
Once I restart the ssh daemon:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.43.13-PM.png" /></p>
<p>Now the git user has access to reach my server/slice via ssh.</p>
<h3>The local gitosis-admin repository</h3>
<p>You now have a local clone of the gitosis-admin repository. The contents are only a conf file and key directory:</p>
<p><img src="//lostechies.com/jasonmeridth/files/2011/03/Screen-shot-2010-05-24-at-9.43.19-PM.png" /></p>
<p>&nbsp;</p>
<p>Note: before anyone asks, the (master) notation in my prompt is usage of the&nbsp;<a href="/blogs/jason_meridth/archive/2010/05/22/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1.aspx" target="_blank">__git_ps1</a></p>
<p>Next Part:&nbsp;<a target="_self" href="/blogs/jason_meridth/archive/2010/05/24/gitosis-and-gitweb-part-2-add-projects-and-contributors.aspx">Add Projects and Contributors</a></p>
<p>&nbsp;</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/25/gitosis-and-gitweb-part-1-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My &quot;Git Branching and Workflows&quot; presentation at Austin Code Camp 2010</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/24/my-quot-git-branching-and-workflows-quot-presentation-at-austin-code-camp-2010/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/24/my-quot-git-branching-and-workflows-quot-presentation-at-austin-code-camp-2010/#comments</comments>
		<pubDate>Mon, 24 May 2010 13:40:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/24/my-quot-git-branching-and-workflows-quot-presentation-at-austin-code-camp-2010.aspx</guid>
		<description><![CDATA[Thanks to Shawn Weisfeld for recording this presentation. &#160;Enjoy. &#160; Post Footer automatically generated by Add Post Footer Plugin for wordpress.]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a target="_blank" href="http://www.drowningintechnicaldebt.com/ShawnWeisfeld/Default.aspx">Shawn Weisfeld</a> for recording this presentation. &nbsp;Enjoy.</p>
<p>&nbsp;</p>
</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/24/my-quot-git-branching-and-workflows-quot-presentation-at-austin-code-camp-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seeing which Git branch I&#8217;m on via my console prompt (__git_ps1)</title>
		<link>http://lostechies.com/jasonmeridth/2010/05/23/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/05/23/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1/#comments</comments>
		<pubDate>Sun, 23 May 2010 02:55:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/05/22/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1.aspx</guid>
		<description><![CDATA[&#160; I like knowing which Git branch I&#8217;m currently in. I use the git-ps1 function feature that comes with git-core. If you clone or download the git source: git://git.kernel.org/pub/scm/git/git.git There is a file in the contrib/completion folder called git-completion.bash: ~/code/git/contrib/completion&#60;span&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/05/23/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>I like knowing which Git branch I&rsquo;m currently in. I use the git-ps1 function feature that comes with git-core. If you clone or download the git source:</p>
<div class="highlight">
<pre><code>git://git.kernel.org/pub/scm/git/git.git
</code></pre>
</div>
<p>There is a file in the contrib/completion folder called git-completion.bash:</p>
<div class="highlight">
<pre><code>~/code/git/contrib/completion&lt;span class="o"&gt;(&lt;/span&gt;master&lt;span class="o"&gt;)&lt;/span&gt; &gt; ls
total 96
-rwxr-xr-x  1 user  staff    44K Apr 14 15:26 git-completion.bash
</code></pre>
</div>
<p>I copy this file to my $<span class="caps">HOME</span>&nbsp;folder as .git-completion.bash and then reference it and the ps1 propt feature in my .bashrc file</p>
<div class="highlight">
<pre><code>&lt;span class="nb"&gt;source&lt;/span&gt; ~/.git-completion.bash
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PS1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'w$(__git_ps1 "(%s)") &gt; '&lt;/span&gt;
</code></pre>
</div>
<p>And now whenever I cd into a folder that is a Git repository I see something like the following prompt:</p>
<div class="highlight">
<pre><code>~/gitosis-admin&lt;span class="o"&gt;(&lt;/span&gt;master&lt;span class="o"&gt;)&lt;/span&gt; &gt;
</code></pre>
</div>
<p>Notice the (master) notation. That is telling me I&rsquo;m on the master branch. It&rsquo;s just easier than issuing a &ldquo;git branch&rdquo; command everytime I want to know.</p>
<p>I know there are many other configurations out there, but I like to use the simplest thing that works.</p>
<p>&nbsp;</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/05/23/seeing-which-git-branch-i-m-on-via-my-console-prompt-git-ps1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OAuth</title>
		<link>http://lostechies.com/jasonmeridth/2010/04/05/oauth/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/04/05/oauth/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 04:25:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[oauth]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/04/05/oauth.aspx</guid>
		<description><![CDATA[UPDATE: Fixed puts statements. &#160;should have been x.token, not x.key. I have gotten tired of twitterfeed not handling our&#160;RSS&#160;feed and tweeting our new posts. So have the other LosTechies members. I decided to finally learn OAuth so that I can&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/04/05/oauth/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>UPDATE: Fixed puts statements. &nbsp;should have been x.token, not x.key.</p>
<p>I have gotten tired of twitterfeed not handling our&nbsp;<span class="caps">RSS</span>&nbsp;feed and tweeting our new posts. So have the other LosTechies members. I decided to finally learn OAuth so that I can write a script/app to handle tweeting our new blog posts.</p>
<p>This is the way I learned so bare with me.</p>
<p>First things first, is you have to go to&nbsp;<a href="http://twitter.com">twitter</a>&nbsp;and login to your account. Once done, register your&nbsp;<a href="http://twitter.com/oauth_clients">OAuth application</a>&nbsp;and click the&nbsp;<a href="http://twitter.com/apps/new">Register a new application</a>&nbsp;link. This will set you up with an OAuth consumer key and secret; which we need to obtain the OAuth request token/secret and our ultimate goal of an OAuth access token/secret.</p>
<p>Required fields that I had to fill out were:</p>
<ol>
<li>Application Name</li>
<li>Descriptions</li>
<li>Application Website</li>
<li>Application Type (I chose Client)</li>
<li>Default Access Type (I chose Read &amp; Write)</li>
<li>ReCaptcha at the bottom.</li>
</ol>
<p><img src="http://c1261852.cdn.cloudfiles.rackspacecloud.com/twitter_new_oauth_app.png" /></p>
<p>Once accepted you&rsquo;ll be directed to a page displaying your consumer key and secret, like this:</p>
<p><img src="http://c1261852.cdn.cloudfiles.rackspacecloud.com/oauth_consumer_key_and_secret.png" /></p>
<p>I&rsquo;ve looked at a few ways to do this and the easiest that I found was by using the&nbsp;<a href="http://github.com/moomerman/twitter_oauth">twitter_oauth gem</a>. Following the&nbsp;<span class="caps">README</span>&nbsp;for this gem I was able to get an access token/secret pretty easily.</p>
<p>I&rsquo;m doing all of this through&nbsp;<span class="caps">IRB</span>&nbsp;because there is one part where you need to open a web page and allow your twitter client to post to Twitter.</p>
<pre>~ &gt; irb
irb(main):001:0$ require 'rubygems'
=&gt; true
irb(main):002:0$ require 'twitter_oauth'
=&gt; true
irb(main):003:0$ client = TwitterOAuth::Client.new(
irb(main):004:1* :consumer_key =&gt; 'YOUR_APP_CONSUMER_KEY',
irb(main):005:1* :consumer_secret =&gt; 'YOURA_APP_CONSUMER_SECRET')
)
=&gt; ...object output...
irb(main):005:0$ request_token = client.request_token
=&gt; ...object output...
irb(main):006:0$ puts request_token.token, request_token.secret
=&gt; [REQUEST_TOKEN]
=&gt; [REQUEST_SECRET]
irb(main):007:0$ request_token.authorize_url
=&gt; http://twitter.com/oauth/authorize?oauth_token=TOKEN
</pre>
<p>Copy that url and put it into your browser of choice. When the &ldquo;Deny&rdquo; and &ldquo;Allow&rdquo; buttons become visible, click the &ldquo;Allow&rdquo; button. You will be presented with a numeric&nbsp;<span class="caps">PIN</span>. Copy that number into your clipboard because we&rsquo;re going to use it on this final step to obtain the OAuth Access Token and Secret.</p>
<pre>irb(main):007:0$ access_token = client.authorize(
irb(main):008:1*   request_token.token,
irb(main):009:1*   request_token.secret,
irb(main):0010:1*  :oauth_verifier =&gt; 'THE_NUMERIC_PIN_YOU_GOT_FROM_TWITTER'
irb(main):0011:1* )
=&gt; ...object output...
irb(main):0011:0$ puts access_token.token, access_token.secret
=&gt; [ACCESS_TOKEN]
=&gt; [ACCESS_SECRET]
irb(main):0012:0$ client.authorized?
=&gt; true
</pre>
<p>You now have everything you need to use the TwitterOAuth gem without having to authenticate everytime.</p>
<pre>irb(main):0013:0$ client = TwitterOAuth::Client.new(
irb(main):0014:1*    :consumer_key =&gt; 'YOUR_CONSUMER_KEY',
irb(main):0015:1*    :consumer_secret =&gt; 'YOUR-CONSUMER-SECRET',
irb(main):0016:1*    :token =&gt; access_token.token, 
irb(main):0017:1*    :secret =&gt; access_token.secret
)
=&gt; ...object output...
irb(main):0017:0$ client.authorized?
=&gt; true
</pre>
<p>
To tweet something after you have the client instance, just call the update method:
</p>
<pre>client.update('test tweet with OAuth')
</pre>
<p>That is how I figured out OAuth without a callback&nbsp;<span class="caps">URL</span>. Hacky, but it works.</p>
<p>&nbsp;</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/04/05/oauth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;Pro Git&quot; Cliff Notes</title>
		<link>http://lostechies.com/jasonmeridth/2010/04/05/quot-pro-git-quot-cliff-notes/</link>
		<comments>http://lostechies.com/jasonmeridth/2010/04/05/quot-pro-git-quot-cliff-notes/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 04:17:00 +0000</pubDate>
		<dc:creator>Jason Meridth</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">/blogs/jason_meridth/archive/2010/04/05/quot-pro-git-quot-cliff-notes.aspx</guid>
		<description><![CDATA[&#160; These are my notes from reading Scott Chacon’s Pro Git I highly suggest buying this book if you are serious about using the Git version control tool. pg 48 A branch in Git is simply a lightweight movable pointer&#160;&#8230; <a href="http://lostechies.com/jasonmeridth/2010/04/05/quot-pro-git-quot-cliff-notes/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>These are my notes from reading Scott Chacon’s <a href="http://progit.org/book" target="_blank">Pro Git</a></p>
<p>I highly suggest <a href="http://tinyurl.com/amazonprogit" target="_blank">buying this book</a> if you are serious about using the Git version control tool.</p>
<p><a href="http://progit.org/book/ch3-1.html" target="_blank">pg 48</a></p>
<p>A branch in Git is simply a lightweight movable pointer</p>
<p><a href="http://progit.org/book/ch3-1.html" target="_blank">pg 50</a></p>
<p>a special pointer called HEAD…is a pointer to the local branch you’re currently on</p>
<p><a href="http://progit.org/book/ch3-1.html" target="_blank">pg 52</a></p>
<p>Creating a new branch is as quick and simple as writing 41 bytes to a file (40 characters and a newline).</p>
<p><a href="http://progit.org/book/ch3-2.html" target="_blank">pg 53</a></p>
<p>To create a branch and switch to it at the same time…git checkout command with the -b switch</p>
<p><a href="http://progit.org/book/ch3-3.html" target="_blank">pg 61</a></p>
<p>To see the last commit on each branch, you can run git branch -v</p>
<p><a href="http://progit.org/book/ch3-5.html" target="_blank">pg 69</a></p>
<pre>git checkout -b [branch] [remotename]/[branch]</pre>
<p>is the same as</p>
<pre>git checkout --track [remotename]/[branch]</pre>
<p><a href="http://progit.org/book/ch4-1.html" target="_blank">pg 81</a></p>
<p>Git protocol…listens on a dedicated port (9418)</p>
<p><a href="http://progit.org/book/ch4-1.html" target="_blank">pg 82</a></p>
<p>The Git protocol is the fastst transfer protocol available.</p>
<p><a href="http://progit.org/book/ch5-2.html" target="_blank">pg 111</a></p>
<p>The Git project provides a document that lays out a number of good tips for creating commits from which to submit patches—you can read it in the Git source code in the Documentation/SubmittingPatches file.</p>
<p><a href="http://progit.org/book/ch5-2.html" target="_blank">pg 116</a></p>
<pre>git log --no-merges origin/master ^issue54</pre>
<p><a href="http://progit.org/book/ch5-2.html" target="_blank">pg 121</a></p>
<p>Compare origin changes with local changes before merging:</p>
<pre>git log origin/featureA ^feature</pre>
<p><a href="http://progit.org/book/ch5-2.html" target="_blank">pg 126</a></p>
<pre>git merge --no-commit --squash featureB</pre>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 130</a></p>
<pre>git apply</pre>
<p>It’s almost identical to running a patch -p1 command to apply the patch, although it’s more paranoid and accepts fewer fuzzy matches then patch.</p>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 131</a></p>
<pre>git apply --check</pre>
<p>check to see if a patch applies cleanly before you try actually applying it</p>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 134</a></p>
<pre>git log contrib --not master</pre>
<p>To find common ancestor of both branches</p>
<pre>git merge-base contrib master</pre>
<pre>git diff [sha1 from previous command]</pre>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 135</a></p>
<pre>git diff master...topic</pre>
<p>shows you only the work your topic branch has introduced since its common ancestor with master.</p>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 140</a></p>
<p>tagging releases with signed keys</p>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 141</a></p>
<p>generating a build number with your tags</p>
<p>preparing a release as a tarball</p>
<p><a href="http://progit.org/book/ch5-3.html" target="_blank">pg 142</a></p>
<p>Show work by author since a specific time</p>
<pre>git shortlog --no-merges master --not v1.0.1</pre>
<p><a href="http://progit.org/book/ch6-1.html" target="_blank">pg 144</a></p>
<p>Git can figure out a short, unique abbreviation for your SHA-1 values</p>
<pre>git log --abbrev-commit --pretty=oneline</pre>
<p>wolves paragraph</p>
<p><a href="http://progit.org/book/ch6-1.html" target="_blank">pg 145</a></p>
<p>Find out the SHA1 of a branch</p>
<pre>git rev-parse [branch]</pre>
<p><a href="http://progit.org/book/ch6-1.html" target="_blank">pg 146</a></p>
<p>To see reflog information inline with your normal log information</p>
<pre>git log -g master</pre>
<p>Because reflog is a log, it will show you where the HEAD pointer was 2 months ago – if the repo is older than that</p>
<pre>git show HEAD@{2.months.ago}</pre>
<p><a href="http://progit.org/book/ch6-1.html" target="_blank">pg 147</a></p>
<p>^ is the first parent of the current commit ^2 is the second parent of the current commit (only works if the current commit is a merge commit, where first parent is the branch you on when you merged, second was the other) ~ is the first parent ~2 (or any number) is the grandparent(s) of the current commit only on the current branch or branch you were on when you merged</p>
<p><a href="http://progit.org/book/ch6-1.html" target="_blank">pg 148</a></p>
<p>Shows you any commits in your current branch that aren’t in the master branch on your origin remote</p>
<pre>git log origin/master..HEAD</pre>
<p>Git substitutes HEAD if one side is missing (git log origin/master..)</p>
<p>Just like above command and example shown on pg134</p>
<pre>git log refB --not refA</pre>
<p><a href="http://progit.org/book/ch6-3.html" target="_blank">pg 155</a></p>
<p>Tells the stash command to try to reapply the staged changes</p>
<pre>git stash apply --index</pre>
<p><a href="http://progit.org/book/ch6-3.html" target="_blank">pg 156</a></p>
<p>Create a branch from a stash, testchanges</p>
<pre>git stash branch testchanges</pre>
<p><a href="http://progit.org/book/ch6-4.html" target="_blank">pg 157</a></p>
<p>…don’t amend your last commit if you’ve already pushed it (git commit —amend command)</p>
<pre>git rebase -i HEAD~3</pre>
<p>Don’t include any commit you’ve already pushed to a central server—doing so will confuse other developers by providing an alternate version of the same change</p>
<p><a href="http://progit.org/book/ch6-4.html" target="_blank">pg 158</a></p>
<p>It’s important to note that these commits (interactive rebase) are listed in the opposite order (oldest first, newest last) than you normally see then using the log command (newest first).</p>
<p><a href="http://progit.org/book/ch6-4.html" target="_blank">pg 160</a></p>
<p>…make sure no commit shows up in that list (git log -4 —pretty=format:“%h %s”) that you’ve already pushed to a shared repository</p>
<p><a href="http://progit.org/book/ch6-5.html" target="_blank">pg 164</a></p>
<p>was wondering how to automate the good/bad declaration</p>
<p><a href="http://progit.org/book/ch6-6.html" target="_blank">pg 168</a></p>
<p>git submodule update You have to do this every time you pull down a submodule change in the main projects. It’s strange, but it works.</p>
<p><a href="http://progit.org/book/ch6-7.html" target="_blank">pg 172 (subtree merging)</a></p>
<p>You want to pull the Rack project into your master project as a subdirectory</p>
<pre>git read-tree --prefix=rack/ -u rack_branch</pre>
<p><a href="http://progit.org/book/ch7-1.html" target="_blank">pg 175</a></p>
<p>global git config /etc/gitconfig<br />
user global git config ~/.gitconfig<br />
local repository git config .git/config</p>
<p><a href="http://progit.org/book/ch7-1.html" target="_blank">pg 182</a></p>
<pre>git config --global core.autocrlf input</pre>
<p>This setup should leave you with CRLF endings in Windows checkouts but LF endings on Mac and Linux systems and in the repository</p>
<p><a href="http://progit.org/book/ch7-2.html" target="_blank">pg 184</a></p>
<p>To tell Git to treat a specific file as binary data, add the following line to your .gitattributes file: *.extension -crlf -diff</p>
<p><a href="http://progit.org/book/ch7-2.html" target="_blank">pg 185</a></p>
<p>…one of the most annoying problems known to humanity: version-controlling Word documents (LOL)</p>
<p><a href="http://progit.org/book/ch7-3.html" target="_blank">pg 192</a></p>
<p>post-receive hook…This scripts can’t stop the push process, but the client doesn’t disconnect until it has completed; so, be careful when you try to do anything that may take a long time</p>
<p><a href="http://progit.org/book/ch7-4.html" target="_blank">pg 194</a></p>
<p>Is practically the git log command…it prints out only the SHA-1 values and no other information</p>
<pre>git rev-list [SHA-1]..[SHA-1]</pre>
<p>Get the commit message from each of these commits to test</p>
<p>git cat-file commit [SHA-1]</p>
<p>Incantation:</p>
<pre>git cat-file commit [SHA-1] | sed '1,/^$/d'</pre>
<p><a href="http://progit.org/book/ch7-4.html" target="_blank">pg 196</a></p>
<p>See what files have been modified in a single commit</p>
<pre>git log -1 --name-only --pretty=oneline:'' [SHA-1]</pre>
<p><a href="http://progit.org/book/ch7-4.html" target="_blank">pg 198</a></p>
<p>anything your script prints to stdout will be transferred to the client</p>
<p>pg 200</p>
<p>Get your file listing from the staging area</p>
<pre>git diff-index --cached --name-only HEAD</pre>
<p><a href="http://progit.org/book/ch9-2.html" target="_blank">pg 224</a></p>
<p>Git is a content-addressable filesystem</p>
<p>hash-object (plumbing command)</p>
<p><a href="http://progit.org/book/ch9-2.html" target="_blank">pg 221</a></p>
<p>Pull the content back out of Git</p>
<pre>git cat-file -p [SHA-1]</pre>
<p><a href="http://progit.org/book/ch9-2.html" target="_blank">pg 226</a></p>
<p>Git will tell you what type of object it is [blob, tree, tag, commit]</p>
<pre>git cat-file -t [SHA-1]</pre>
<p><a href="http://progit.org/book/ch9-2.html" target="_blank">pg 231</a></p>
<p>Git compresses the new content with zlib</p>
<p>&nbsp;
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/jasonmeridth/2010/04/05/quot-pro-git-quot-cliff-notes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
