<?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>plasticular inscriptor &#187; terminal</title>
	<atom:link href="http://www.plasticstare.com/plains/category/coding/terminal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.plasticstare.com/plains</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 02:19:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>quicksilver, curl, applescript, proxy-config, twitter</title>
		<link>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/</link>
		<comments>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 02:11:23 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=238</guid>
		<description><![CDATA[This explains how to use Quicksilver to send posts to Twitter from within a firewall. I made this my little lunch project today. First, let&#8217;s start with the basics. If you set up your work proxy server in your network config, there is not really any way to easily retrieve those settings. Let&#8217;s say you [...]]]></description>
			<content:encoded><![CDATA[<p>This explains how to use Quicksilver to send posts to Twitter from within a firewall. I made this my little lunch project today. First, let's start with the basics. If you set up your work proxy server in your network config, there is not really any way to easily retrieve those settings. Let's say you are using http://proxy.myco.com:3128 for your http proxy settings. In the Terminal, you have not actually set your http_proxy environment variable. <a href="http://www.cs.usyd.edu.au/%7Emassad/project-proxy-config.html">Mark Assad has proxy-config</a> available for download. You can grab that, put it in one of your path directories, and then in your .bashrc or .zshrc file the following:</p>
<pre class="brush: plain; light: true; title: ; notranslate">export http_proxy=`proxy-config -h`
export https_proxy=`proxy-config -s`
export ftp_proxy=`proxy-config -f`</pre>
<p>This will set your environment proxy variables to whatever they are currently set to in your Network Preferences. I got part of this also from <a href="http://tomayko.com/writings/os-x-network-location-support-from-the-command-line">Ryan Tomayko's blog</a>.This is important if you are inside a firewall at work.</p>
<p>The simplest way to post a tweet to twitter from the command line would be to do so using cURL. If you don't have cURL installed, you will need to install it. If you aren't familiar with cURL, it is basically a command-line tool for grabbing html documents (or whatever else). See <a href="http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/">this post</a> for another use. I got this idea, as well as the applescript for using it with Quicksilver, from <a href="http://blog.codahale.com/2007/01/15/tweet-twitter-quicksilver/">Coda Hale's blog</a>. Read that post for a full explanation of using Quicksilver and an applescript for posting to twitter from Quicksilver -- it has a pretty thorough explanation.</p>
<p>If you are inside a firewall, however, this will likely fail because the cURL command requires that the proxy settings be provided. So, I took the script from Coda's post, combined it with the comment on his post from Daan Kortenbach, and then enabled that for use with the system's proxy settings. The new script follows:</p>
<pre class="brush: plain; title: ; notranslate">
using terms from application &quot;GrowlHelperApp&quot;
	-- Register Growl
	on growlRegister()
		tell application &quot;GrowlHelperApp&quot;
			register as application &quot;Tweet&quot; all notifications {&quot;Alert&quot;} default notifications {&quot;Alert&quot;} icon of application &quot;Quicksilver.app&quot;
		end tell
	end growlRegister

	-- Notify using Growl
	-- Example: growlNotify(&quot;This is an Alert&quot;,&quot;This is a test of the Growl Alert System&quot;)
	on growlNotify(grrTitle, grrDescription)
		tell application &quot;GrowlHelperApp&quot;
			notify with name &quot;Alert&quot; title grrTitle description grrDescription application name &quot;Tweet&quot;
		end tell
	end growlNotify
end using terms from

using terms from application &quot;Quicksilver&quot;
	on process text tweet
		tell application &quot;Keychain Scripting&quot;
			set twitter_key to first Internet key of current keychain whose server is &quot;twitter.com&quot;
			set twitter_login to quoted form of (account of twitter_key &amp; &quot;:&quot; &amp; password of twitter_key)
		end tell
		set twitter_status to quoted form of (&quot;status=&quot; &amp; tweet)

                -- I have proxy-config in a directory &quot;~/bin&quot;
		set the_proxy to do shell script &quot;~/bin/proxy-config -h&quot;

		try
			if (the_proxy = &quot;&quot;) then
				set results to do shell script &quot;curl --user &quot; &amp; twitter_login &amp; &quot; --data-binary &quot; &amp; twitter_status &amp; &quot; http://twitter.com/statuses/update.json&quot;
			else
				set results to do shell script &quot;curl --proxy &quot; &amp; the_proxy &amp; &quot; --user &quot; &amp; twitter_login &amp; &quot; --data-binary &quot; &amp; twitter_status &amp; &quot; http://twitter.com/statuses/update.json&quot;
			end if
			growlRegister()
			growlNotify(&quot;Tweet Sent&quot;, tweet)
		on error
			(* In case curl fails for some reason,  alert us *)
			growlRegister()
			growlNotify(&quot;Error&quot;, &quot;There was an error sending your tweet.&quot;)
		end try

	end process text
end using terms from
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy and continue copying large files over file sharing</title>
		<link>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/</link>
		<comments>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 18:05:02 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/</guid>
		<description><![CDATA[In my experience, there is often a flaky slow server at work that contains vital files on it. This is fine when you need to retrieve files that are small, but what happens when you need to copy a large file? Most of the time these servers don't support ftp protocol and if you are [...]]]></description>
			<content:encoded><![CDATA[<p>In my experience, there is often a flaky slow server at work that contains vital files on it. This is fine when you need to retrieve files that are small, but what happens when you need to copy a large file? Most of the time these servers don't support ftp protocol and if you are on a Mac, you have to connect via smb (Samba) to the share and start copying and hope you don't have to stop, because if you stop the copy, the file disappears from your machine and you can't resume it.</p>
<p>However, I stumbled on this gem the other day:</p>
<blockquote><p><code>curl -C - -O file:///Volumes/samba_share/file/path/here.txt</code></p></blockquote>
<p>Basically, curl allows you to copy a file with url syntax in the terminal. The capital "O" tells curl to copy the file to your desktop with the same name as the file on your server, and the capital "C" tells it to continue where it may have left off. You can monitor the download in the terminal window. If you need to leave work and finish the copy the next day, simply enter the command again in the terminal and it will pick up the copy where it left off.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bizarre Clipboard Problem</title>
		<link>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/</link>
		<comments>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 18:47:05 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/</guid>
		<description><![CDATA[This has happened to me a couple of times using TextMate (probably has occurred elsewhere without consequences that I noticed). Every once in a long while, I will not be able to copy text into TextMate. I do this on a regular basis to analyze XML and JSON responses from the server for the application [...]]]></description>
			<content:encoded><![CDATA[<p>This has happened to me a couple of times using TextMate (probably has occurred<br />
elsewhere without consequences that I noticed). Every once in a long while, I will not be able to copy text into TextMate. I do this on a regular basis to analyze XML and JSON responses from the server for the application I work on at VmWare, copying FireBug response data into TextMate running either the XML tidy or a script I set up to tidy up the JSON data, so copying into TextMate is very important to me. Sometimes, however, it just doesn't work. I can copy/paste in TextMate, but not from another application to it. As it turns out, this has to do with the system pasteboard server. Essentially, you can fix the problem by restarting this service. See: <a href="http://wiki.macromates.com/Troubleshooting/CantPaste" title="CantPaste" target="_blank">http://wiki.macromates.com/Troubleshooting/CantPaste</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textmate: Run Command in Terminal</title>
		<link>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/</link>
		<comments>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 07:55:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/</guid>
		<description><![CDATA[Maybe this exists already - I couldn't find it, so I just wrote it. Of course, I am putting this here as code, but one day I'll publish a new bundle of TextMate commands which includes this and some of the other ones I've put together. I was looking around today for some commands that [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe this exists already - I couldn't find it, so I just wrote it. Of course, I am putting this here as code, but one day I'll publish a new bundle of TextMate commands which includes this and some of the other ones I've put together. I was looking around today for some commands that I might use to augment the Perforce bundle -- specifically, I needed a dialog. What I found was some references to the use of CocoaDialog, which is pretty handy. Another use I had envisioned for dialogs in a TextMate command was to be able to run terminal commands *in* the Terminal. After all, sometimes you would like to have something run and dump its output right there in the Terminal, rather than in a new TextMate document or something like that. The Apple Terminal is pretty nice for what it is, and its much better than the Linux KDE terminal, the Windows terminal, and the poor bastard Windows Cygwin terminal.<br />
To set up this in TextMate, open the Bundle Editor and create a new Command. Set the command to Save "Nothing", Input "None", and Output "Discard". Give it a key command if you like, and leave the Scope Selector blank. In the Command(s) field, paste the following:</p>
<div class="igBar"><span id="lcode-1"><a href="#" onclick="javascript:showCodeTxt('code-1'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-1">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/bin/bash</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># First use CocoaDialog to pop a dialog to get</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># the command you would like to run.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">res</span>=$<span style="color:#006600; font-weight:bold;">&#40;</span>CocoaDialog inputbox --title <span style="color:#CC0000;">"Run Command in Terminal Window"</span> --informative-text <span style="color:#CC0000;">"Enter the command here:"</span> --button1 <span style="color:#CC0000;">"Okay"</span> --button2 <span style="color:#CC0000;">"Cancel"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># if the cancel button was pressed then exit</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $<span style="color:#006600; font-weight:bold;">&#40;</span>head -n1 &lt;&lt;&lt;<span style="color:#CC0000;">"$res"</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC0000;">"2"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span> &amp;&amp; exit_discard</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># set the command string to what was entered</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">command=$<span style="color:#006600; font-weight:bold;">&#40;</span>tail -n1 &lt;&lt;&lt;<span style="color:#CC0000;">"$res"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># create our applescript which will launch a</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># new Terminal window if there is not one running</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># and otherwise run the command we want in the</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># current running Terminal window</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">aplscr=<span style="color:#CC0000;">"tell application <span style="color:#000099; font-weight:bold;">\"</span>System Events<span style="color:#000099; font-weight:bold;">\"</span> to set terminalRunning to (exists process <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span>)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">if (not terminalRunning) then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to activate</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to do script <span style="color:#000099; font-weight:bold;">\"</span>$command<span style="color:#000099; font-weight:bold;">\"</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to activate</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to do script <span style="color:#000099; font-weight:bold;">\"</span>$command<span style="color:#000099; font-weight:bold;">\"</span> in front window</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">end if"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># execute the applescript</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">osascript -e <span style="color:#CC0000;">"$aplscr"</span> &amp;&gt;/dev/null &amp; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In a nutshell, as the comments indicate, we capture the contents of the field in the dialog that is opened, and stick them into the applescript that we want to run. The applescript part checks to see if there is already a Terminal session window open, and  will run the command in the Terminal. If Terminal isn't open, then it launches it. You (or maybe me in the future) could fancy this up a bit if you wanted by having the Terminal change directory to the directory in which the file you are working on exists. Not sure that is always desirable though for my purposes.</p>
<p>Enjoy it. (if you're a total geek you probably will, at least in principle)</p>
<p>Additional work needed:<br />
1. Escape quotes (you have to do that manually now).<br />
2. Have Terminal spawn a new window if it is already running but has no open windows. (need to check for window count in addition to process running)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Terminal Hack &#8211; .DS_Store files</title>
		<link>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 17:33:57 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/</guid>
		<description><![CDATA[This only prevents .DS_Store files from being written on network shares, but nonetheless, quite handy. In the terminal, enter the following: defaults write com.apple.desktopservices DSDontWriteNetworkStores true]]></description>
			<content:encoded><![CDATA[<p>This only prevents .DS_Store files from being written on network shares, but nonetheless, quite handy. In the terminal, enter the following:</p>
<pre>defaults write com.apple.desktopservices DSDontWriteNetworkStores true</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alias adds to OSX Terminal</title>
		<link>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 06:18:50 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/</guid>
		<description><![CDATA[Since my latest job has gotten me using the Terminal in OSX much moreso than I used to, I've had to bone up on my unix (and linux) commands. Unfortunately, when OSX sets up your user account, there is no .bashrc file (that I could find) for doing things like setting up handy command aliases. [...]]]></description>
			<content:encoded><![CDATA[<p>Since my latest job has gotten me using the Terminal in OSX much moreso than I used to, I've had to bone up on my unix (and linux) commands. Unfortunately, when OSX sets up your user account, there is no .bashrc file (that I could find) for doing things like setting up handy command aliases. For example, by default, typing "ls ~" in the terminal will give you a listing of your home directory, but will not list any "invisible" files (those that start with "."). So, it would be nice to have "ls" actually call "ls -a" every time.</p>
<p>So, to accomplish this, you need to create 2 files, ".bashrc" and ".bash_profile" in your user directory. The contents of the .bash_profile file need to be as such for starters:</p>
<pre>. ~/.bashrc
ENV=$HOME/.bashrc
export ENV</pre>
<p>Then, the contents of .bashrc need to be something like this:</p>
<pre>PATH=$PATH:$HOME/bin:/usr/local/bin
alias ls="ls -a"
SHELL=/bin/bash</pre>
<p>This will get you started. If you have any questions beyond that, do some online searches for .bashrc and shell configuration. (I'm no expert, I just figure out what I need to do to get stuff done...)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textmate Open to New Project Window</title>
		<link>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 02:46:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/</guid>
		<description><![CDATA[Something that has bothered me for a while in TextMate is that in the project drawer you can open a single file in a new window. Often, I like to open a new scratch project window to edit certain files that may also be in the project itself. A simple solution to this is to [...]]]></description>
			<content:encoded><![CDATA[<p>Something that has bothered me for a while in TextMate is that in the project drawer you can open a single file in a new window. Often, I like to open a new scratch project window to edit certain files that may also be in the project itself. A simple solution to this is to create a new TextMate command (I called it "Open from Drawer" since it allows you to simply open a single file, even though it opens in the same project window). Set the Save to "Nothing", and the Input and Output to "None" and "Discard". In the Commands field, enter the following:</p>
<pre>&#35;&#33;&#47;bin&#47;sh
osascript -e "tell application \"TextMate\" to open POSIX file \"$TM_SELECTED_FILE\""
</pre>
<p>You can set a Key Equivalent if you like. When done, select a folder in your project drawer. If the folder is a file system folder (rather than a group), the script will spawn a new project window containing all the files in that folder. Selecting a "group" folder will do nothing (may work on that one later...).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>As2Api and RubyScript2Exe (darwinized)</title>
		<link>http://www.plasticstare.com/plains/2006/09/05/as2api-and-rubyscript2exe-darwinized/</link>
		<comments>http://www.plasticstare.com/plains/2006/09/05/as2api-and-rubyscript2exe-darwinized/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 21:55:05 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[downloadable]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/09/05/as2api-and-rubyscript2exe-darwinized/</guid>
		<description><![CDATA[I recently sat down and took a look at as2api, which seems to be the most recommended JavaDoc exporter for actionscript. Once I had everything figured out, it seems to work fine, and I'm sure there are some little nuggets that I haven't quite figured out yet, which I'm looking forward to figuring out. (read [...]]]></description>
			<content:encoded><![CDATA[<p>I recently sat down and took a look at <a href="http://www.badgers-in-foil.co.uk/projects/as2api/">as2api</a>, which seems to be the most recommended JavaDoc exporter for actionscript. Once I had everything figured out, it seems to work fine, and I'm sure there are some little nuggets that I haven't quite figured out yet, which I'm looking forward to figuring out. (read more for the skinny and darwin downloads)</p>
<p><span id="more-103"></span></p>
<p>However, for those of you out there in Mac OSX land, I wouldn't recommend downloading the current version listed on the site for OSX, entitled "as2api-allinone-osx-0.4.sit" in the downloads section. I think that it is missing files, or that it just doesn't work correctly at all. I would recommend instead downloading the first link for "as2api-0.4.tar". The downside of downloading this version is that there is no OSX command line executable in there, so you have to run the Ruby script "ruby as2api.rb <em>packages</em> --classpath <em>classpath</em>" which works just fine.</p>
<p>Honestly, I don't know enough about ANT scripts yet to know if you can run Ruby scripts from an ANT script target, so I used <a href="http://www.erikveen.dds.nl/rubyscript2exe/index.html">rubyscript2exe</a>, another handy little application to convert the Ruby scripts into a mac command line executable. (Incidentally, and to add a little geek comedy to this post, you have to install the Pascal compiler and compile a piece of the rubyscript2exe library in order to run it...so I had to compile one application in order to create another one...).</p>
<p>Anyway, I have included below 2 downloadables in this post. The first is the command line version of as2api that is compiled from the package that you can download as Ruby code from the as2api site. The down side is that you cannot tweek the css and html templates that are part of that code; the up side is that you can actually use it as a command line executable, which is entitled "as2api_darwin". You can used it exactly as you would the as2api.rb Ruby script.</p>
<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
Darwin Executable of As2Api (JavaDoc for Actionscript) (Sep. 5, 2006)<br />
Download (~4.5mB) :: <a href="http://www.plasticstare.com/plasticware/thirdparty/as2api-0.4.zip">as2api-0.4.zip</a></span></p>
<p>The second downloadable I have included here is the rubyscript2exe download, altered to include the eee_darwin file that I compiled from the pascal source on my mactel laptop in OSX 10.4.7, and repackaged using tar2rubyscript.rb, which was also necessary to get it running properly. I have also included the example hello world script "hello.rb" from the tutorial, which you can use to test the code and make a hello world exe.</p>
<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
RubyScript2Exe with eee_darwin for OSX environment (Sep. 5, 2006)<br />
Download (~1.1mB) :: <a href="http://www.plasticstare.com/plasticware/thirdparty/rubyscript2exe.zip.gz">rubyscript2exe.zip.gz</a></span></p>
<p>Both of these pieces of software are released by their proper creators under the GNU License, and I have included the source and license for each as well, as posted on their sites. Please download judiciously, the executable for as2api package is 4.5 mb.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/09/05/as2api-and-rubyscript2exe-darwinized/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OSX Graceful SMB Dismount (umount)</title>
		<link>http://www.plasticstare.com/plains/2006/08/16/osx-graceful-smb-dismount-umount/</link>
		<comments>http://www.plasticstare.com/plains/2006/08/16/osx-graceful-smb-dismount-umount/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 03:46:07 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/08/16/osx-graceful-smb-dismount-umount/</guid>
		<description><![CDATA[For the time being - until I get some extra code cash, I've switched back over to Eclipse, as I've been doing a good bit of Flash and Javascript coding, and my dev box is a Windows 2003 virtual machine on a server somewhere in California, on which I can also handily run Eclipse. So, [...]]]></description>
			<content:encoded><![CDATA[<p>For the time being - until I get some extra code cash, I've switched back over to Eclipse, as I've been doing a good bit of Flash and Javascript coding, and my dev box is a Windows 2003 virtual machine on a server somewhere in California, on which I can also handily run Eclipse. So, until I really optimize my process, I'm sidelining TextMate a bit (as my trial period is about done). So, I've been writing some Ant build scripts to optimize the process (more on that perhaps a bit later), and have configured a couple of targets in my flash project to auto-install my distribution tar.gz file onto my dev box.</p>
<p>This works great most of the time -- I connect to the dev VM via a windows share using an SMB connection from my Mac, so the Ant scripts point to the remote box as /Volumes/D$. Unfortunately...</p>
<p><span id="more-108"></span></p>
<p>...my router is flaky and times out my cable connection about 2-3 times a day, rendering my connection to my dev VM non-existent. Here is where the slight problem occurs - the mount-point on the Windows box is D$, so when OSX makes an SMB connection, it creates a D$ temporary folder in the /Volumes directory on the Mac. When the connection is unexpectedly broken, the clean-up to remove that directory fails, and when the share is reconnected, OSX creates a new version of the directory, as "D$-1" (or -2, -3, etc.), which breaks the Ant scripts.</p>
<p>The solution, simply, is to open the Terminal after such an unexpected disconnect, and perform the command:
<pre>sudo rmdir /Volumes/D$</pre>
<p> to remove the unmounted directory.</p>
<p>I have tried to connect directly to the smb share in the terminal utilizing the specific share directory:
<pre>sudo mount_smbfs -W workgroupname //username@ipaddressofserver/D$ /Volumes/D$</pre>
<p> but unfortunately, you have to su in the terminal (switch to root user) in order to access the contents -- otherwise the directory is read only. When running the Ant scripts from Eclipse, you don't have root user permissions, and copying to the remote machine fails. Anyone have any thoughts on this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/08/16/osx-graceful-smb-dismount-umount/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

