<?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>Fernandez de Quilon &#187; BASh</title>
	<atom:link href="http://www.jefferyfernandez.id.au/category/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jefferyfernandez.id.au</link>
	<description>between flat screens and grey matter</description>
	<lastBuildDate>Thu, 04 Aug 2011 23:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3-aortic-dissection</generator>
		<item>
		<title>Trigger build of Debian package for Git Jenkins CI</title>
		<link>http://www.jefferyfernandez.id.au/2011/08/05/trigger-build-of-debian-package-for-git-jenkins-ci/</link>
		<comments>http://www.jefferyfernandez.id.au/2011/08/05/trigger-build-of-debian-package-for-git-jenkins-ci/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 23:01:20 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[BASh]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[SCM]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=163</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div id="gist-1093983" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>#!/bin/bash</div><div class='line' id='LC2'># </div><div class='line' id='LC3'># This is a helper script to trigger the build of a debian package for a</div><div class='line' id='LC4'># project which is in Git SCM and integrated via Jenkins CI</div><div class='line' id='LC5'>#</div><div class='line' id='LC6'># The trigger used for the package build is a string &quot;bump for release&quot;</div><div class='line' id='LC7'># which is part of the commit message for the Git repository.</div><div class='line' id='LC8'>#</div><div class='line' id='LC9'># The Changelog is then parsed to obtain the release version and then</div><div class='line' id='LC10'># the repository is exported for package building</div><div class='line' id='LC11'>#</div><div class='line' id='LC12'># Author: Jeffery Fernandez &lt;jeffery@fernandez.net.au&gt;</div><div class='line' id='LC13'>#</div><div class='line' id='LC14'># Requires the following Debian packages:</div><div class='line' id='LC15'># dpkg-dev debhelper devscripts fakeroot lintian</div><div class='line' id='LC16'>##</div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'># Extract the last changelog and discard unwanted data</div><div class='line' id='LC19'>RELEASE_BUMP=`git log --max-count=1 --pretty -- . | grep -v &quot;^Author: &quot; | grep -v &quot;^Date: &quot; | grep -v &quot;^Merge: &quot; | grep -v &quot;^commit&quot;`</div><div class='line' id='LC20'><br/></div><div class='line' id='LC21'># Very if a release was requested</div><div class='line' id='LC22'>echo $RELEASE_BUMP | grep -i &quot;bump for release&quot; &gt; /dev/null</div><div class='line' id='LC23'>if [ $? -eq 1 ]</div><div class='line' id='LC24'>then</div><div class='line' id='LC25'>	echo &quot;Release request not Found&quot; &amp;&amp; exit 0;</div><div class='line' id='LC26'>fi</div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'># Make sure we have a Job name ( Comes from Jenkins CI)</div><div class='line' id='LC29'>if [ -z &quot;$JOB_NAME&quot; ]</div><div class='line' id='LC30'>then</div><div class='line' id='LC31'>	echo &quot;Job Name not provided&quot; &amp;&amp; exit 1;</div><div class='line' id='LC32'>fi</div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'># The PWD needs to be the parent to the debian folder inorder to extract the Version to package</div><div class='line' id='LC35'>VERSION=`dpkg-parsechangelog | awk &#39;/^Version/ {print $2}&#39;`</div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'># Path for building the Debian Package</div><div class='line' id='LC38'>PACKAGE_PATH=&quot;${JOB_NAME}-${VERSION}&quot;</div><div class='line' id='LC39'><br/></div><div class='line' id='LC40'># Obtain the last Git Revision Hash</div><div class='line' id='LC41'>HASH=`git rev-parse HEAD`</div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'>echo &quot;Building: ${VERSION} from Commit: ${HASH}&quot;</div><div class='line' id='LC44'><br/></div><div class='line' id='LC45'># Clean up old Build path, if it exists</div><div class='line' id='LC46'>if [ -d &quot;${PACKAGE_PATH}&quot; ]</div><div class='line' id='LC47'>then</div><div class='line' id='LC48'>	rm -fR &quot;${PACKAGE_PATH}&quot;</div><div class='line' id='LC49'>fi</div><div class='line' id='LC50'><br/></div><div class='line' id='LC51'>#  Make sure the Exporting directory exists</div><div class='line' id='LC52'>mkdir -p &quot;${PACKAGE_PATH}&quot;</div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'># Export the revision and Unarchive it into a build folder</div><div class='line' id='LC55'>git archive ${HASH} | ( cd &quot;${PACKAGE_PATH}&quot; &amp;&amp; tar -xf - ) || { </div><div class='line' id='LC56'>	echo &quot;Exporting Git Repository Failed&quot;; exit 1; </div><div class='line' id='LC57'>}</div><div class='line' id='LC58'><br/></div><div class='line' id='LC59'># Remove any Build Config file, as we don&#39;t want to run tests anymore</div><div class='line' id='LC60'>if [ -f &quot;${PACKAGE_PATH}/build.xml&quot; ] </div><div class='line' id='LC61'>then </div><div class='line' id='LC62'>	rm &quot;${PACKAGE_PATH}/build.xml&quot;</div><div class='line' id='LC63'>fi</div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'># Build Package</div><div class='line' id='LC66'>cd &quot;${PACKAGE_PATH}&quot; &amp;&amp; debuild -i -us -uc</div><div class='line' id='LC67'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1093983/2a455280b6ea7b2ea068c103e976deeb81ae362e/Debianize-Git-Jenkins" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1093983#file_debianize_git_jenkins" style="float:right;margin-right:10px;color:#666">Debianize-Git-Jenkins</a>
            <a href="https://gist.github.com/1093983">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<div style="float:left;margin:0px 0px 0px 0px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2011/08/05/trigger-build-of-debian-package-for-git-jenkins-ci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update Timestamp of files in Checked-out Git Repository</title>
		<link>http://www.jefferyfernandez.id.au/2011/07/30/update-timestamp-of-files-in-checked-out-git-repository/</link>
		<comments>http://www.jefferyfernandez.id.au/2011/07/30/update-timestamp-of-files-in-checked-out-git-repository/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 13:45:13 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[BASh]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[SCM]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=155</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div id="gist-1115504" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c">#!/bin/bash -e</span></div><div class='line' id='LC2'><span class="c">####</span></div><div class='line' id='LC3'><span class="c"># Helper script to update the Last modified timestamp of files in a Git SCM</span></div><div class='line' id='LC4'><span class="c"># Projects working Copy</span></div><div class='line' id='LC5'><span class="c">#</span></div><div class='line' id='LC6'><span class="c"># When you clone a Git repository, it sets the timestamp of all the files to the</span></div><div class='line' id='LC7'><span class="c"># time when you cloned the repository.</span></div><div class='line' id='LC8'><span class="c">#</span></div><div class='line' id='LC9'><span class="c"># This becomes a problem when you want the cloned repository, which is part of a </span></div><div class='line' id='LC10'><span class="c"># Web application have a proper cacheing mechanism so that it can re-cache files</span></div><div class='line' id='LC11'><span class="c"># (into a webtree) that have been modified since the last cache.</span></div><div class='line' id='LC12'><span class="c">#</span></div><div class='line' id='LC13'><span class="c"># @see http://stackoverflow.com/questions/1964470/whats-the-equivalent-of-use-commit-times-for-git</span></div><div class='line' id='LC14'><span class="c">#</span></div><div class='line' id='LC15'><span class="c"># Author: Jeffery Fernandez &lt;jeffery@fernandez.net.au&gt;</span></div><div class='line' id='LC16'><span class="c">####</span></div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'><span class="c"># Make sure we are not running this on a bare Repository</span></div><div class='line' id='LC19'><span class="nv">REPO_TYPE</span><span class="o">=</span><span class="sb">`</span>git config --list|egrep ^core.bare | awk -F <span class="s1">&#39;=&#39;</span> <span class="s1">&#39;{ print $2 }&#39;</span><span class="sb">`</span></div><div class='line' id='LC20'><span class="k">if</span> <span class="o">[</span> <span class="s2">&quot;$REPO_TYPE&quot;</span> <span class="o">==</span> <span class="s2">&quot;true&quot;</span> <span class="o">]</span></div><div class='line' id='LC21'><span class="k">then</span></div><div class='line' id='LC22'><span class="k">	</span><span class="nb">echo</span> <span class="s2">&quot;Cannot run this script on a bare Repository&quot;</span> <span class="o">&amp;&amp;</span> <span class="nb">exit </span>1</div><div class='line' id='LC23'><span class="k">fi</span></div><div class='line' id='LC24'><br/></div><div class='line' id='LC25'><span class="nb">echo</span> <span class="s2">&quot;Updating Git Repository Last Modified Time-stamp&quot;</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><span class="c"># Obtain the Operating System</span></div><div class='line' id='LC28'><span class="nv">OS</span><span class="o">=</span><span class="k">${</span><span class="nv">OS</span><span class="k">:-</span><span class="sb">`</span>uname<span class="sb">`</span><span class="k">}</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'><span class="c"># Get the last revision hash of a particular file in the git repository</span></div><div class='line' id='LC31'>getFileLastRevision<span class="o">()</span> </div><div class='line' id='LC32'><span class="o">{</span></div><div class='line' id='LC33'>	git rev-list HEAD <span class="s2">&quot;$1&quot;</span> | head -n 1</div><div class='line' id='LC34'><span class="o">}</span></div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'><span class="c"># Extract the actual last modified timestamp of the file and Update the time-stamp</span></div><div class='line' id='LC37'>updateFileTimeStamp<span class="o">()</span> </div><div class='line' id='LC38'><span class="o">{</span></div><div class='line' id='LC39'>	<span class="c"># Extract the file revision</span></div><div class='line' id='LC40'>	<span class="nv">FILE_REVISION_HASH</span><span class="o">=</span><span class="sb">`</span>getFileLastRevision <span class="s2">&quot;$1&quot;</span><span class="sb">`</span></div><div class='line' id='LC41'><br/></div><div class='line' id='LC42'>	<span class="c"># Get the File last modified time</span></div><div class='line' id='LC43'>	<span class="nv">FILE_MODIFIED_TIME</span><span class="o">=</span><span class="sb">`</span>git show --pretty<span class="o">=</span>format:%ai --abbrev-commit <span class="k">${</span><span class="nv">FILE_REVISION_HASH</span><span class="k">}</span> | head -n 1<span class="sb">`</span></div><div class='line' id='LC44'><br/></div><div class='line' id='LC45'>	<span class="c"># Extract the last modified timestamp, differently for Linux, FreeBSD and Mac OS X</span></div><div class='line' id='LC46'>	<span class="k">if</span> <span class="o">[</span> <span class="s2">&quot;$OS&quot;</span> <span class="o">=</span> <span class="s1">&#39;Linux&#39;</span> <span class="o">]</span></div><div class='line' id='LC47'>	<span class="k">then</span></div><div class='line' id='LC48'>		<span class="c"># for displaying the date in readable format</span></div><div class='line' id='LC49'>		<span class="c">#FORMATTED_TIMESTAMP=`date --date=&quot;${FILE_MODIFIED_TIME}&quot; +&#39;%d-%m-%Y %H:%M:%S %z&#39;`</span></div><div class='line' id='LC50'>		<span class="c">#echo &quot;Modified: ${FILE_MODIFIED_TIME} | ${FORMATTED_TIMESTAMP} &gt; ${1}&quot;</span></div><div class='line' id='LC51'><br/></div><div class='line' id='LC52'>		<span class="c"># Modify the last modified timestamp</span></div><div class='line' id='LC53'>		touch -d <span class="s2">&quot;${FILE_MODIFIED_TIME}&quot;</span> <span class="nv">$2</span></div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'>	<span class="k">elif</span> <span class="o">[</span> <span class="s2">&quot;$OS&quot;</span> <span class="o">=</span> <span class="s1">&#39;Darwin&#39;</span> <span class="o">]</span> <span class="o">||</span> <span class="o">[</span> <span class="s2">&quot;$OS&quot;</span> <span class="o">=</span> <span class="s1">&#39;FreeBSD&#39;</span> <span class="o">]</span></div><div class='line' id='LC56'>	<span class="k">then</span></div><div class='line' id='LC57'>		<span class="c"># Format the date for updating the timestamp</span></div><div class='line' id='LC58'>		<span class="nv">FORMATTED_TIMESTAMP</span><span class="o">=</span><span class="sb">`</span>date -j -f <span class="s1">&#39;%Y-%m-%d %H:%M:%S %z&#39;</span> <span class="s2">&quot;${FILE_MODIFIED_TIME}&quot;</span> +<span class="s1">&#39;%Y%m%d%H%M.%S&#39;</span><span class="sb">`</span></div><div class='line' id='LC59'>		<span class="c">#echo &quot;Modified: ${FILE_MODIFIED_TIME} | ${FORMATTED_TIMESTAMP} &gt; ${1}&quot;</span></div><div class='line' id='LC60'><br/></div><div class='line' id='LC61'>		<span class="c"># Modify the last modified timestamp</span></div><div class='line' id='LC62'>		touch -t  <span class="s2">&quot;${FORMATTED_TIMESTAMP}&quot;</span> <span class="nv">$2</span></div><div class='line' id='LC63'>	<span class="k">else</span></div><div class='line' id='LC64'><span class="k">		</span><span class="nb">echo</span> <span class="s2">&quot;Unknown Operating System to perform timestamp update&quot;</span> &gt;&amp;2</div><div class='line' id='LC65'>		<span class="nb">exit </span>1</div><div class='line' id='LC66'>	<span class="k">fi</span></div><div class='line' id='LC67'><span class="o">}</span></div><div class='line' id='LC68'><br/></div><div class='line' id='LC69'><span class="c"># Backup and update the &quot;Internal Field Separator&quot; to a newline. This is so that</span></div><div class='line' id='LC70'><span class="c"># we can deal with spaces in file names in the for loop below</span></div><div class='line' id='LC71'><span class="nv">IFS_BAK</span><span class="o">=</span><span class="nv">$IFS</span></div><div class='line' id='LC72'><span class="nv">IFS</span><span class="o">=</span><span class="s2">&quot;</span></div><div class='line' id='LC73'><span class="s2">&quot;</span></div><div class='line' id='LC74'><span class="c"># Loop through and fix timestamps on all files in our checked-out repository</span></div><div class='line' id='LC75'><span class="k">for </span>file in <span class="k">$(</span>git ls-files<span class="k">)</span></div><div class='line' id='LC76'><span class="k">do</span></div><div class='line' id='LC77'><span class="k">	</span>updateFileTimeStamp <span class="s2">&quot;${file}&quot;</span> <span class="s2">&quot;${file}&quot;</span></div><div class='line' id='LC78'><span class="k">done</span></div><div class='line' id='LC79'><br/></div><div class='line' id='LC80'><span class="c"># Revert the default delimiter</span></div><div class='line' id='LC81'><span class="nv">IFS</span><span class="o">=</span><span class="nv">$IFS_BAK</span></div><div class='line' id='LC82'><span class="nv">IFS_BAK</span><span class="o">=</span></div><div class='line' id='LC83'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1115504/f51e8ff42ae90bb72f6b5d498ec9d98cd3cc81c1/GitRepoUpdateTimestamp.sh" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1115504#file_git_repo_update_timestamp.sh" style="float:right;margin-right:10px;color:#666">GitRepoUpdateTimestamp.sh</a>
            <a href="https://gist.github.com/1115504">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<div style="float:left;margin:0px 0px 0px 0px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2011/07/30/update-timestamp-of-files-in-checked-out-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate SSH logins with RSA/DSA keys</title>
		<link>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/</link>
		<comments>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 05:22:33 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[BASh]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/</guid>
		<description><![CDATA[Often when you are administrating remote Linux servers, you tend to login to the servers via your favorite shell. And every time when you login you are prompted for a user name + password to authenticate your session. This gets &#8230; <a href="http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jefferyfernandez.id.au/wp-content/uploads/2007/12/utilities-terminal.png" alt="Automated Shell Login" align="left" />Often when you are administrating remote Linux servers, you tend to login to the servers via your favorite shell. And every time when you login you are prompted for a user name + password to authenticate your session. This gets a bit tedious if you have many passwords to remember for different logins. This is were <a href="http://www.google.com.au/search?q=ssh+keys&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a" title="Search Google for SSH keys" target="_blank">ssh keys</a> can be used to save you from typing your credentials for every ssh login you execute. Once you have setup your SSH key, you are just one step away from making your life a whole lot easier.</p>
<p>I have put together a shell script which saves me the trouble of remembering various combinations of user names + passwords. It looks something like this: <code class="usercommand">cat ~/.ssh/id_dsa.pub | ssh jeffery@example.com "(mkdir .ssh&amp;&gt;/dev/null; chmod 700 .ssh &amp;&amp; cat - &gt;&gt; .ssh/authorized_keys ) &amp;&amp; chmod 600 .ssh/authorized_keys"</code><span id="more-39"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-5896900602713932";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-10-07: general
google_ad_channel = "5562041263";
//-->
</script><br />
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Cat Piped Over Ssh explained</h3>
<p>Lets take it step by step and go through what the above command actually does. This is the order of what happens when the above command is executed:</p>
<ol>
<li>Concatenate the contents (<strong><em>cat ~/.ssh/id_dsa.pub </em></strong>) of my DSA public key</li>
<li>Pipe the contents (<strong><em> | </em></strong>) to the ssh command <strong><em>ssh jeffery@example.com</em></strong></li>
<li>I am then executing four commands to the remote host via SSH
<ol>
<li>The first command <strong><em>mkdir .ssh&amp;&gt;/dev/null</em></strong> is making sure the remote folder .ssh exists by creating it. And if the directory already exists, it will give an error message, but that error message is discarded to <a href="http://en.wikipedia.org/wiki/Data_sink" target="_blank" title="Data Sink">/dev/null</a>. There could be a situation when this folder may not exist on the remote machine, hence we are making sure it exists.</li>
<li>Next we make sure the .ssh folder is writable with the command <strong><em>chmod 700 .ssh</em></strong>.</li>
<li>The double-ampersand (<strong><em>&amp;&amp;</em></strong>) which follows these two commands has a special meaning. It states if the previous command executed is not successful, do not execute any more commands in that statement. The only time this would fail would be if there is a folder called .ssh and it is not owned/writable by the user who is supposed to own it. In my case that would be the user &#8220;jeffery&#8221;.</li>
<li>The next command we see is <strong><em>cat &#8211; &gt;&gt; .ssh/authorized_keys</em></strong>. If you remember in Step 1, the cat command which piped the contents of my DSA public key has now produced a Standard Input. This cat command is now taking that input and appending it to the  .ssh/authorized_keys file. If the file didn&#8217;t exist, it should automatically have created that file and appended my DSA public key into it.</li>
<li>Finally we make sure that the authorized_keys file in secure from other users by changing the permissions <strong><em>chmod 600 .ssh/authorized_keys</em></strong>.</li>
</ol>
</li>
<li>After this command is executed, the shell would prompt you to enter the accounts password.
<ol>
<li>If this is the first time you are accessing the remote host, you will be prompted to verify the &#8220;authenticity&#8221; of the host. Type &#8220;yes&#8221; and hit Enter key.</li>
<li>Provide the login password to complete the setup for Automated Login.</li>
</ol>
</li>
</ol>
<h3>Shell Script</h3>
<p>Finally to make things a bit more easier, here is the shell script which you can use by providing the user@domain as the parameter  to setup your Automated logins.<br />
<code class="textinput">#!/bin/bash<br />
user_domain=$1<br />
echo "Automating Login for $user_domain"<br />
# Auto SSH<br />
cat ~/.ssh/id_dsa.pub | ssh $user_domain "(mkdir .ssh&amp;&gt;/dev/null; chmod 700 .ssh &amp;&amp; cat - &gt;&gt; .ssh/authorized_keys ) &amp;&amp; chmod 600 .ssh/authorized_keys"<br />
</code><br />
Copy the Above into a file called auto_ssh.sh, make it executable and run it. Change the user name and remote host to reflect your details. <code class="usercommand">./auto_ssh.sh jeffery@example.com</code></p>
<h3>Resources</h3>
<ul>
<li><a href="http://www-128.ibm.com/developerworks/library/l-keyc.html" title="OpenSSH key management" target="_blank">http://www-128.ibm.com/developerworks/library/l-keyc.html</a></li>
<li><a href="http://www.red-green.com/2007/06/automatic-ssh-login-using-rsadsa-keys/" target="_blank">http://www.red-green.com/2007/06/automatic-ssh-login-using-rsadsa-keys/</a></li>
</ul>
<div style="float:left;margin:0px 0px 0px 0px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Shell&#8217;s History</title>
		<link>http://www.jefferyfernandez.id.au/2005/10/01/the-shells-history/</link>
		<comments>http://www.jefferyfernandez.id.au/2005/10/01/the-shells-history/#comments</comments>
		<pubDate>Sat, 01 Oct 2005 02:49:17 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[BASh]]></category>

		<guid isPermaLink="false">http://kangaroo.jeffery/?p=3</guid>
		<description><![CDATA[The Shell&#8217;s History The shell remembers the history of your last typed commands. It is what you see when you use the up and down keys in Bash. There are plenty of ways to use this history! I will write &#8230; <a href="http://www.jefferyfernandez.id.au/2005/10/01/the-shells-history/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>The Shell&#8217;s History</h3>
<p>
The shell remembers the history of your last typed commands. It is what you see when you use the up and down keys in Bash.
</p>
<p>
There are plenty of ways to use this history! I will write some tips here that I know but don&#8217;t hesitate to add more in comments.
</p>
<ul>
<li>the ! tip: starting a line by ! followed by the first few letters of a previous command recalls it, very useful !</li>
<li>! followed by a number recalls this command.</li>
<li>the !? tip: is somewhat similar but doesn&#8217;t only look at command <i>starting</i> with the following letters but <i>containing</i> them !</li>
<li>&#8216;#&#8217; comments the commands but still records it. (if you have something to check while typing a long command)</li>
<li>of course the <strong class="strong">history</strong> command shows you the last commands <img src='http://www.jefferyfernandez.id.au/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>[ctrl-r] put you in history mode</li>
<li>if you don&#8217;t like this feature, you can filter it with <strong class="strong">HISTIGNORE</strong></li>
</ul>
<p>
example : </p>
<pre class="usercommand">export HISTIGNORE=&quot;&amp;:ls:\[bf\]g:exit&quot;</pre>
<p>suppresses duplicate commands, the simple invocation of &#8216;ls&#8217; without any arguments, and the shell built-ins bg, fg, and exit:
</p>
<p>
And if you include the expression &#8220;[ t]*&#8221; in the HISTIGNORE string, you can suppress history recording at will for any given command just by starting with a space!</p>
<div style="float:left;margin:0px 0px 0px 0px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2005/10/01/the-shells-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

