<?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>cat brain.log &#124; less &#187; command line</title>
	<atom:link href="http://log.largevoid.com/tag/command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.largevoid.com</link>
	<description>Getting it down on `paper`</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Less-Common Tools for Linux</title>
		<link>http://log.largevoid.com/2010/04/less-common-tools-for-linux/</link>
		<comments>http://log.largevoid.com/2010/04/less-common-tools-for-linux/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 00:41:07 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[kdialog]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[notify-send]]></category>
		<category><![CDATA[setleds]]></category>
		<category><![CDATA[setterm]]></category>
		<category><![CDATA[smbclient]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[tput]]></category>
		<category><![CDATA[zenity]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=331</guid>
		<description><![CDATA[As found here: 10 Tools to Add Some Spice to Your UNIX Shell Scripts. This is no substitute for the great write-up and screenshots that the author put together. It&#8217;s a summary for myself. The highlights (and how I really feel about them): notify-send (I never knew &#8212; better than tweat deck) tput (eh, maybe) [...]]]></description>
			<content:encoded><![CDATA[<p>As found here: <a href="http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html">10 Tools to Add Some Spice to Your UNIX Shell Scripts</a>.  This is no substitute for the great write-up and screenshots that the author put together.  It&#8217;s a summary for myself.</p>
<p>The highlights (and how I really feel about them):</p>
<ul>
<li>notify-send (I never knew &#8212; better than tweat deck)</li>
<li>tput (eh, maybe)</li>
<li>setleds (i don&#8217;t have lock-key LEDs on my keyboard)</li>
<li>zenity (has potential)</li>
<li>kdialog (better than zenity?  looks like VB functionality &#8212; good?)</li>
<li>dialog (like kdialog, but uses (n)curses, not kde)</li>
<li>logger (good to know!)</li>
<li>setterm (practical jokes&#8230; and maybe useful for modal/portal stuff)</li>
<li>smbclient (does that still work?  Couldn&#8217;t get past authentication prompt)</li>
<li>bash sockets (interesting&#8230; ICP?  wasteful)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/04/less-common-tools-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git &#8211; Install and Configure</title>
		<link>http://log.largevoid.com/2009/11/git-install-and-configure/</link>
		<comments>http://log.largevoid.com/2009/11/git-install-and-configure/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 23:19:50 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=61</guid>
		<description><![CDATA[Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a [...]]]></description>
			<content:encoded><![CDATA[<p>Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a centralized system if need be found.<span id="more-61"></span></p>
<h3>Installation (from source)</h3>
<p>Go to <a href="http://www.kernel.org/pub/software/scm/git/">http://www.kernel.org/pub/software/scm/git/</a> and pick the latest version (1.6.5.2), then from the command line, issue:</p>
<p><code># Make a temporary directory from which we'll work<br />
mkdir ~/gittmp<br />
cd ~/gittmp</code><br />
<code># Get the source, compile and intsall<br />
wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.2.tar.gz<br />
tar xzf git-1.6.5.2.tar.gz<br />
cd ~/gittmp/git-1.6.5.2<br />
./configure<br />
make<br />
sudo make install<br />
cd  ~/gittmp</code><br />
<code># Get and install the man pages<br />
wget http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.5.2.tar.gz<br />
sudo tar xzf git-manpages-1.6.5.2.tar.gz -C /usr/local/share/man/<br />
cd ~<br />
rm -r ~/gittmp/</code></p>
<h3>Testing</h3>
<p>Now that we&#8217;ve got everything set up, go ahead and check that everything&#8217;s visible to your path.  Note: You may need to log back in for the settings to be read.<br />
<code>$ which git<br />
/usr/local/bin/git<br />
$ git config --help<br />
--- man page retrieved ---</code></p>
<h3>Configuration</h3>
<p>Now we need to set some globals.  These are used to identify you when pushing changes.<br />
<code>$ git config --global user.name "Scott Chacon"<br />
$ git config --global user.email "schacon@gmail.com"</code></p>
<p>In a <strong>distributed environment</strong>, your workflow might go something like: A writes some code and commits. B pulls code, makes updates, commits.  A updates local copy with B&#8217;s committed changes, continues development.  The flow goes: get updates from peer, make changes, commit.  Here&#8217;s an example:<br />
<code>alice: $ cd ~/project<br />
alice: $ git init<br />
alice: $ git add lib src README CHANGELOG<br />
alice: $ git commit -m "Initialization"<br />
bob: $ git clone /home/alice/project myrepo<br />
bob: $ echo 'I made a change' &gt;&gt; CHANGELOG<br />
bob: $ git commit -a -m "Appended changelog info"<br />
alice: $ cd ~/project<br />
alice: $ git pull /home/bob/myrepo master<br />
alice: $ echo "Confirmed, changes were merged" &gt;&gt; CHANGELOG<br />
alice: $ git commit -a -m "Merged bob's changes with some new additions"</code></p>
<p>Another setup might be to have a <strong>public repository</strong> for centralized access.  It&#8217;s not really a central repository, but it&#8217;s the place where you push all your changes to from any machine you work on.  In this way, anyone can go to exactly one place to get changes you&#8217;ve made, and you can work from any machine with git, using your own public repository as a starting point.<br />
<code>$ git clone --bare ~/proj proj.git<br />
$ touch proj.git/git-daemon-export-ok<br />
$ scp -r /proj.git user@host.com:/path/to/proj.git</code><br />
Want to have access to the repo via <strong>http</strong>?  Try this:<br />
<code>$ mv proj.git /var/www/html/repos/proj.git<br />
$ cd /var/www/html/repos/proj.git<br />
$ git --bare update-server-info<br />
$ chmod a+x hooks/post-update</code><br />
Now anyone can access your repository like so: <code>$ git clone http://example.com/repos/proj.git</code></p>
<p>Prefer a <strong>private repository</strong>?  It&#8217;s easier than the public setup.<br />
You: <code>$ git clone --bare /home/user/myrepo/.git /tmp/myrepo.git<br />
$ scp -r /tmp/myrepo.git myserver.com:/opt/git/myrepo.git</code><br />
Peer: <code>$ git clone myserver.com:/opt/git/myrepo.git</code></p>
<p>So how do these shared repositories work?</p>
<ol>
<li> clone to initialize local git revision management</li>
<li> modify/commit/revert/etc locally (1 or more times)</li>
<li> push up to the shared repository</li>
</ol>
<p>Peer: &#8230; makes changes to source &#8230;<br />
Peer: <code>$ git commit -a -m "I made a few changes"</code><br />
Peer: &#8230; continue editing until ready for consumption &#8230;<br />
Peer: <code>$ git commit -a -m "I made a few more changes"</code><br />
Peer: <code>$ git push ssh://yourserver.com/~you/proj.git master[:master]</code><br />
You: <code>$ git clone myserver.com:/opt/git/myrepo.git</code><br />
You: &#8230; editing/conflict management/etc. &#8230;<br />
You: <code>$ git commit -a -m "Pretty up peer's changes (minor edits)"</code><br />
You: <code>$ git push ssh://yourserver.com/~you/proj.git master[:master]</code></p>
<h3>Using Git on Windows</h3>
<p>If you plan on using Git on Windows (Sure, why not? masochists pssht) you could install <a href="http://sourceforge.net/projects/gitextensions/">Git Extensions (Windows)</a> from <a href="http://git-scm.com/tools">http://git-scm.com/tools</a>.  At least, that&#8217;s what I did.  It was confusing as all hell, until I went through all possible alternatives that appeared easier than understanding what a <a href="http://www.kernel.org/pub/software/scm/git/docs/git-remote.html">remote</a> is.  The key to getting it all to work is setting up ssh keys so that you can auto-logon to whatever server has your git repositories with the ssh protocol.  If you&#8217;re using the git protocol, I don&#8217;t think that applies.  I could be wrong on this.</p>
<p>Once you&#8217;ve installed <strong>Git Extensions</strong>, load it up, do some general configuration (user.name, user.email, etc.), then select from the menu bar <em>Remotes</em>-&gt;<em>PuTTy</em>-&gt;<em>Generate or import key</em>.  This assumes that you&#8217;ll be using <strong>PuTTY</strong> for all your ssh needs (if applicable).  Anyway, generate a key and save the public key somewhere handy, save the private key somewhere safe.  Now, using that pubkey, follow the advice for <a href="http://log.largevoid.com/2009-09/setting-up-ssh-keys/">Setting up SSH Keys</a>.  You&#8217;re going to want to add that pub key to your authorized_keys on the git repo server.  After that, make sure the PuTTY authentication agent is running (<em>Remotes</em>-&gt;<em>PuTTy</em>-&gt;<em>Start authentication agent</em>).  A new icon should appear in your system tray.  Right click on the new icon to &#8220;<em>Add Key</em>.&#8221;  This key will be your private key.  The agent handles the hand-shaking.</p>
<p>After doing all this the hard way, maybe you should just use the git protocol, but then again, I haven&#8217;t tried it myself.</p>
<h3>Resources</h3>
<p>Finally, it&#8217;s probably best to read Git&#8217;s HOWTOs and Tutorials.</p>
<ul>
<li><a href="http://git.or.cz/gitwiki/Installation">Git Installation</a></li>
<li><a href="http://book.git-scm.com/book.pdf">Git Community Book</a> (pgs. 40-44, 75-77)</li>
<li><a href="http://kernel.org/pub/software/scm/git/docs/howto/">Git HOWTOs</a></li>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">Git Tutorial (1of2)</a></li>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial-2.html">Git Tutorial (2of2)</a></li>
<li>man git</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/11/git-install-and-configure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>STDERR redirect into STDOUT redirect into file</title>
		<link>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/</link>
		<comments>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 02:00:08 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=12</guid>
		<description><![CDATA[When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file. The right way: Redirect stderr and stdout to [[file]]: [[command]] &#62; [[file]] 2&#62;&#38;1 Redirect stderr to [[efile]] and stdout to [[file]]: [[command]] 2&#62; [[efile]] &#62; [[file]] [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file.</p>
<p><strong>The right way:</strong></p>
<p>Redirect stderr and stdout to [[file]]:</p>
<p><code>[[command]] &gt; [[file]] 2&gt;&amp;1</code></p>
<p>Redirect stderr to [[efile]] and stdout to [[file]]:</p>
<p><code>[[command]] 2&gt; [[efile]] &gt; [[file]]</code></p>
<p><strong>The wrong way:</strong></p>
<p>Doesn’t do anything useful:</p>
<p><code>[[command]] 2&gt;&amp;1 &gt; [[file]]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summing a list of numbers</title>
		<link>http://log.largevoid.com/2009/10/summing-a-list-of-numbers/</link>
		<comments>http://log.largevoid.com/2009/10/summing-a-list-of-numbers/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 02:00:40 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=10</guid>
		<description><![CDATA[awk '{sum += $0} END {print sum}' Example: % find . -type f -exec wc {} \; &#124; tr -s " " &#124; cut -f2 -d" " &#124; awk '{sum += $0} END {print sum}' What’s going on? I want to recursively count the number of lines present in all files contained by the current [...]]]></description>
			<content:encoded><![CDATA[<p><code>awk '{sum += $0} END {print sum}'</code></p>
<p>Example:<code><br />
% find . -type f -exec wc {} \; | tr -s " " | cut -f2 -d" " | awk '{sum += $0} END {print sum}'</code></p>
<p>What’s going on? I want to recursively count the number of lines present in all files contained by the current directory. Why? Sub-directories =&gt; namespaces, and I want to know how many lines of code exist in the entire project, namespaces and all.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/10/summing-a-list-of-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  log.largevoid.com/tag/command-line/feed/ ) in 0.22790 seconds, on Feb 8th, 2012 at 12:48 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 8th, 2012 at 1:48 pm UTC -->
