<?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>Wazi &#187; Eric Weidner</title>
	<atom:link href="http://olex.openlogic.com/wazi/author/ericweidner/feed/" rel="self" type="application/rss+xml" />
	<link>http://olex.openlogic.com/wazi</link>
	<description>Thinking OPEN</description>
	<lastBuildDate>Fri, 06 Nov 2009 19:33:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making Your Shell Scripts Run From Anywhere</title>
		<link>http://olex.openlogic.com/wazi/2009/making-your-shell-scripts-run-from-anywhere/</link>
		<comments>http://olex.openlogic.com/wazi/2009/making-your-shell-scripts-run-from-anywhere/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 20:21:20 +0000</pubDate>
		<dc:creator>Eric Weidner</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[gnu-bash]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=1255</guid>
		<description><![CDATA[How many times have you had to go to a specific directory to launch an application or set several environment variables for an application to be able to find itself and run?  Well, here's a simple trick to add to your shell scripts so that they're self-contained with no external requirements or editing.]]></description>
			<content:encoded><![CDATA[<h3>Issue</h3>
<p>How many times have you had to go to a specific directory to launch an application or set several environment variables for an application to be able to find itself and run?  Well, here&#8217;s a simple trick to add to your shell scripts so that they&#8217;re self-contained with no external requirements or editing.</p>
<h3>Trick</h3>
<p>Put the following code in the top of your scripts and they&#8217;ll set your working directory to the directory in which the script actually resides.  This way, you&#8217;ll have a known base directory from which to call any other commands.  This also makes your launch scripts portable to other systems and directory structures without having to edit them to set a new directory or add new environment variables.</p>
<p><strong>For *nix platforms:</strong> (this works in sh and bash)</p>
<pre>#Get the fully qualified path to the script
 case $0 in
     /*)
         SCRIPT="$0"
         ;;
     *)
         PWD=`pwd`
         SCRIPT="$PWD/$0"
         ;;
 esac
 # Resolve the true real path without any sym links.
 CHANGED=true
 while [ "X$CHANGED" != "X" ]
 do
     # Change spaces to ":" so the tokens can be parsed.
     SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
     # Get the real path to this script, resolving any symbolic links
     TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'`
     REALPATH=
     for C in $TOKENS; do
         REALPATH="$REALPATH/$C"
         while [ -h "$REALPATH" ] ; do
             LS="`ls -ld "$REALPATH"`"
             LINK="`expr "$LS" : '.*-&gt; (.*)$'`"
             if expr "$LINK" : '/.*' &gt; /dev/null; then
                 REALPATH="$LINK"
             else
                 REALPATH="`dirname "$REALPATH"`""/$LINK"
             fi
         done
     done
     if [ "$REALPATH" = "$SCRIPT" ]
     then
         CHANGED=""
     else
        SCRIPT="$REALPATH"
     fi
done
# Change ":" chars back to spaces.
REALPATH=`echo $REALPATH | sed -e 's;:; ;g'`
# Change the current directory to the location of the script
cd "`dirname "$REALPATH"`"</pre>
<p><strong>For Windows platforms:</strong></p>
<p>Surprisingly, for Windows DOS there&#8217;s a much easier way to do this — just add the following to the top of your batch file.</p>
<pre>cd %~dp0%</pre>
<p>Happy scripting!</p>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2009/making-your-shell-scripts-run-from-anywhere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Multiple Firefox Versions Side-by-Side</title>
		<link>http://olex.openlogic.com/wazi/2008/running-multiple-firefox-versions-side-by-side/</link>
		<comments>http://olex.openlogic.com/wazi/2008/running-multiple-firefox-versions-side-by-side/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 18:35:58 +0000</pubDate>
		<dc:creator>Eric Weidner</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=1253</guid>
		<description><![CDATA[Often developers need to test multiple browsers during development to test for browser compatibility or to use a different version of the browser because a needed plugin only works on an older version.  Firefox offers some handy options to run several versions side-by-side.]]></description>
			<content:encoded><![CDATA[<h3>Issue</h3>
<p>Often during development, developers need to run multiple browsers simultaneously. They might be testing for browser compatibility, or need a plugin that only works on a older version. Whatever your situation, here are some handy options for running several versions of Firefox side-by-side.</p>
<h3>Trick</h3>
<p>To run multiple versions of Firefox side-by-side, launch Firefox with the following options.  You can accomplish this with a shortcut on Windows or a panel launcher on Gnome on Linux.</p>
<p>My Ubuntu default Firefox:</p>
<pre>firefox --no-remote -P default %u

<a href="http://olex.openlogic.com/wazi/wp-content/uploads/2008/11/firefox_side_by_side_tip-firefox_default.png"><img class="alignnone size-medium wp-image-1259" title="firefox_side_by_side_tip-firefox_default" src="http://olex.openlogic.com/wazi/wp-content/uploads/2008/11/firefox_side_by_side_tip-firefox_default-300x132.png" alt="" width="300" height="132" /></a></pre>
<p><strong>Other shortcuts to run other versions simultaneously&#8230;</strong></p>
<p>Testing FF 3.1 with my main profile:</p>
<pre>/home/eric/programs/firefox-3.1b1/firefox --no-remote -P default %u</pre>
<p>Side-By-Side FF 3.1:</p>
<pre>/home/eric/programs/firefox-3.1b1/firefox --no-remote -P ff31b1

<a href="http://olex.openlogic.com/wazi/wp-content/uploads/2008/11/firefox_side_by_side_tip-firefox_31b1.png"><img class="alignnone size-medium wp-image-1260" title="firefox_side_by_side_tip-firefox_31b1" src="http://olex.openlogic.com/wazi/wp-content/uploads/2008/11/firefox_side_by_side_tip-firefox_31b1-300x132.png" alt="" width="300" height="132" /></a></pre>
<p>Side-By-Side FF 2.0.0.16:</p>
<pre>/home/eric/programs/firefox-2.0.0.16/firefox --no-remote -P ff20016</pre>
<p>Side-By-Side FF 2 for running Firewatir (at the time, Firewatir/JSSH would not run in FF 3):</p>
<pre>/home/eric/programs/firefox-2.0.0.16/firefox --no-remote -jssh -P firewatir</pre>
<p>If the profile (-P) is not already there, the Firefox profile box will start.  Create a profile with the name specified by the -P option.</p>
<p>It&#8217;s probably best to not tell your new Firefox to be the default unless you are really sure you want it to be as it may affect your installed plugins and themes.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2008/running-multiple-firefox-versions-side-by-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
