<?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>Chris Irish &#124; Ruby, Rails, Javascript Developer &#124; Phoenix, AZ &#187; Bash</title>
	<atom:link href="http://www.christopherirish.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christopherirish.com</link>
	<description>Ruby, Rails, Javascript, all things web development related</description>
	<lastBuildDate>Mon, 19 Jan 2026 07:43:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Git garbage collect bash script</title>
		<link>http://www.christopherirish.com/2010/05/03/git-garbage-collect-bash-script/</link>
		<comments>http://www.christopherirish.com/2010/05/03/git-garbage-collect-bash-script/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:00:08 +0000</pubDate>
		<dc:creator>Irish</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://www.christopherirish.com/?p=183</guid>
		<description><![CDATA[The following shell command will crawl your hard drive, from your current directory, looking for any git repositories. When it finds them it will garbage collect, prune, and pack them, regaining your disk space and make your repositories operate faster. 12#!/bin/sh find . -type d -name .git &#124; while read dir; do pushd &#34;$dir&#34;; git [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The following shell command will crawl your hard drive, from your current directory, looking for any git repositories.  When it finds them it will garbage collect, prune, and pack them, regaining your disk space and make your repositories operate faster.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> .git <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">dir</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dir</span>&quot;</span>; <span style="color: #c20cb9; font-weight: bold;">git gc</span> <span style="color: #660033;">--prune</span>; <span style="color: #7a0874; font-weight: bold;">popd</span>; <span style="color: #000000; font-weight: bold;">done</span></div></td></tr></tbody></table></div>
<p>You can run this directly from the terminal or just turn this snippet into a lil bash script file for easy executing later, i.e.</p>

<div class="wp-terminal">$ touch git_garbage_collect.sh<br/>$ nano git_garbage_collect.sh<br/>$ # copy & paste the script into the file<br/>$ ctrl+o # to save the file<br/>$ ctrl+x # to exit nano<br/></div>

<p>Then just run it like any other bash script</p>

<div class="wp-terminal">$ ./git_garbage_collect.sh<br/></div>

<div id="hire" class="text-center">
  <a href="http://velocitylabs.io"><img src="http://www.christopherirish.com/wp-content/uploads/2018/07/velocity-labs-logo-text.png" alt="" title="velocity-labs-logo-text" width="300" class="alignleft size-full wp-image-971" /></a></p>
<p>
    Need web application development, maintenance for your existing app, or a third party code review?
  </p>
<p>
    <strong class="text-uppercase">Velocity Labs can help.</strong>
  </p>
<p>  <a href="http://velocitylabs.io#contact" class="btn btn-warning btn-block" target="_blank">Click here to get started!</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.christopherirish.com/2010/05/03/git-garbage-collect-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The authme, ssh key, bash function</title>
		<link>http://www.christopherirish.com/2010/04/19/the-authme-ssh-key-bash-function/</link>
		<comments>http://www.christopherirish.com/2010/04/19/the-authme-ssh-key-bash-function/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 16:04:07 +0000</pubDate>
		<dc:creator>Irish</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.supairish.com/?p=10</guid>
		<description><![CDATA[Often it can be a pain to remember all the username/password combinations for all the different servers we touch in our day to day development.  I&#8217;ve come to really like this lil&#8217; bash function given to me by my co-worker Anthony DiGirolamo. 123function authme &#123; &#160; ssh $@ 'cat &#62;&#62;.ssh/authorized_keys' &#60; ~/.ssh/id_rsa.pub &#125; Just put [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Often it can be a pain to remember all the username/password combinations for all the different servers we touch in our day to day development.  I&#8217;ve come to really like this lil&#8217; bash function given to me by my co-worker <a href="http://anthonydigirolamo.github.com">Anthony DiGirolamo</a>.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> authme <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">ssh</span> $<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #ff0000;">'cat &gt;&gt;.ssh/authorized_keys'</span> <span style="color: #000000; font-weight: bold;">&lt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></td></tr></tbody></table></div>
<p>Just put it in your ~/.bash_profile file or one of the other bash settings files you may be using.</p>
<p>Usage is like so</p>

<div class="wp-terminal">$ authme deploy@www.somedomain.com<br/></div>

<p>You&#8217;ll be prompted for your password then returned to the local terminal prompt.  This will ssh onto the given server and concatenate your ssh public key to the authorized_keys file.  Allowing you from there on out, not having to supply a password to get on the server through ssh.  Good stuff</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christopherirish.com/2010/04/19/the-authme-ssh-key-bash-function/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
