<?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>BogoJoker &#187; mac</title>
	<atom:link href="http://blog.bogojoker.com/category/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bogojoker.com</link>
	<description>&#039;My humble abode&#039;.sub(/ab/,&#039;c&#039;)</description>
	<lastBuildDate>Mon, 04 Apr 2011 07:33: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>Mac OS X &#8211; Moving Windows Quick Tip</title>
		<link>http://blog.bogojoker.com/2009/04/mac-os-x-moving-windows-quick-tip/</link>
		<comments>http://blog.bogojoker.com/2009/04/mac-os-x-moving-windows-quick-tip/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 21:28:04 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.bogojoker.com/?p=766</guid>
		<description><![CDATA[If your Mac won&#8217;t let you move a window because of a dialog or something, but you really want to move the window, just open Spaces and move the window from there! This seems to work every time. Its made working with some poorly developed applications a little easier. Now if I could just make [...]]]></description>
			<content:encoded><![CDATA[<p>If your Mac won&#8217;t let you move a window because of a dialog or something, but you really want to move the window, just open Spaces and move the window from there!  This seems to work every time. Its made working with some poorly developed applications a little easier.</p>
<p>Now if I could just make some dialogs stay in front of the actual application window I would be completely happy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2009/04/mac-os-x-moving-windows-quick-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mini MP3 Searching Shell &#8211; Skreemr</title>
		<link>http://blog.bogojoker.com/2009/02/mini-mp3-searching-shell-skreemr/</link>
		<comments>http://blog.bogojoker.com/2009/02/mini-mp3-searching-shell-skreemr/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 15:30:49 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[SotD]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.bogojoker.com/?p=493</guid>
		<description><![CDATA[So its way to hard to download an mp3 in Safari. Right click the link and download? Pff, I want to ⌃S and be done with it. Well, this time I decided to avoid the problem all together. I use Skreemr to search for a particular song when it interests me. In the past I [...]]]></description>
			<content:encoded><![CDATA[<p>So its way to hard to download an mp3 in Safari. Right click the link and download? Pff, I want to ⌃S and be done with it. Well, this time I decided to avoid the problem all together. I use <a href="http://skreemr.com/">Skreemr</a> to search for a particular song when it interests me.</p>
<p>In the past I wrote a little bash script, that makes use of curl, to download an mp3 to my desktop unique named so it wouldn&#8217;t have conflicts. This shell essentially wraps and drastically improves that to allow for searching, pagination, history, downloading, and opening mp3s off of Skreemr. It gives me just what I need. The functionality that I want without having to use torrents etc. I&#8217;m thinking of turning this into a gem.</p>
<p><img src="http://blog.bogojoker.com/wp-content/uploads/2009/02/skreemr.png" width="658" height="846" alt="skreemr.png" style="border:none; margin-left: -35px;" /></p>
<p>This script requires the popular &#8220;escape.rb&#8221; script that gives some nice and safe shell escaping functions. You can download both from my <a href="http://github.com/JosephPecoraro/scripts/tree/master">GitHub scripts project</a>.</p>
<p>Of course its available on my <a href="http://bogojoker.com/shell/">~/bin</a> and there will be another article later on that goes over a few aspects of this simple little script.</p>
<p><a href="http://github.com/JosephPecoraro/scripts/tree/master"><img src="http://blog.bogojoker.com/wp-content/uploads/2009/02/skreemr2.png" width="450" height="150" alt="skreemr2.png" style="margin: 10px 50px; border: 1px solid lightGray" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2009/02/mini-mp3-searching-shell-skreemr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Instant Web Sharing on Your Mac</title>
		<link>http://blog.bogojoker.com/2009/02/instant-web-sharing-on-your-mac/</link>
		<comments>http://blog.bogojoker.com/2009/02/instant-web-sharing-on-your-mac/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:30:56 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[SotD]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.bogojoker.com/?p=466</guid>
		<description><![CDATA[I came across a few articles recently that point out how to instantly share a folder on your computer. They basically ride on top of this elegant python script: python -m SimpleHTTPServer It works great but I wanted to improve on it in a number of ways: Automatically copy a URI into my clipboard so [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a few articles recently that point out how to instantly share a folder on your computer.  They basically ride on top of this elegant python script:</p>
<pre class="textmate-source twilight"><span class="source source_shell">python -m SimpleHTTPServer</span></pre>
<p>It works great but I wanted to improve on it in a number of ways:</p>
<ul>
<li>
<p>Automatically copy a URI into my clipboard so I can easily paste it to others.</p>
</li>
<li>
<p>Make that URI nicer then just an IP address.</p>
</li>
<li>
<p>Use a non-standard port, for security.</p>
</li>
<li>
<p>Open in a new tab so I can keep working in the directory and yet still monitor the HTTP requests being made.</p>
</li>
</ul>
<p><a href="http://github.com/JosephPecoraro/scripts/blob/e6defa3cf2de04effd760822024b7dd71822c2e9/easy_share">Here was what I produced.</a>  (Its up in my <a href="http://bogojoker.com/shell/">~/bin</a>.)</p>
<pre class="textmate-source twilight"><span class="source source_shell"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>!/bin/bash
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Start Date: Sunday February 8, 2009
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Current Version: 0.9
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Author: Joseph Pecoraro
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Contact: joepeck02@gmail.com
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Decription:  Immediately Share the current directory
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   in a new tab so you can monitor the requests made
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   have your original tab to continue working in that
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   directory.  Meant for Mac OS X.
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   1. Echos the URI
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   2. Puts the URI into your Clipboard
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   3. Opens a new tab in the terminal
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   4. Changes Directory to the other tabs directory
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   5. Echos the URI
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   6. Runs the Web Server
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   7. Optionally Opens in Safari
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Sources that Helped:
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   New Tab Here: http://justinfrench.com/index.php?id=231
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   HTTPServer:   http://www.commandlinefu.com/commands/view/71/
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   Paul Berens:  http://zibundemo.blogspot.com/
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>
</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   Host and Port
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> This gets your ip address and converts it to a nice string
</span>es_host=<span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>curl --silent www.whatismyip.com/automation/n09230945.asp<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span>
es_host=<span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>nslookup <span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_host</span> <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">|</span> awk <span class="string string_quoted string_quoted_single string_quoted_single_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">'</span>/name =/{print substr($4,1,length($4)-1)}<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">'</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span>
es_port=<span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>8000<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   Script Below
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span>
<span class="support support_function support_function_builtin support_function_builtin_shell">echo</span> <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>http://<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_host</span>:<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_port</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
<span class="support support_function support_function_builtin support_function_builtin_shell">echo</span> -n <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>http://<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_host</span>:<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_port</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span> <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">|</span> pbcopy
osascript -e <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>
Tell application <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>Terminal<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>
  activate
  tell application <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>System Events<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> to tell process <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>Terminal<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> to keystroke <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>t<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> using command down
  do script with command <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>cd '<span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span><span class="support support_function support_function_builtin support_function_builtin_shell">pwd</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span>'<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> in selected tab of the front window
  do script with command <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>clear; echo '<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_host</span>:<span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_port</span>/'<span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> in selected tab of the front window
  do script with command <span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span>python -m SimpleHTTPServer <span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_port</span><span class="constant constant_character constant_character_escape constant_character_escape_shell">\"</span> in selected tab of the front window
end tell<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span> <span class="keyword keyword_operator keyword_operator_list keyword_operator_list_shell">&amp;</span><span class="keyword keyword_operator keyword_operator_redirect keyword_operator_redirect_shell">&gt;</span> /dev/null

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Optional: Open Safari, Just Uncomment the next line
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> open "http://$es_host:$es_port"
</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Cleanup
</span><span class="support support_function support_function_builtin support_function_builtin_shell">unset</span> es_host
<span class="support support_function support_function_builtin support_function_builtin_shell">unset</span> es_port
</span></pre>
<p>Now that should work on any Mac.  And it should give a nicer URL then an ugly IP address.  You should see something like this:</p>
<p><img src="http://blog.bogojoker.com/wp-content/uploads/2009/02/picture-1.png" alt="easy_share" title="easy_share" width="560" height="292" class="alignright size-full wp-image-469" style="border:none; margin: 0px 20px" /></p>
<p>As soon as it starts you can paste the URL to anyone you&#8217;re chatting with.  It couldn&#8217;t be simpler!</p>
<p>If you&#8217;re experienced enough with DNS servers and you&#8217;ve given your computer a Dynamic Name you can customize the script.  Paul Berens gave me a great suggestion to determine if I&#8217;m on my local network at home.  I can check the MAC address of my default gateway (my wireless router).  That is a quick check to see if I&#8217;m at home.  If I&#8217;m at home I use my bogojoker.is-a-geek.com URI automatically!  Otherwise it defaults to generating the dynamic address generation.  Check it out:</p>
<pre class="textmate-source twilight"><span class="source source_shell"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span>   Host and Port
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> -----------------
</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Mac Address of my Router At Home
</span><span class="meta meta_scope meta_scope_if-block meta_scope_if-block_shell"><span class="keyword keyword_control keyword_control_shell">if</span> [ -n <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span><span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>arp -a <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">|</span> grep 0:1e:2a:76:17:98<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span> ]<span class="keyword keyword_operator keyword_operator_list keyword_operator_list_shell">;</span> <span class="keyword keyword_control keyword_control_shell">then</span>
  es_host=<span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>bogojoker.is-a-geek.com<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
  es_port=<span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>8000<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_shell"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_shell">#</span> Otherwise Dynamically Determine
</span><span class="keyword keyword_control keyword_control_shell">else</span>
  es_host=<span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>curl --silent www.whatismyip.com/automation/n09230945.asp<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span>
  es_host=<span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>nslookup <span class="variable variable_other variable_other_normal variable_other_normal_shell"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_shell">$</span>es_host</span> <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">|</span> awk <span class="string string_quoted string_quoted_single string_quoted_single_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">'</span>/name =/{print substr($4,1,length($4)-1)}<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">'</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span>
  es_port=<span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>8000<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
<span class="keyword keyword_control keyword_control_shell">fi</span></span>
</span></pre>
<p>So now when I run easy_share at my house it always throws out bogojoker.is-a-geek.com URIs.  Much nicer on the eyes and easy to remember.  I&#8217;ll write about dynamic names like this another time!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2009/02/instant-web-sharing-on-your-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Web URLs with ExpanDrive</title>
		<link>http://blog.bogojoker.com/2008/12/dynamic-web-urls-with-expandrive/</link>
		<comments>http://blog.bogojoker.com/2008/12/dynamic-web-urls-with-expandrive/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 02:10:26 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[SotD]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ExpanDrive]]></category>
		<category><![CDATA[expanurl]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.bogojoker.com/?p=245</guid>
		<description><![CDATA[Often when I work with ExpanDrive the files I am working on correspond to some website that I own. When I&#8217;m mounted with ExpanDrive each file is accessible via &#8220;my hard drive&#8221; in the mounted volume and, more importantly, from a web URL! I found myself repeatedly opening up my browser and manually typing the [...]]]></description>
			<content:encoded><![CDATA[<p>Often when I work with <a href="http://expandrive.com/">ExpanDrive</a> the files I am working on correspond to some website that I own.  When I&#8217;m mounted with ExpanDrive each file is accessible via &#8220;my hard drive&#8221; in the mounted volume and, more importantly, from a web URL!  I found myself repeatedly opening up my browser and manually typing the URL for files that I just uploaded or edited.  This was error prone, especially if some of the characters needed encoding.  So, I spent some time to write up a Ruby script that can read ExpanDrive&#8217;s preferences, build the file&#8217;s &#8220;web URL,&#8221; and open it in your default browser.</p>
<p><img src="http://blog.bogojoker.com/wp-content/uploads/2008/12/expanurl-usage.png" alt="expanurl usage" title="expanurl usage" width="588" height="478" class="aligncenter size-full wp-image-252" style="border:none" /></p>
<h2>Simple to Use</h2>
<p>I followed along with ExpanDrive&#8217;s previous command line tool named expan and named my script expanurl.  Given no arguments it will open the current directory via its web URL, or you can give a list of files and each will be opened at their web URLs.  Its usage is pretty straightforward but there is a single catch: the server setting in an ExpanDrive Drive may not be a true one-to-one mapping with the web server&#8217;s address.</p>
<p>For example: I provide holly.cs.rit.edu as the server value for one of my personal ExpanDrive drives.  However, when I view files on that server (inside the public_html directory) they have a much different looking URL: http://www.cs.rit.edu/~jjp1820/.  The result?  The script simply keeps its own mapping of ExpanDrive server values to their associated web page prefixes.  When you use expanurl on a Drive you have never used it on before the script will prompt you for that mapping, store the value, and never ask again.</p>
<p>Here it is in action.  I have removed all stored mappings so I can demonstrate what it would be like using expanurl for the first time. Here I use it on my BogoJoker ExpanDrive drive:</p>
<p><img src="http://blog.bogojoker.com/wp-content/uploads/2008/12/picture-21.png" alt="expanurl first usage" title="expanurl first usage" width="588" height="430" class="aligncenter size-full wp-image-249" style="border:none;"/></p>
<p>Notice that in the prompt it tells you:</p>
<ul>
<li>the server that the ExpanDrive volume is linked to and the one you will be providing a web url prefix for</li>
<li>an example of a web url prefix (useful)</li>
<li>where the mappings are stored in case you need to edit them later</li>
</ul>
<p>The script is available on GitHub, so feel free to contribute and improve.  <a href="http://github.com/JosephPecoraro/scripts/tree/master/expanurl">Here is a link to the always current version</a>, and here is a snapshot of the current version at the time of writing:</p>
<p>&nbsp;</p>
<pre class="textmate-source twilight"><span class="source source_ruby"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>!/usr/bin/env ruby
# Author: Joseph Pecoraro
# Date: Saturday December 13, 2008
# Description: When I'm using ExpanDrive and I'm
# remotely logged into a server, I can use this
# script to "open filename" and it will open using
# the server's associated URL.
</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> For URL Escaping and Stored Mappings
</span><span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>uri<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
<span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>yaml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Exit with a msg
</span><span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">err</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">msg</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
  puts msg
  exit <span class="constant constant_numeric constant_numeric_ruby">1</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Simple Class to handle the mappings
</span><span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">UrlMap</span></span>

  <span class="variable variable_other variable_other_constant variable_other_constant_ruby">MAP_PATH</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="support support_class support_class_ruby">File</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>expand_path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>~/.expanurl<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>

  <span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">initialize</span></span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>hash</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> load
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">load</span></span>
    <span class="keyword keyword_control keyword_control_ruby">if</span> <span class="support support_class support_class_ruby">File</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>exists?<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">MAP_PATH</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
      <span class="support support_class support_class_ruby">YAML</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span>load_file<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span> <span class="support support_class support_class_ruby">File</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>expand_path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">MAP_PATH</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="keyword keyword_control keyword_control_ruby">else</span>
      <span class="support support_class support_class_ruby">Hash</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">add_mapping</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">server<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> mapto</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>hash</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span>server<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> mapto
    <span class="support support_class support_class_ruby">File</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>open<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">MAP_PATH</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>w<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby">do </span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span><span class="variable variable_other variable_other_block variable_other_block_ruby">file</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span>
      file<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>write<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>hash</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>to_yaml<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">is_mapping?</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">server</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>hash</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>has_key?<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>server<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">get_mapping</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">server</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>hash</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span>server<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">path</span></span>
    <span class="variable variable_other variable_other_constant variable_other_constant_ruby">MAP_PATH</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Local Variables
</span>mapping <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="support support_class support_class_ruby">UrlMap</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span>
url_prefix <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="constant constant_language constant_language_ruby">nil</span>
server <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="constant constant_language constant_language_ruby">nil</span>
volume <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="constant constant_language constant_language_ruby">nil</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Check the if the current directory is an
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> ExpanDrive Volume and a public_html folder
</span>pwd <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_interpolated string_interpolated_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">`</span>pwd<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">`</span></span>
match <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> pwd<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span>^<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>Volumes<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span><span class="string string_regexp string_regexp_group string_regexp_group_ruby"><span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">(</span><span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>^<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+<span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">)</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="keyword keyword_control keyword_control_ruby">if</span> match<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>nil?
  err<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Not inside an ExpanDrive Volume<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="keyword keyword_control keyword_control_ruby">elsif</span> <span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby">!</span>pwd<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>public_html<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>?<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  err<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Not inside a public_html directory.<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="keyword keyword_control keyword_control_ruby">else</span>
  volume <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> match<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
  defaults <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_interpolated string_interpolated_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">`</span>defaults read com.magnetk.ExpanDrive Drives<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">`</span></span>
  defaults<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>gsub!<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\n</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  props <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> defaults<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\{</span><span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>^<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\}</span><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+driveName<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\s</span>+=<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\s</span>+<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>volume<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>^<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\}</span><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+server<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\s</span>+=<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\s</span>+"<span class="string string_regexp string_regexp_group string_regexp_group_ruby"><span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">(</span><span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>^"<span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+<span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">)</span></span>"<span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>^<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\}</span><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\}</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  <span class="keyword keyword_control keyword_control_ruby">if</span> props
    server <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> props<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
  <span class="keyword keyword_control keyword_control_ruby">else</span>
    err<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>This Volume (<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>volume<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span>) is not an ExpanDrive Volume<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Check if a mapping exists
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Otherwise create and store one
</span><span class="keyword keyword_control keyword_control_ruby">if</span> mapping<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>is_mapping?<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>server<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  url_prefix <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> mapping<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>get_mapping<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>server<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="keyword keyword_control keyword_control_ruby">else</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Prompt
</span>  puts
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>This is the first time you've used expanurl for <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>volume<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Please Provide us with a mapping for <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>server<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Mappings are stored in <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>mapping<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>path<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Example: http://bogojoker.com/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  print <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>&gt;&gt; <span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Store user input and proceed
</span>  url_prefix <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> gets<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>chomp
  url_prefix <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">+=</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> <span class="keyword keyword_control keyword_control_ruby">unless</span> url_prefix<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>$<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  mapping<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>add_mapping<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>server<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> url_prefix<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Terminal Output
</span>  puts
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Server: <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>server<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Maps to: <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>url_prefix<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts

<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Build the URL
</span>subpath <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> pwd<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span>public_html<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>?<span class="string string_regexp string_regexp_group string_regexp_group_ruby"><span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">(</span>.*<span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">)</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
subpath <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">+=</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> <span class="keyword keyword_control keyword_control_ruby">unless</span> subpath<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>length<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>zero? <span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby">||</span> subpath<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>match<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\/</span>$<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
url_prefix <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">+=</span> subpath

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> If No Files, open the directory
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Otherwise,   open each provided file
</span><span class="keyword keyword_control keyword_control_ruby">if</span> <span class="support support_class support_class_ruby">ARGV</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>size <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">==</span> <span class="constant constant_numeric constant_numeric_ruby">0</span>
  <span class="string string_interpolated string_interpolated_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">`</span>open <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>url_prefix<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">`</span></span>
<span class="keyword keyword_control keyword_control_ruby">else</span>
  <span class="support support_class support_class_ruby">ARGV</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>each <span class="keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby">do </span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span><span class="variable variable_other variable_other_block variable_other_block_ruby">filename</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span>
    <span class="string string_interpolated string_interpolated_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">`</span>open <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>url_prefix<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}#{</span><span class="support support_class support_class_ruby">URI</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>escape<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>filename<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">`</span></span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>&nbsp;</p>
<h2>How it Works</h2>
<p>The Ruby Script grabs the current working directory using `pwd` and checks to make sure you&#8217;re in an ExpanDrive volume.  ExpanDrive volume&#8217;s are dynamically generated by parsing the ExpanDrive preferences thanks to their foresight to make them accessible via the `defaults` command.  So if you&#8217;re in an ExpanDrive volume and inside a public_html directory expanurl will then use its mapping to open a uri encoded web url in your default browser with the `open` command.</p>
<p>The mappings are stored in a hidden YAML file in your home directory (~/.expanurl).  This style of storing preferences is just like dozens of other command line applications and scripts.  YAML is just a lightweight textual data format popular with Ruby, similar to JSON and XML.  Its so simple that you could edit the file yourself if you wanted/needed to.  For instance here is what is in mine, just two simple key/value pairs:</p>
<p><img src="http://blog.bogojoker.com/wp-content/uploads/2008/12/picture-31.png" alt="~/.expanurl yaml mapping" title="~/.expanurl yaml mapping" width="581" height="286" class="aligncenter size-full wp-image-255" style="border: none" /></p>
<h2>The Future</h2>
<p>Its just that simple.  Being a Ruby Script you can call this from GUI applications, anything with built-in shell access, etc.  It should play friendly with your usual Unix tools.  I will likely make this script more and more robust if others find it useful, so I&#8217;d be happy to hear some feedback.</p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2008/12/dynamic-web-urls-with-expandrive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spaces, Exposé, Hot Corners, Dashboard Broken?</title>
		<link>http://blog.bogojoker.com/2008/08/spaces-expose-hot-corners-dashboard-broken/</link>
		<comments>http://blog.bogojoker.com/2008/08/spaces-expose-hot-corners-dashboard-broken/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 03:00:56 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.bogojoker.com/?p=72</guid>
		<description><![CDATA[I ferociously make use of Spaces and Exposé. To utilize them I use QuickSilver, Cmd+Tab, the Dock, special Mouse Buttons, but most of all I use the Hot Corners! Occasionally, when I wake my Mac Book Pro these features won&#8217;t work. No reason given, just when I try I get the usual chime meaning &#8220;this [...]]]></description>
			<content:encoded><![CDATA[<p>I ferociously make use of Spaces and Exposé.  To utilize them I use QuickSilver, Cmd+Tab, the Dock, special Mouse Buttons, but most of all I use the Hot Corners!  Occasionally, when I wake my Mac Book Pro these features won&#8217;t work.  No reason given, just when I try I get the usual chime meaning &#8220;this can&#8217;t be done.&#8221;  At the time the only sure solution was to reboot the computer.  Not anymore.  Just open up your terminal and run:</p>
<p><code>killall Dock</code></p>
<p>Since those major features (Spaces, Exposé, and the Dashboard) are tied to the Dock, this command will restart the Dock and, like magic, those features will work again.  Killing the Dock and even Finder with `killall` are special cases.  Those two will automatically restart on their own.  However, for other programs, it will just quit.  For instance if Firefox hangs you could type `killall Firefox` and Firefox would be force quit but would not reopen.  Check the man page for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2008/08/spaces-expose-hot-corners-dashboard-broken/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My MacBook Pro</title>
		<link>http://blog.bogojoker.com/2007/07/my-macbook-pro/</link>
		<comments>http://blog.bogojoker.com/2007/07/my-macbook-pro/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 03:36:18 +0000</pubDate>
		<dc:creator>Joseph Pecoraro</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[misc.]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://bogojoker.com/weblog/2007/07/26/my-macbook-pro/</guid>
		<description><![CDATA[This post is just letting some steam out, so there is a lot of text and a lot of links, all because I recently made a very worthwhile purchase. I bought a brand new MacBook Pro laptop and I am more then happy. I didn&#8217;t really know what to expect, I was really looking forward [...]]]></description>
			<content:encoded><![CDATA[<p>This post is just letting some steam out, so there is a lot of text and a lot of links, all because I recently made a very worthwhile purchase.  I bought a brand new MacBook Pro laptop and I am more then happy.  I didn&#8217;t really know what to expect, I was really looking forward to it&#8230; however it has exceeded all of my expectations.</p>
<p>The quick specs are that its a Silver MBP with a 15.4in glossy widescreen display with the newest LED back-lightning.  It houses a 2GB of RAM and an Intel Core 2 Duo that knock the socks of my previous 512/1.6 laptop.  The software takes a larger explanation.</p>
<p>I had originally planned on holding out on buying a Mac until Leopard was released.  My plans were pushing forward when I won a bundle of applications valued at more then $500 from <a href="http://www.macupdate.com/">MacUpdate</a> and <a href="http://macheist.com/">MacHeist</a>.  However I had been looking at software to download for weeks before my purchase and the list of free, high quality software is nearly endless.  Still, there are always programs you have to splurge on.</p>
<p>I splurged on <a href="http://macromates.com/">TextMate</a>, a programming editor that translates into about $55.  Its the single tool that I have heard the most about from web developers all around the world.  I have to agree with the masses, its a fantastic editor that is grows more and more useful as I get acquainted with the Mac.</p>
<p>On the free end of things I have to mention <a href="http://quicksilver.blacktree.com/">QuickSilver</a>.  I might argue that every Mac user has at least heard of QS as its popularity is nearly as high as that of TextMate.  I really appreciate this little app as it really does just make my life easier.  It took a few minutes to setup these global triggers for iTunes: ?P to pause/play and ??? to go to the next song.  That means from nearly anywhere those key combinations will trigger iTunes.  I&#8217;m learning more as I go but QS is useful in more ways than one.</p>
<p>For Instant Messaging I thought I would like iChat.  I thought it was okay, it certainly was easy to setup and worked great, however it just wasn&#8217;t up to my standards.  I had heard about a <a href="http://www.adiumx.com/">Adium</a> and decided to give it a try.  That is an amazing IM program.  There are plenty of great themes and almost everything is customizable.  Its and incredible chat client that easily synced with my   Google Talk account (the only Windows chat client I am willing to use).</p>
<p>However my favorite application so far has been <a href="http://www.linkinus.com/">Linkinus</a>.  That program has completely revolutionized IRC for me.  Chatting in Linkinus is just fun.  Its a work in progress and I plan to help out with the development.  I am working on scripts, which require me to learn AppleScript, but it is worth it.</p>
<p>A worthy app to mention is <a href="http://growl.info/">Growl</a>.  You don&#8217;t realize how useful a standard messaging system is until you have used one.  Almost every application I have can interface into Growl and therefore I have awesome standard notifications.  Just typing this I got a notification that someone logged on Adium!! brb.</p>
<p>Looking for a really nice free RSS reader?  Check out <a href="http://www.newsgator.com/Individuals/NetNewsWire/Default.aspx">NetNewsWire Lite</a>!  RSS is fundamental when you are as busy as I am (which I expect you are).  Have your news come to you, and link yourself back if you deem the article worthy of a visit.  Most of the time I read it all in the RSS reader to save even more time.  I sift through about 100 RSS articles each day, some are duplicates and many are short but I&#8217;d say that there are at least 5 full articles that I will read.  They come from blogs and news sources alike, I currently subscribe to over 70 different feeds.</p>
<p>Common apps like iTunes and Firefox are obvious must haves.  Although I will admit that I am interested in safari and I will likely give it a try for just common browsing (as it lacks many of the web development plugins that I have in Firefox).  Photo Booth makes excellent use of the built in web cam aptly named the iSight that comes equipped on every MacBook Pro laptop.  My recently engaged sister and said counter-part were kind enough to sit in front of my Mac for some pictures in Photo Booth.  Half an hour later I was able to find a few serious pictures and I sifted thru another 30 or so pictures with various effects to get a group of pictures to put on my family website.</p>
<p>Now the beta apps.  I am excited to try out <a href="http://extendmac.com/flow/privatebeta/">Flow</a> and I was able to sign up for the private beta, however I have not gotten any response yet.  I did meet a nice contact chatting on Linkinus and got ahold of a the <a href="http://plasq.com/skitch">Skitch</a> beta.  Now Skitch is a really cool tool.  I can take a picture of a section on my screen, add some quick features like (text, arrows, etc.) in seconds.  That is impressive coming from the mspaint.exe experience, however it is not nearly Skitch&#8217;s coolest point.  There is a drag and drop portion on the bottom of the app to allow you to quickly make a file in the most common picture formats (png, jpg, gif&#8230;).  To top things off when you sign up for a Skitch account you are given a profile online.  A single button on Skitch uploads the image to your Skitch site storage.  That same button can then take you directly to the online image, some more single click buttons will copy the image location or xhtml compatible code and allow you to share the image with anyone in the world.  You will be able to do all of this just by watching the 3 minute video included with the download.  Skitch is a fantastic app!  I&#8217;ve got some invites if anyone is really interested I might give one away.</p>
<p>Being a web developer its useful to have a local web server to test your work on.  Although I manually installed everything I need to do Ruby on Rails development (ruby, rubygems, mysql, mongrel, and svn) I also downloaded a nice app to make things easy for myself.  <a href="http://www.mamp.info/en/index.php">MAMP</a> stands for Macintosh, Apache, Mysql and PHP and it is just plain simple.  MAMP (like Easy PHP for Windows) is a completely isolated webserver with php and mysql.  You can be sure that nothing else on your computer will be affected, for instance if you have another mysql database running.  A great dashboard that even has phpMyAdmin.  I made a few modifications to the default pages to add a quicklink to quickly accesses my web directories, but MAMP&#8217;s ease of use is much appreciated.  A simple click to turn on/off&#8230; what more would I want?</p>
<p><a href="http://www.srs-store.com/store-plugins/mall/iwow-plugin.asp">SRS iWoW</a> is an iTunes plugin that adds Three-Dimensional sound.  I got it with the plugin but it a very cool plugin.  Its enhancements to iTunes&#8217; sound are immediately noticeable and gratifying.  Simple to setup and customize you can have some real high quality sound.  To be honest you won&#8217;t notice the difference until you try it, but once you do you will gasp at the difference.</p>
<p>I have a bunch more that I can write but I am going to finish now and hopefully finish working on my other website so that I can launch it!  Goodbye for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bogojoker.com/2007/07/my-macbook-pro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

