<?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>james young &#187; cli</title>
	<atom:link href="http://psyjinx.com/jyoung/tag/cli/feed/" rel="self" type="application/rss+xml" />
	<link>http://psyjinx.com/jyoung</link>
	<description>web application developer</description>
	<lastBuildDate>Fri, 05 Mar 2010 18:55:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to open files from cygwin into Visual Studio</title>
		<link>http://psyjinx.com/jyoung/2010/02/how-to-open-files-from-cygwin-into-visual-studio/</link>
		<comments>http://psyjinx.com/jyoung/2010/02/how-to-open-files-from-cygwin-into-visual-studio/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 07:02:03 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[dotfiles]]></category>
		<category><![CDATA[mintty]]></category>
		<category><![CDATA[visualstudio2008]]></category>

		<guid isPermaLink="false">http://psyjinx.com/jyoung/?p=242</guid>
		<description><![CDATA[<p>Had the desire to open files from the command line (a cygwin terminal, mintty, to be specific) into my existing session of Visual Studio 2008.  Here is what you can do.</p>
<p>Adjust paths as necessary.  Put this in your bash profile:</p>

export PATH=$PATH:/cygdrive/c/Program\ Files\ \&#40;x86\&#41;/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/
alias devedit=&#34;devenv \$1 /edit&#34;

<p>Now, this gives you two [...]]]></description>
			<content:encoded><![CDATA[<p>Had the desire to open files from the command line (a cygwin terminal, mintty, to be specific) into my existing session of Visual Studio 2008.  Here is what you can do.</p>
<p>Adjust paths as necessary.  Put this in your bash profile:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>cygdrive<span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files\ \<span style="color: #7a0874; font-weight: bold;">&#40;</span>x86\<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>Microsoft\ Visual\ Studio\ <span style="color: #000000;">9.0</span><span style="color: #000000; font-weight: bold;">/</span>Common7<span style="color: #000000; font-weight: bold;">/</span>IDE<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">devedit</span>=<span style="color: #ff0000;">&quot;devenv <span style="color: #000099; font-weight: bold;">\$</span>1 /edit&quot;</span></pre></div></div>

<p>Now, this gives you two tools. Well, one, but two will be available on the command line.</p>
<p>The main tool you now have is devenv, which allows you to do all sorts of things.  type <code>devenv /?</code> to see all the things you can do with it.</p>
<p>We are interested in <code>devenv filename /edit</code>.  I would prefer to just type the filename, and not need to type /edit everytime. The alias devedit takes care of this for us.  So, you can do <code>devenv whatever</code> to have access to all the features that tool gives you, and you can do <code>devedit filename</code> to quickly open up the file in your existing Visual Studio session.  If there is no session running, it will start one up.</p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2010/02/how-to-open-files-from-cygwin-into-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to open a window from terminal in cygwin on vista</title>
		<link>http://psyjinx.com/jyoung/2010/02/how-to-open-a-window-from-terminal-in-cygwin-on-vista/</link>
		<comments>http://psyjinx.com/jyoung/2010/02/how-to-open-a-window-from-terminal-in-cygwin-on-vista/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 11:42:11 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[dotfiles]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://psyjinx.com/jyoung/?p=237</guid>
		<description><![CDATA[<p>So I got a new Dell through work with Vista installed.  Naturally one of the first things I did was install cygwin so I can use mintty.  This gives me a decent terminal on widnows.  If you don&#8217;t know what those are, I encourage you to give them a shot.</p>
<p>Anyway, having used [...]]]></description>
			<content:encoded><![CDATA[<p>So I got a new Dell through work with Vista installed.  Naturally one of the first things I did was install cygwin so I can use mintty.  This gives me a decent terminal on widnows.  If you don&#8217;t know what those are, I encourage you to give them a shot.</p>
<p>Anyway, having used a mac forever, I found myself missing the &#8216;open&#8217; command that you can do from Terminal (on the mac) to pop open a window from the directory you are in.</p>
<p>With a quick search, I found that someone else already figured this out, so I am going to post my version of it here:</p>
<p>In your .bash_profile, add this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">open</span>=<span style="color: #ff0000;">&quot;cygstart <span style="color: #000099; font-weight: bold;">\$</span>1&quot;</span></pre></div></div>

<p>Then in mintty (or any cygwin terminal) you can cd to where ever you want, then just do &#8216;open [path]&#8216; and it will pop open a windows window for [path].</p>
<p>Examples:</p>
<ul>
<li>open current directory: <code>$ open .</code></li>
<li>open home directory : <code>$ open ~</code></li>
<li>open program files: <code>$ open ~/c/Program\ Files</code></li>
</ul>
<p>Note: that last one assumes you have made a symlink in your home to /cygdrive/c/</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~; <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>cygdrive<span style="color: #000000; font-weight: bold;">/</span>c</pre></div></div>

<p>Here is the original thread that I found this tip in:<br />
<a href="http://cygwin.com/ml/cygwin/2002-09/msg00632.html">http://cygwin.com/ml/cygwin/2002-09/msg00632.html</a></p>
<p>There are a few solutions posted, my favorite is:<br />
<a href="http://cygwin.com/ml/cygwin/2002-09/msg00635.html">http://cygwin.com/ml/cygwin/2002-09/msg00635.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2010/02/how-to-open-a-window-from-terminal-in-cygwin-on-vista/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Protecting Apache Served Directories</title>
		<link>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/</link>
		<comments>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 22:22:05 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://psyjinx.com/jyoung/?p=141</guid>
		<description><![CDATA[<p>Surprised I haven&#8217;t written this up before now.  It is very simple to do.</p>
<p>This assumes you are using apache on a unix based system.  This should work on any OS running apache though.</p>

In the directory you want to restrict create a file named .htaccess that contains the following:

AuthType Basic
AuthName &#34;RESTRICTED ACCESS&#34;
AuthUserFile /home3/speedtow/.htpasswd
Require valid-user


Note: [...]]]></description>
			<content:encoded><![CDATA[<p>Surprised I haven&#8217;t written this up before now.  It is very simple to do.</p>
<p>This assumes you are using apache on a unix based system.  This should work on any OS running apache though.</p>
<ol>
<li>In the directory you want to restrict create a file named .htaccess that contains the following:

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AuthType</span> Basic
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;RESTRICTED ACCESS&quot;</span>
<span style="color: #00007f;">AuthUserFile</span> /home3/speedtow/.htpasswd
<span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span></pre></div></div>

<ul>
<li>Note: AuthName can be anything you want it to say and AuthUserFile must be an absolute path to the .htpasswd file.  It can be anywhere, I wouldn&#8217;t recommend putting it in the directory you are restricting though, or any apache served directory for that matter.</li>
</ul>
</li>
<li>Create the .htpasswd file by running htpasswd in the location you want it to live.  It will go something like this:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ htpasswd <span style="color: #660033;">-c</span> .htpasswd username
New password:
Re-type new password:
Adding password <span style="color: #000000; font-weight: bold;">for</span> user username</pre></div></div>

</li>
</ol>
<p>Thats it,  your done.</p>
]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2009/07/protecting-apache-served-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn: Get Changes Since Revision x</title>
		<link>http://psyjinx.com/jyoung/2009/07/svn-get-changes-since-revision-x/</link>
		<comments>http://psyjinx.com/jyoung/2009/07/svn-get-changes-since-revision-x/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 04:47:00 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[version control]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=39</guid>
		<description><![CDATA[<p>Example, getting all changes since r260, followed by all changes except deleted files.</p>

svn log -v -r 260:HEAD &#124; grep '^[ ]\{3\}'
svn log -v -r 260:HEAD &#124; grep '^[ ]\{3\}' &#124; grep -v '^   D' &#124; cut -f3- -d/ &#124; perl -ne 'if(/(.*)\/.*$/){print $1.&#34;\n&#34;;}' &#124; sort &#124; uniq

]]></description>
			<content:encoded><![CDATA[<p>Example, getting all changes since r260, followed by all changes except deleted files.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> log <span style="color: #660033;">-v</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">260</span>:HEAD <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^[ ]\{3\}'</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> log <span style="color: #660033;">-v</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">260</span>:HEAD <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^[ ]\{3\}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'^   D'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f3-</span> -d<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">'if(/(.*)\/.*$/){print $1.&quot;\n&quot;;}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2009/07/svn-get-changes-since-revision-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>command line reporting</title>
		<link>http://psyjinx.com/jyoung/2007/04/command-line-reporting/</link>
		<comments>http://psyjinx.com/jyoung/2007/04/command-line-reporting/#comments</comments>
		<pubDate>Sun, 29 Apr 2007 04:52:53 +0000</pubDate>
		<dc:creator>James Young</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://psyjinx.com/wp/?p=43</guid>
		<description><![CDATA[<p>Here are some things I have done in the past to pull data out of log files.  I find myself referring to this list from time to time to remember how I did things in the past.</p>

Real Queries That May Need To Be Repeated
&#160;
ATT YIH upgrades in the month of 200709
$ listysftclog 200709* &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some things I have done in the past to pull data out of log files.  I find myself referring to this list from time to time to remember how I did things in the past.</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;">Real Queries That May Need To Be Repeated
&nbsp;
ATT YIH upgrades <span style="color: #804040;">in</span> the month of <span style="color: #000000; font-weight:bold;">200709</span>
<span style="color: #000000;">$</span> listysftclog <span style="color: #000000; font-weight:bold;">200709</span><span style="color: #000000;">*</span> <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/(yihupg[^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">-</span>r <span style="color: #000000;">|</span> uniq <span style="color: #000000;">-</span>c
&nbsp;
Scratch Work
These searches are mostly captures <span style="color: #804040;">in</span> cronjobs and shell scripts<span style="color: #000000;">.</span> Using this page as a place to store some of them <span style="color: #804040;">while</span> working them out<span style="color: #000000;">.</span>
&nbsp;
Misc Searches
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">~/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/beacon.choice~([^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> sed <span style="color: #C5A22D;">'s/&amp;/<span style="">\&amp;</span>/'</span> <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">|</span> uniq <span style="color: #000000;">-</span>c <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">-</span>nr
&nbsp;
Get page views <span style="color: #804040;">for</span> att<span style="color: #000000;">/</span>v4 choice page
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">~/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> grep choice<span style="color: #000000;">.</span>php <span style="color: #000000;">|</span> grep result<span style="color: #000000;">~</span><span style="color: #000000; font-weight:bold;">200</span> <span style="color: #000000;">|</span> wc <span style="color: #000000;">-</span>l
&nbsp;
Get uniq visits to choice page
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">~/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> grep result<span style="color: #000000;">~</span><span style="color: #000000; font-weight:bold;">200</span> <span style="color: #000000;">|</span> cut <span style="color: #000000;">-</span>f10 <span style="color: #000000;">-</span>d\<span style="color: #000000;">|</span> <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">|</span> uniq <span style="color: #000000;">|</span> wc <span style="color: #000000;">-</span>l
&nbsp;
Get all user agents
This still needs some work, there is a <span style="color: #000000;">^</span>D <span style="color: #804040;">in</span> there that needs to be removed
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">/</span>home<span style="color: #000000;">/</span>y<span style="color: #000000;">/</span>logs<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/choiceua([^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">|</span> uniq <span style="color: #000000;">-</span>c <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">-</span>nr
&nbsp;
Get Windows users
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">/</span>home<span style="color: #000000;">/</span>y<span style="color: #000000;">/</span>logs<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/choiceua([^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> grep Windows <span style="color: #000000;">|</span> wc <span style="color: #000000;">-</span>l
&nbsp;
Get Mac users
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">/</span>home<span style="color: #000000;">/</span>y<span style="color: #000000;">/</span>logs<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/choiceua([^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> grep Mac <span style="color: #000000;">|</span> wc <span style="color: #000000;">-</span>l
&nbsp;
Specific examples
   <span style="color: #000000;">*</span> Replace <span style="color: #000000;">&amp;</span> <span style="color: #804040;">in</span> <span style="color: #25BB4D;">search</span> results with <span style="color: #000000;">&amp;</span>
<span style="color: #000000;">$</span> <span style="color: #804040;">cat</span> <span style="color: #000000;">~/</span>ysftc<span style="color: #000000;">.</span>log <span style="color: #000000;">|</span> grep att<span style="color: #000000;">/</span>v4 <span style="color: #000000;">|</span> perl <span style="color: #000000;">-</span>ne <span style="color: #C5A22D;">'if(/beacon.choice~([^|]*)/){print $1.&quot;<span style="">\n</span>&quot;;}'</span> <span style="color: #000000;">|</span> sed <span style="color: #C5A22D;">'s/&amp;/<span style="">\&amp;</span>/'</span> <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">|</span> uniq <span style="color: #000000;">-</span>c <span style="color: #000000;">|</span> <span style="color: #25BB4D;">sort</span> <span style="color: #000000;">-</span>nr
 <span style="color: #000000; font-weight:bold;">23</span> AT<span style="color: #000000;">&amp;</span>T Yahoo<span style="color: #000000;">!</span> Online Protection
 <span style="color: #000000; font-weight:bold;">13</span> Parental Controls
 <span style="color: #000000; font-weight:bold;">11</span> AT<span style="color: #000000;">&amp;</span>T Yahoo<span style="color: #000000;">!</span> Messenger
 <span style="color: #000000; font-weight:bold;">11</span> AT<span style="color: #000000;">&amp;</span>T Yahoo<span style="color: #000000;">!</span> Browser
 <span style="color: #000000; font-weight:bold;">11</span> AT<span style="color: #000000;">&amp;</span>T Toolbar
  <span style="color: #000000; font-weight:bold;">6</span> Connection Manager
  <span style="color: #000000; font-weight:bold;">2</span> AT<span style="color: #000000;">&amp;</span>T Pop<span style="color: #000000;">-</span>Up Blocker
  <span style="color: #000000; font-weight:bold;">1</span> AT<span style="color: #000000;">&amp;</span>T Security Suite SM</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://psyjinx.com/jyoung/2007/04/command-line-reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
