<?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>Mindstab.net &#187; Server</title>
	<atom:link href="http://www.mindstab.net/wordpress/archives/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mindstab.net/wordpress</link>
	<description>Various projects and musings</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>On the go</title>
		<link>http://www.mindstab.net/wordpress/archives/693</link>
		<comments>http://www.mindstab.net/wordpress/archives/693#comments</comments>
		<pubDate>Fri, 08 Jan 2010 05:04:41 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Reading]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=693</guid>
		<description><![CDATA[So, what have I got on the go?

School: Last semester, just two classes, but they are looking like they'll be delicious and meaty

CS 411: Compiler design: We build a java compiler
CS 415: We build an operating system, fun times with C!
...actually, I'm also taking spanish!


"Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp" by [...]]]></description>
			<content:encoded><![CDATA[<p>So, what have I got on the go?</p>
<ul>
<li>School: Last semester, just two classes, but they are looking like they'll be delicious and meaty
<ul>
<li>CS 411: Compiler design: We build a java compiler</li>
<li>CS 415: We build an operating system, fun times with C!</li>
<li>...actually, I'm also taking spanish!</li>
</ul>
</li>
<li>"Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp" by Peter Norvig.  I got this for christmas and have started to work through it.  I'm really excited about getting further into it.  In the middle of it I'll be implementing prolog in Lisp and the in the latter half I'll be working on a natural language processor! Not to mention tons of other stuff, this book is huge and dense.</li>
<li><a href="http://battlecode.mit.edu/2010/">BattleCode 2010</a> has just started so my team and I are just about to start digging into that.  Lots of AI coding to be done there.</li>
<li>Peter Michaux's <a href="http://peter.michaux.ca/articles/scheme-from-scratch-introduction">Scheme from Scratch</a>.  I stumbled upon this from <a href="http://news.ycombinator.com/news">Hacker News</a>.  This fellow wants to write his own scheme to scratch a mental itch, and he's blogging each step and posting the code as well.  I think it looks like a great amount of fun and that I too have that mental itch, so I'm following along, using his blog as a guide and looking at his code as well when I get stuck, but doing my best to do it myself.</li>
<li>The great mindstab.net migration to the cloud!  Yes, setting up an entirely new server and migrating years of site history and email etc can take a lot of work.</li>
</ul>
<p>So yeah, I have an insane amount of work on my plate, but I couldn't be more excited!  All of it is thrilling and amazing!</p>
<p>Also, if I haven't mentioned it before, the dynamic duo of Jono Bacon and Stuart Langridge of Lug Radio fame are back with a new podcast <a href="http://shotofjaq.org/">Shot of Jaq</a>!  It's fun.  Really, those two Brits have been the source of the only podcast's I've ever listened to.  They are a great source of both Linux and British in my weekly diet.</p>
<p>But now I'm stoked to just find out that Ximian/Linux rockstar coder Nat Friedman and Tomboy creator and a rock star in his own right Alex Graveley have started a brand new podcast <a href="http://hackermedley.org/">Hacker Medley</a> that is the first new podcast that I'm actually quite excited to try out.</p>
<p>Finally, I'm reading "Pattern Recognition" by William Gibson in my spare time (read: on the bus) and finding it pleasant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/693/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Live from the cloud</title>
		<link>http://www.mindstab.net/wordpress/archives/691</link>
		<comments>http://www.mindstab.net/wordpress/archives/691#comments</comments>
		<pubDate>Fri, 08 Jan 2010 04:39:11 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/archives/691</guid>
		<description><![CDATA[... and we're back! Just in time for our 8th birthday.
Mindstab.net's been around.  It started back in January of 2002 running on a 486 from my bedroom.  A few years later when I had some money, I bought a trusty 1U rackmount server, kvasir, and migrated mindstab there.  Kvasir started co-located but [...]]]></description>
			<content:encoded><![CDATA[<p>... and we're back! Just in time for our 8th birthday.</p>
<p>Mindstab.net's been around.  It started back in January of 2002 running on a 486 from my bedroom.  A few years later when I had some money, I bought a trusty 1U rackmount server, kvasir, and migrated mindstab there.  Kvasir started co-located but when money dried up some, I brought kvasir home and mindstab has been living in my room for the last several years.</p>
<p>That all ended yesterday morning at 3:30am when I was awoken by kvasir's PSU fan screaming to death.  The writing had been on the wall for a bit that things were going to have to change. I knew the fan was on its last legs, and hosting from home had been getting ever more precarious as both the local ISPs seem unable to provide a stable and reliable net connection.  To that end I'd been playing with a VPS at linode.com (recommended in a blog post by <a href="http://briancarper.net/">Brian Carper</a>) but I hadn't gotten very far.  Actually, after a month I was still poking at the kernel trying to get my general paranoid level of security with grsecurity and PaX to work with the Xen virtual host at Linode.  Anyways, at 3:30am yesterday I went into emergency mode and acceptable that their stock kernel "might just suffice" and started madly installing infrastructure software.  Since then I've been copying over data and starting to bring services back up.  So far we have a firewall, DNS, Jabber and I'm just starting to get the websites back up, this being the first.</p>
<p>Lots of work ahead.  I need to get the rest of the sites up.  Then I have to dive into the mess that is e-mail.  I'd previously been using a qmail/vpopmail/courier system but I think I'm chucking that for a postfix/dovecot system, but I'm sure it'll take some kicking to get it up and get all my mail into it.  Hopefully not too much.  Then onto less crucial systems, then go back and re-vet alot of things.</p>
<p>So yeah, as of now, mindstab.net is coming to you from my new server Loki, in the cloud... or New Jersey more specifically :P</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/691/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup around firewalls with ssh and rsync to encrypted destinations</title>
		<link>http://www.mindstab.net/wordpress/archives/589</link>
		<comments>http://www.mindstab.net/wordpress/archives/589#comments</comments>
		<pubDate>Fri, 14 Aug 2009 20:09:08 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=589</guid>
		<description><![CDATA[I decided I really needed to work on a server backup system, so here are my notes on the system I have now.
First things first, the files I want to backup are owned by all different users, so the only user who can run the backup process is root.  Therefore I can't just run [...]]]></description>
			<content:encoded><![CDATA[<p>I decided I really needed to work on a server backup system, so here are my notes on the system I have now.</p>
<p>First things first, the files I want to backup are owned by all different users, so the only user who can run the backup process is root.  Therefore I can't just run rsync from my local machine and grab the files from the server, the backup process has to be run on the server and backup to the backup machine.  Now in my case this was a bit of a trick because the backup machine was behind a firewall, so the server had no direct line of communication to it.  So I wrote a script to turn on a reverse ssh port forward.</p>
<p><strong>recv-serv-backup.sh</strong></p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh</span> -R <span style="color: #000000;">8000</span>:<span style="color: #000000;">127.0</span><span style="color: #000000;">.0</span><span style="color: #000000;">.1</span>:<span style="color: #000000;">22</span> -N user@kvasir.mindstab.net
&nbsp;</pre>
<p>When run on the backup machine behind a firewall, it connects to the server (kvasir) and listens on port 8000.  When ssh on kvasir connects to port 8000 it redirects that traffic to local port 22, the ssh port of the backup machine.  This is how the firewall is gotten around.  Reverse port mapping is a cool trick to master.</p>
<p>Next as root on kvasir I generated a public ssh key and put it on the backup machine so root could automatically log on repeatedly to the back up machine (think lots of rsync calls) once the key was loaded once.  Then I hooked up the key to keychain.  That is all better outlined at:<br />
<a href="http://www.gentoo.org/doc/en/articles/openssh-key-management-p1.xml">Gentoo Linux Documentation: OpenSSH key management, Part 1</a> and<br />
<a href="http://www.gentoo.org/doc/en/articles/openssh-key-management-p2.xml">Gentoo Linux Documentation: OpenSSH key management, Part 2</a>.</p>
<p>The all I needed to do was poke the rsync syntax to use the nonstandard ssh port for backup.  The best method I found was </p>
<pre>
rsync -e "ssh -p 8000" -av
</pre>
<p>rsync for those of you who don't know is a great little backup tools.  It's like a smart (in that it only copies files that have been modified since the last backup) network aware (since it can use ssh) copy tool.  Simple but really useful.</p>
<p>So with that I wrote a backup script on the server</p>
<p><strong>server-backup.sh</strong></p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
&nbsp;
backup <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1...&quot;</span>
        <span style="color: #007800;">DST=</span>`<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1&quot;</span> | <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{split($0,a,&quot;/&quot;);  result = &quot;/&quot;; for (i=2 ; i &lt; length(a)  ; i++)   result = result &quot;/&quot; a[i];  print result;  };'</span>`
        rsync -e <span style="color: #ff0000;">&quot;ssh -p 8000&quot;</span> -acv $<span style="color: #000000;">1</span> dan@<span style="color: #000000;">127.0</span><span style="color: #000000;">.0</span><span style="color: #000000;">.1</span>:~/kvasir<span style="color: #007800;">$DST</span> ;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
backup <span style="color: #ff0000;">&quot;/svn&quot;</span>
backup <span style="color: #ff0000;">&quot;/git&quot;</span>
...
&nbsp;</pre>
<p>There is one caveat, rsync won't create subdirectories on the other side specified in the path so you need to create the basic directory structure.</p>
</pre>
<pre>
 rsync -e "ssh -p 8000" -av /git user@127.0.0.1:~/kvasir/git
</pre>
<p>is fine because it will create /git just fine, but</p>
<pre>
 rsync -e "ssh -p 8000" -av /home/user user@127.0.0.1:~/kvasir/home/user
</pre>
<p>will fail if ~/kvasir/<b>home</b> doesn't exist.  So you'll need to create the basic directory structure or enhance the backup function to strip out extra directories in the target path.</p>
<p>Finally, I didn't want anyone and everyone to potentially be able to gain access to private data on the backup machine, so the target directory needed to be encrypted.  There are a lot of options, but I opted for the easy encFS route and just installed "cryptkeeper" and had it setup the directory.</p>
<p>Now all I have to do is mount the encrypted backup directory, run the script to turn on the reverse ssh tunnel, and run the backup script, and I have an encrypted backup solution for my server that gets around firewalls.</p>
<p>Not bad.</p>
<p><b>References</b></p>
<ul>
<li><a href="http://pthree.org/2008/06/05/what-goes-out-can-come-back-in/">What Goes Out Can Come Back In -- SSH tricks</a></li>
<li><a href="http://www.google.com">Google</a>
</li>
</ul>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/589/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mindstab.net is back online</title>
		<link>http://www.mindstab.net/wordpress/archives/585</link>
		<comments>http://www.mindstab.net/wordpress/archives/585#comments</comments>
		<pubDate>Mon, 10 Aug 2009 22:28:36 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=585</guid>
		<description><![CDATA[Mindstab.net returns!  Let me explain what happened:
I hosted my server on a small business line with Telus.  A little over 2 weeks ago my house fell off the internet.  I called them and they said my modem must be old and broken so they'd send me a new one in 5 business [...]]]></description>
			<content:encoded><![CDATA[<p>Mindstab.net returns!  Let me explain what happened:</p>
<p>I hosted my server on a small business line with Telus.  A little over 2 weeks ago my house fell off the internet.  I called them and they said my modem must be old and broken so they'd send me a new one in 5 business days tops.  </p>
<p>I waited the 5 days and called on the last after not receiving a new modem and they said it'd only be a day or two more tops.  I called a few days later after still receiving no modem and now having been offline for a week and a half and they double checked and it turns out my new modem order hadn't even yet been processed!  Even after a reminder call.  Unbelievable.  So I canceled my (lack of) service with them and registered with the other head of our local two headed ISP monopoly, Shaw.  They had me online with in 4 days, and I just got my static IPs today.  So mindstab.net is back online, as am I.  Lets see how this goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/585/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please Stand By</title>
		<link>http://www.mindstab.net/wordpress/archives/578</link>
		<comments>http://www.mindstab.net/wordpress/archives/578#comments</comments>
		<pubDate>Mon, 27 Jul 2009 17:29:14 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=578</guid>
		<description><![CDATA[The internet connection for mindstab.net has become extremely unstable.  We're pretty sure it's a crap ADSL modem, and a replacement is on the way.
]]></description>
			<content:encoded><![CDATA[<p>The internet connection for mindstab.net has become extremely unstable.  We're pretty sure it's a crap ADSL modem, and a replacement is on the way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/578/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Much needed server maintenance</title>
		<link>http://www.mindstab.net/wordpress/archives/527</link>
		<comments>http://www.mindstab.net/wordpress/archives/527#comments</comments>
		<pubDate>Wed, 08 Jul 2009 20:22:04 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=527</guid>
		<description><![CDATA[I've finally gotten around to some long overdue server maintenance on Kvasir (mindstab.net et all).  This is where running a Gentoo server can kind of be fun.  I can mostly ignore it for ages, just poking at it when a GLSA (Gentoo security advisement) comes out for software it's running, and then when [...]]]></description>
			<content:encoded><![CDATA[<p>I've finally gotten around to some long overdue server maintenance on Kvasir (mindstab.net et all).  This is where running a Gentoo server can kind of be fun.  I can mostly ignore it for ages, just poking at it when a GLSA (Gentoo security advisement) comes out for software it's running, and then when I feel like sitting down to it, I can upgrade all the software it's running to the latest stable versions.  </p>
<p>The difference in comparison to other distros is of course that you are always current with their stable, but their stable can only stay current so long before they have to release a new version or else everything will break on some upgrades.  In Gentoo they give you the tools to deal with it and pass the breakage onto you.  So I upgrade slowly and cautiously and then fix a few things when config files change or libraries change and more things need to be recompiled, but it works.  I installed Gentoo on this server 4 or 5 years ago and look, it's still going and running all new software.  I think that's pretty cool.</p>
<p>And to top off the changes, I finally got around to installing a "new" 512MB ram stick in the server as well, now doubling its ram to 1GB.  Which is cool, and just in time because the new clamav is eating RAM like candy.  I'm actually wondering if something is wrong with it because it's really eating ram... </p>
<p>Ah well, anyways, the server got some well needed love and attention and is feeling much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/527/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vacation</title>
		<link>http://www.mindstab.net/wordpress/archives/302</link>
		<comments>http://www.mindstab.net/wordpress/archives/302#comments</comments>
		<pubDate>Tue, 08 Jul 2008 19:45:28 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/?p=302</guid>
		<description><![CDATA[So, I'm leaving tomorrow morning for a month to Mexico. I'm excited and aprehensive as to be expected, but I think I'm in good shape (ie. packed etc).
Anyways, because I'm such a public fellow, it should be pretty easy to follow my progress.  You can get up to the minute updates when I can [...]]]></description>
			<content:encoded><![CDATA[<p>So, I'm leaving tomorrow morning for a month to Mexico. I'm excited and aprehensive as to be expected, but I think I'm in good shape (ie. packed etc).</p>
<p>Anyways, because I'm such a public fellow, it should be pretty easy to follow my progress.  You can get up to the minute updates when I can make them directly from my twitter account at <a href="http://twitter.com/dan_ballard">twitter.com/dan_ballard</a>.  Usually within half an hour twitter updates will then show up here on the site, plus I'll probably make the occasional update directly to the site when internet is available.  So if you want all my travel stories etc, you can subscribe to the site <a href="http://www.mindstab.net/wordpress/feed">RSS feed</a>.  If you're on LJ, of course all of this will still be pushed there, so fear not, you get the full Dan vacation experience.</p>
<p>For those of you who could care less about my travel exploits and are just interested in my Linux exploits or what not, I've first requested <a href="http://planet.larrythecow.org/">Planet Larry</a> change my feed to a Linux only one for the duration of the trip and you can do the same.  Try subscribing to <a href="http://www.mindstab.net/wordpress/archives/tag/linux/feed">mindstab.net/wordpress/archives/tag/linux/feed</a> to get only Linux stuff.</p>
<p>Ok, wish me luck, my flight is at 7am Wednesday morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/302/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mindstab.net&#8217;s Guide to Setting up a Git Server</title>
		<link>http://www.mindstab.net/wordpress/archives/288</link>
		<comments>http://www.mindstab.net/wordpress/archives/288#comments</comments>
		<pubDate>Mon, 28 Apr 2008 07:30:38 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/archives/288</guid>
		<description><![CDATA[This is a 'living document' in that I'll try to keep updating it from time to time so it keeps working with git as git "matures" and as I learn more about git.
- Last Updated 2009 07
I've found documentation on the setup of git servers and public repositories kind of lacking, so here is my [...]]]></description>
			<content:encoded><![CDATA[<p><i>This is a 'living document' in that I'll try to keep updating it from time to time so it keeps working with git as git "matures" and as I learn more about git.<br />
- <b>Last Updated 2009 07</b></i></p>
<p>I've found documentation on the setup of git servers and public repositories kind of lacking, so here is my best attempt at documenting what works for me.  Feel free to comment with bugs or enhancements please.</p>
<h2>Contents</h2>
<ul>
<li>1. <a href="#git.1">Setting Up A Local Repository</a>
<ul>
<li>1.1 <a href="#git.1.1">From Scratch</a></li>
<li>1.2 <a href="#git.1.2">From An Existing Project</a></li>
</ul>
</li>
<li>2. <a href="#git.2">Setting Up A Remote Repository</a>
<ul>
<li>2.1 <a href="#git.2.1">Remote Repository For Developer Only (ssh)</a></li>
<li>2.2 <a href="#git.2.2">Remote Repository For Public Access (git://)</a></li>
<li>2.3 <a href="#git.2.3">Shared Multi-Developer Public Repository</a></li>
</ul>
</li>
<li>3. <a href="#git.3">Managing Multiple Developers, Repositories and Branches</a></li>
<li><a href="#git.ref">References</a></li>
</ul>
<p><a name="git.1" ></a><br />
<h2><a href="http://www.mindstab.net/wordpress/archives/288#git.1">1. Setting Up A Local Repository</a></h2>
<p>Alice is going to start developing a project and she wants to add source control to it.  There are a couple of reasons to set up a local repository that Alice likes including branch control, so that she can revert her code to previous releases, fix, patch or merge a bug fix, roll a release, and then pop back to the current development branch.<br />
<a name="git.1.1" ></a><br />
<h3><a href="http://www.mindstab.net/wordpress/archives/288#git.1.1">1.1 From Scratch</a></h3>
<p>To set up a git repository for her project, Alice does the following:</p>
<pre>
alice@home $ mkdir proj
alice@home $ cd proj
alice@home $ git init
</pre>
<p>The project directory is now an empty git repository.  As she creates files, she can add them to the respository with</p>
<pre>
alice@home $ git add newfile.src
</pre>
<p>And when she's done work or at least reached some break point, she can commit the new files, and all changes with</p>
<pre>
alice@home $ git commit -a
</pre>
<p><a name="git.1.2" ></a><br />
<h3><a href="http://www.mindstab.net/wordpress/archives/288#git.1.2">1.2 From An Existing Project</a></h3>
<p>Also, occasionally Alice gets excited and starts coding before creating a repository.  To create a repository from an already started project is as simple as</p>
<pre>
alice@home $ cd ~/proj
alice@home $ git init
</pre>
<p>and either </p>
<pre>
alice@home $ git add .
</pre>
<p>to add all the files, or</p>
<pre>
alice@home $ git add file1 file2 file3
</pre>
<p>to add just some of the files, both followed by</p>
<pre>
alice@home $ git commit -a
</pre>
<p>for the initial commit of the code to the new repository.<br />
<a name="git.2"></a><br />
<h2><a href="http://www.mindstab.net/wordpress/archives/288#git.2">2. Setting Up A Remote Repository</a></h2>
<p>Some times Alice needs her repositories to be remote and internet accessible.  Sometimes she needs to work on them from several locations, and sometimes she wants her project's code to always be accessible to the public.</p>
<p>There are two primary methods for making remote git repositories accessible online.  The first method is over ssh, which developers can use to both read and write to the repository and the second is through a dedicated git server which the public can use for read only access.<br />
<a name="git.2.1"></a><br />
<h3><a href="http://www.mindstab.net/wordpress/archives/288#git.2.1">2.1 Remote Repository For Developer Only (ssh)</a></h3>
<p>If Alice's project is personal and she just needs a central repository to access from a few locations like both work and home, she can set up a repository on any unix machine she has access to as follows.</p>
<p>Alice needs to create a bare repository clone of her working code and then transfer it to the server she will be using as the repository host</p>
<pre>
alice@home $ git clone --bare ~/proj proj.git
alice@home $ tar -czf proj.git.tar.gz proj.git
alice@home $ scp proj.git.tar.gz alice@server.com:~
</pre>
<p>Then, on the server</p>
<pre>
alice@server $ tar -xzf proj.git.tar.gz
alice@server $ mv proj.git proj
</pre>
<p>Now Alice can create working copies of the repository from anywhere, like work, and work on the code as normal as follows</p>
<pre>
alice@work $ git clone ssh://alice@server.com/home/alice/proj
alice@work $ cd proj
...
alice@work $ commit -a
</pre>
<p>However all this does is create a local clone of the repository and commit the changes to the new local clone.  To push changes to the local repository back to the central repository, Alice does</p>
<pre>
alice@work $ git push
</pre>
<p>(As a note, Alice will also need to perform this clone of the remote repository at home so that her repository is aware of the remote repository, or she can use 'git remote add' to make her current original repository aware of the remote one)</p>
<p>When Alice gets home she can check out the latest changes with a simple</p>
<pre>
alice@home $ git pull
</pre>
<p>which pulls all the latest changes from the remote repository.  Then she can develop, commit and push her changes and then the next day at work she can pull all those changes.<br />
<a name="git.2.2"></a><br />
<h3><a href="http://www.mindstab.net/wordpress/archives/288#git.2.2">2.2 Remote Repository For Public Access (git://)</a></h3>
<p>Now, to allow public read only access of the repository over the git:// protocol the steps of setting up a remote repository are all the same, however there are additional steps that need to be taken.</p>
<p>At a minimum, Alice needs to setup the git daemon on the server and tell each git repository that she wants to be publically accessible that it is so.  </p>
<p>Setting up the a basic git daemon is up to Alice and her server's distribution, but once it is installed and running, it will try to export any directory on the server filesystem that is a) a git repository, and is b) flagged to be publically accessible.</p>
<p>To make her repositories accessible, Alice does the following</p>
<pre>
alice@server $ touch ~/proj/git-daemon-export-ok
</pre>
<p>Now when Bob hears about Alice's project, he can check out a copy of the repository himself as follows</p>
<pre>
bob@home $ git clone git://server.com/home/alice/proj
</pre>
<p>Bob actually ends up with the a full clone of the repository and can work with the code, and if he wants he can make changes and commit them to his local clone of the repository as normal.  However, the one thing Bob cannot do is 'push' his changes back to the central repository.</p>
<p>He can, however, even stay up to date with the repository with git pull</p>
<pre>
bob@home $ git pull
</pre>
<p>and he'll always get the latest changes.<br />
<a name="git.2.3"></a><br />
<h3><a href="http://www.mindstab.net/wordpress/archives/288#git.2.3">2.3 Shared Multi-Developer Public Repository</a></h3>
<p><i>(Note: This is for those more used to CVS and Subversion style source control.  Defacto and "proper" git style is outlined in section 3. <a href="#git.3">Managing Multiple Developers, Repositories and Branches</a>.)</i></p>
<p>Alice happens to have root access to her server and wants to set up a multiple developer git repository.</p>
<p>First she creates a git user group and makes a root git directory.</p>
<pre>
root@server # groupadd git
root@server # mkdir /git
</pre>
<p>Then Alice configures the git daemon to only export repositories in /git in the git-daemon's config file</p>
<pre>
GITDAEMON_OPTS="--syslog --verbose /git"
</pre>
<p>Now Alice creates a shared repository.  She untars the git repository like normal, but sets its group to git and makes sure it'll stick by setting the stick bit, and then she makes it "shared" which means all the files are writeable by the group git.</p>
<pre>
root@server # cd /git
root@server # tar -xzf proj.git.tar.gz
root@server # mv proj.git proj
root@server # chgrp -R git proj
root@server # chmod g+ws proj -R
root@server # cd proj
root@server # git config core.sharedRepository true
</pre>
<p>And of course if Alice wants it to be publically viewable</p>
<pre>
root@server # touch git-daemon-export-ok
</pre>
<p>Now Alice has a git repository that several developers on the server can all use.  Anyone in the git group can commit to the repository.</p>
<p>Alice's friend Charlie wants to develop for the project so Alice gives him an account on the server.  Charlie can then start developing just like normal</p>
<pre>
charlie@home $ git clone ssh://charlie@server.com/git/proj
charlie@home $ cd proj
...
charlie@home $ git commit -a
charlie@home $ git push
</pre>
<p>Alice can get these changes at home, and any she's made from work with a simple</p>
<pre>
alice@home $ git pull
</pre>
<p>And if the repository was made public and exportable then Bob can checkout the code and keep up to date too</p>
<pre>
bob@home $ git clone git://server.com:/git/proj
bob@home $ cd proj
...
bob@home $ git pull
</pre>
<p><a name="git.3"></a><br />
<h2><a href="http://www.mindstab.net/wordpress/archives/288#git.3">3. Managing Multiple Developers, Repositories and Branches</a></h2>
<p>The proper way to use git with multiple developers is for each developer to have their own repository and branches and have a central manager who pulls from all the other branches and merges the code together before release.  This is how Linux works (git was created by Linux's creator Linus).</p>
<p><i>Note: I know this is the proper way but I haven't really had any experience with it, so until I get time to play with it unfortunately this part of the document will be empty.  Check out the official git manual for a good idea of how this should be managed, especially chapter 4 <a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#sharing-development">Sharing Development</a></i>.<br />
<a name="git.ref"></a><br />
<h2><a href="http://www.mindstab.net/wordpress/archives/288#git.ref">References</a></h2>
<ul>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html">Git User's Manual (for version 1.5.3 or newer)</a></li>
<li><a href="http://blog.mhartl.com/2008/10/14/setting-up-your-git-repositories-for-open-source-projects-at-github/">Setting up your Git repositories for open source projects at GitHub</a></li>
<li><a href="http://www.google.com">Google</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/288/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server updates</title>
		<link>http://www.mindstab.net/wordpress/archives/279</link>
		<comments>http://www.mindstab.net/wordpress/archives/279#comments</comments>
		<pubDate>Wed, 06 Feb 2008 10:23:47 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/archives/279</guid>
		<description><![CDATA[Upgraded the kernel on the server today.  That went fine but the reboot exposed some library update problems with moving from libexpat 1.9.* to 2.  revdep-rebuild -X solved it.  All is good.
]]></description>
			<content:encoded><![CDATA[<p>Upgraded the kernel on the server today.  That went fine but the reboot exposed some library update problems with moving from libexpat 1.9.* to 2.  revdep-rebuild -X solved it.  All is good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/279/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rsync for backup: a surprising easy and good solution</title>
		<link>http://www.mindstab.net/wordpress/archives/278</link>
		<comments>http://www.mindstab.net/wordpress/archives/278#comments</comments>
		<pubDate>Wed, 06 Feb 2008 02:11:53 +0000</pubDate>
		<dc:creator>Dan Ballard</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.mindstab.net/wordpress/archives/278</guid>
		<description><![CDATA[I just stumbled on an really neat simple little article on how dead easy rsync is for doing backup work.  It's easy to use, can use existing infrastructure (SSH) and does diffs to minimize data transmission.
It's as simple as this

rsync -a -e ssh Documents haplo@kvasir.mindstab.net:~/backup

And then the reverse to get new stuff.  
The [...]]]></description>
			<content:encoded><![CDATA[<p>I just stumbled on an really neat simple little article on how dead easy rsync is for doing backup work.  It's easy to use, can use existing infrastructure (SSH) and does diffs to minimize data transmission.</p>
<p>It's as simple as this</p>
<pre>
rsync -a -e ssh Documents haplo@kvasir.mindstab.net:~/backup
</pre>
<p>And then the reverse to get new stuff.  </p>
<p>The full article is at <a href="http://www.enterprisenetworkingplanet.com/netos/article.php/10951_1573881_2">www.enterprisenetworkingplanet.com/netos/article.php/10951_1573881_2</a>.  I'm doing this with a bunch of my data now!  I'm excited because I'd been thinking about setting up some backup solution for a bit but this is so trivially easy and more than good enough it's delightful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindstab.net/wordpress/archives/278/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
