<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.ideaexcursion.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>Idea Excursion</title>

<link>http://www.ideaexcursion.com</link>
<description>Technology Musings</description>
<lastBuildDate>Thu, 26 Apr 2012 20:06:35 +0000</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=3.3.2</generator>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.ideaexcursion.com/IdeaExcursion" /><feedburner:info uri="ideaexcursion" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://www.ideaexcursion.com/?pushpress=hub" /><item>
<title>Automated SQL Server deployments with Windows batch files</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/nHkQdtayyLQ/</link>
<comments>http://www.ideaexcursion.com/2012/02/15/automated-sql-server-deployments-with-windows-batch-files/#comments</comments>
<pubDate>Wed, 15 Feb 2012 17:01:34 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[SQL Server]]>
</category>
<category>
<![CDATA[Windows]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1617</guid>
<description>
<![CDATA[Why Windows batch files? The lack of eternal dependencies and being easily understood are nice, but the hands-down best reason is simplicity.]]>
</description>
<content:encoded><![CDATA[
<h2>Why Windows batch files?</h2>
<p>With so many tools available today to support continuous integration and deployment automation, why choose batch files? Why not—at the very least—leverage PowerShell? It all boils down to simplicity. Batch files are easily understood because there is an incredibly low barrier to entry. There are no external dependencies to bundle in because all necessary tools have been built into Windows/DOS for 20+ years; this pedigree means that most technology workers have at least a rudimentary understanding of the language or can pick it up quickly.<br />
<span id="more-1617"></span><br />
Dedicated tools like Apache Ant exist, but they largely focus on traditional code deployments, such as .NET, PHP, Python, etc.  However, database code tends to be an entirely different beast. Traditional code is generally self-contained into a series of scripts or binaries and can be replaced in whole; however, in database land some objects (such as tables!) need special logic to ensure the integrity of the data. Most items, such as views and stored procedures can be handled with a simple IF EXISTS / DROP/ CREATE replacement structure. With tables, we want to check IF [NOT] EXISTS / ALTER. Additionally, DBAs generally approach changes with a “least required” attitude. Only make changes which are absolutely necessary. To that end, some diligence is required on the part of the developer to ensure code is re-runable. I suggest a “three times” rule. All proposed changes should be evaluated after one, two, and three deployments to help ensure no unintended side effects crop up. To fix bugs, it’s best to contain changes in a single file per object or logical data change. This may vary by project.</p>
<h2>The Code</h2>
<p>That’s the theory. <a title="Deployment Example Bundle" href="http://static.ideaexcursion.com/wp-content/uploads/2012/02/DeploymentTest.zip">Here’s the substance</a> [zip download] supporting automated database deployments with batch files:</p>
<ul>
<li>ReleaseName folder
<ul>
<li>Utilities (such as <a href="http://msftasprodsamples.codeplex.com/">ascmd</a>)</li>
<li>_Utility.bat file which controls deployment flow</li>
<li>Environment-specific variable batch files (i.e. DEV.bat, QA.bat, PROD.bat)</li>
<li>IssueNumber folder
<ul>
<li>_Installer.bat (Containing the installation instructions)</li>
<li>Supporting files (such as SupportingScript.sql and Supporting Package.dtsx)</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Deploy an issue by calling the environment batch file with issue folder as first parameter. For example:<br />
DEV.bat &#8220;C:\Issues\IssueNum1&#8243; or PROD.bat &#8220;C:\Issues\IssueNum7&#8243;. Alternatively, drag &amp; drop the issue folder on to the target environment. This approach allows you to string together large deployments by putting all the environment calls in a wrapper batch file. Also, give you the flexibility of deploying issues to multiple environments quickly (i.e. TEST and QA).</p>
<h2>Advantages</h2>
<ul>
<li>Streamlining (automating!) deployment by removing manual intervention and avoiding code duplication</li>
<li>Issue-specific _Installer.bat requires no scaffolding—which means nothing to forget</li>
<li>Environment parameters file requires only a single callout. If this is forgotten, there are no unexpected side-effects—the installation simply won’t run</li>
<li>Deployment engineers can validate target issue &amp; environment before continuing and can observe output for validation</li>
<li>Working up the correct command-line syntax can be difficult
<ul>
<li>Mitigate by providing pre-defined examples</li>
<li>Could evaluate using helper functions to streamline</li>
<li>Passing variables to sqlcmd on the command line looks messy</li>
<li>Using sqlcmd variable substitution in scripts makes them unusable when run standalone
<ul>
<li>Mitigate by assigning value to variable in script header, making it easy to locate and change when running standalone</li>
<li>Can’t always easily do, i.e. specifying @command for msdbo.dbo.sp_add_jobstep. Would require re-woring script to build string in header then pass completed string to @command. Slight amount of overhead.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>Drawbacks</h2>
<ul>
<li>Working up the correct command-line syntax can be difficult
<ul>
<li>Mitigate by providing pre-defined examples</li>
<li>Could evaluate using helper functions to streamline</li>
<li>Passing variables to sqlcmd on the command line looks messy</li>
</ul>
</li>
<li>Using sqlcmd variable substitution in scripts makes them unusable when run standalone
<ul>
<li>Mitigate by assigning value to variable in script header, making it easy to locate and change when running standalone</li>
<li>Can’t always easily do, i.e. specifying @command for msdbo.dbo.sp_add_jobstep. Would require re-woring script to build string in header then pass completed string to @command. Slight amount of overhead.</li>
</ul>
</li>
</ul>


<p><a href="http://feedads.g.doubleclick.net/~a/Hmc-EMaS3vJbvgjzy16WOYoRDSg/0/da"><img src="http://feedads.g.doubleclick.net/~a/Hmc-EMaS3vJbvgjzy16WOYoRDSg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Hmc-EMaS3vJbvgjzy16WOYoRDSg/1/da"><img src="http://feedads.g.doubleclick.net/~a/Hmc-EMaS3vJbvgjzy16WOYoRDSg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/nHkQdtayyLQ" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2012/02/15/automated-sql-server-deployments-with-windows-batch-files/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2012/02/15/automated-sql-server-deployments-with-windows-batch-files/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=automated-sql-server-deployments-with-windows-batch-files</feedburner:origLink></item>
<item>
<title>Stop SOPA</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/SKOrd50ZeCE/</link>
<comments>http://www.ideaexcursion.com/2012/01/18/stop-sopa/#comments</comments>
<pubDate>Wed, 18 Jan 2012 16:19:52 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[Uncategorized]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1609</guid>
<description>
<![CDATA[A public domain letter to my representatives about why SOPA and copyright extension is wrong.]]>
</description>
<content:encoded><![CDATA[
<p>On this day of voluntary internet blackout to protest PIPA/SOPA legislation, I felt compelled to write my representatives and share those thoughts with everyone, to reuse freely without permission. In other words, I&#8217;m offering up the following text for public domain. Do with it what you please:</p>
<blockquote><p>Dear Representative,</p>
<p>As you&#8217;re undoubtedly aware, today many websites across the internet are taking up a &#8220;Stop SOPA&#8221; campaign in which many voluntarily refuse access to visitors to simulate the results of passing of PIPA/SOPA in its current form.</p>
<p>As a <a href="http://www.taylorgerring.com">Software Engineer</a> by trade, and <a href="http://www.ideaexcursion.com">writer</a> &amp; <a href="http://www.flickr.com/photos/taylorgerring">photographer</a> in hobby, I understand and appreciate the need for copyright laws. However, as a citizen of Chicago, Illinois, United States of America, I also understand that the copyright law now represents the interests of mega-corporations instead of the common man.</p>
<p>Not only do I support the strikedown of SOPA-like legislation, so too do I support the reversal of the copyright extensions that companies have long lobbied for. It is with great irony that content producers who use public domain works to produce a derivative work (such as classical music in old Disney cartoons) work to battle the realization of old works entering the public domain after a sufficient length of copyright.</p>
<p>How better can an American contribute to the general welfare of society than contribute their intellectual property when they no longer can benefit from it? To place untenable limits on such actions is to legislate against 313 million Americans, just as passing SOPA to allow the take-down of whole internet sites without notice or due process is unfathomable.</p>
<p>Stop SOPA. Repeal unreasonable copyright extension.</p>
<p>Sincerely,</p>
<p>Taylor Gerring</p></blockquote>
<p><span id="more-1609"></span></p>
<p xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#" style="border: 1px solid black; text-align: center;">
  <a rel="license" href="http://creativecommons.org/publicdomain/zero/1.0/"><br />
    <img src="http://i.creativecommons.org/p/zero/1.0/88x31.png" style="border-style: none;" alt="CC0" /><br />
  </a><br />
  To the extent possible under law, <a rel="dct:publisher" href="http://www.taylorgerring.com">  <span property="dct:title">Taylor Gerring</span></a> has waived all copyright and related or neighboring rights to <a href="http://www.ideaexcursion.com/2012/01/18/stop-sopa/" title="Stop SOPA"><span property="dct:title">Stop SOPA</span></a>.<br />
This work is published from: <span property="vcard:Country" datatype="dct:ISO3166" content="US" about="http://www.ideaexcursion.com"> United States</span>.</p>


<p><a href="http://feedads.g.doubleclick.net/~a/Ok-QEUNhInqFCl4pf1pHEfxdDTA/0/da"><img src="http://feedads.g.doubleclick.net/~a/Ok-QEUNhInqFCl4pf1pHEfxdDTA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Ok-QEUNhInqFCl4pf1pHEfxdDTA/1/da"><img src="http://feedads.g.doubleclick.net/~a/Ok-QEUNhInqFCl4pf1pHEfxdDTA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/SKOrd50ZeCE" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2012/01/18/stop-sopa/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2012/01/18/stop-sopa/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=stop-sopa</feedburner:origLink></item>
<item>
<title>Access system date in SSIS without a Script Task</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/Z3OtLMMO7y0/</link>
<comments>http://www.ideaexcursion.com/2011/09/28/access-system-date-within-ssis-without-a-script-task/#comments</comments>
<pubDate>Wed, 28 Sep 2011 18:53:26 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[SSIS]]>
</category>
<category>
<![CDATA[T-SQL]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1590</guid>
<description>
<![CDATA[Set variables to contain the package start datetime with the time truncated, making it easier to compare dates directly.]]>
</description>
<content:encoded><![CDATA[
<p>In the world of <abbr title="Extract Transform Load">ETL</abbr>, it&#8217;s quite common to need to know the current date, especially without the time component. Because Script Tasks allows us to code up anything in .NET, it should be fairly obvious how to generate and expose the current date. for example:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">Dts<span style="color: #008000;">.</span><span style="color: #0000FF;">Variables</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;TheCurrentDate&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">Date</span><span style="color: #008000;">;</span></pre></div></div>

<p>That little snippet of code will store the current date into a variable named &#8220;TheCurrentDate&#8221;. This is straightforward and there&#8217;s absolutely nothing wrong with the approach, however, there&#8217;s a simpler way to fetch this information without the need of adding a whole control flow item for such a minute amount of work. It&#8217;s brilliantly simple, only requires the creation of a variable, and can be added in about 10 seconds:<br />
<span id="more-1590"></span></p>
<ol>
<li>Create new variable with Data Type = DateTime</li>
<ol>
<li>Set property EvaluateAsExpression = True</li>
<li>Set property Expression =

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">DATEADD( <span style="color: #800000;">&quot;day&quot;</span>, DATEDIFF( <span style="color: #800000;">&quot;day&quot;</span>, (DT_DATE) <span style="color: #800000;">&quot;1900-01-01&quot;</span>, @[System::StartTime]  ) , (DT_DATE) <span style="color: #800000;">&quot;1900-01-01&quot;</span> )</pre></div></div>

</li>
</ol>
</ol>
<p>That&#8217;s it! The variable will contain the package start time with the time truncated, making it easier to compare dates directly. In fact, this method can be used to truncate the time portion of any DateTime Data Type. Simply replace @[System::StartTime] with another variable.</p>
<p>Want to know how it works? The inner DATEDIFF() function calculates the number of days since 1900. This value is supplied to the outer DATEADD() function, adding days forward from 1900, resulting in a DT_DBTIMESTAMP with the time rounded off. And we accomplished it with pure math—no messy string manipulation required! I borrowed the idea from the same expression in T-SQL: DATEADD(day, DATEDIFF(day, 0, getdate()), 0).</p>
<p>There&#8217;s one caveat to this: Because SSIS doesn&#8217;t have a native date-only variable type, the value technically contains the date at midnight. However, many tools—such as SQL Server—will implicitly convert to the requisite data type, making &#8220;2011-09-28 12:00:00 AM&#8221; equal to &#8220;2011-09-28&#8243;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>


<p><a href="http://feedads.g.doubleclick.net/~a/dRb-SvuNClgAX9QJTaZXEzjKo-c/0/da"><img src="http://feedads.g.doubleclick.net/~a/dRb-SvuNClgAX9QJTaZXEzjKo-c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dRb-SvuNClgAX9QJTaZXEzjKo-c/1/da"><img src="http://feedads.g.doubleclick.net/~a/dRb-SvuNClgAX9QJTaZXEzjKo-c/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/Z3OtLMMO7y0" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2011/09/28/access-system-date-within-ssis-without-a-script-task/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2011/09/28/access-system-date-within-ssis-without-a-script-task/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=access-system-date-within-ssis-without-a-script-task</feedburner:origLink></item>
<item>
<title>Connecting to Oracle with SSIS 2008</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/ZjKleo-30uQ/</link>
<comments>http://www.ideaexcursion.com/2011/09/07/connecting-to-oracle-with-ssis-2008/#comments</comments>
<pubDate>Wed, 07 Sep 2011 21:44:22 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[SSIS]]>
</category>
<category>
<![CDATA[Oracle]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1571</guid>
<description>
<![CDATA[Quickly configure a connection from SSIS to Oracle, optionally without TNSNAMES.ora, using the free Attunity Connector provided by Microsoft.]]>
</description>
<content:encoded><![CDATA[
<p>This isn&#8217;t my first adventure in connecting to Oracle from SQL Server. No, in fact, I wrote <a title="Connecting to Oracle from SQL Server" href="http://www.ideaexcursion.com/2009/01/05/connecting-to-oracle-from-sql-server/">a guide on that very topic</a> nearly 3 years ago. Unfortunately—as a technologist, but fortunately as a blogger—the times change as does the method for setting up the configuration. On the plus side, I&#8217;m much more confident in the setup and am convinced that it&#8217;s easier than ever to connect SSIS to Oracle. Without further adieu, let&#8217;s get started by downloading and installing a couple of necessary components:<br />
<span id="more-1571"></span></p>
<ul>
<li><a title="Microsoft Connectors Version 1.1 for Oracle and Teradata by Attunity" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6732934c-2eea-4a7f-85a8-8ba102e6b631">Attunity SSIS Oracle Connector v1.1</a></li>
<ul>
<li>After installation, you’ll need to enable the menu items in the Data Flow Source &amp; Destination</li>
<ul>
<li>Create Data Flow Task</li>
<li>Switch to Data Flow</li>
<li>Pull the Toolbox out</li>
<li>Right-click&rarr;Choose items…</li>
<li>Activate the SSIS Data Flow Items tab</li>
<li>Enable &#8220;Oracle Destination&#8221; and &#8220;Oracle Source&#8221;</li>
</ul>
</ul>
<li><a title="Oracle Database Instant Client" href="http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html">Oracle Instant Client</a> Basic package</li>
<ul>
<li>Download and extract both 64-bit and 32-bit versions if you’re using a 64-bit OS</li>
<ul>
<li>Only need the 32-bit version if installing on 32-bit OS</li>
</ul>
<li>Installation location is up to you, but you’ll need to note it later. This tutorial assumes C:\oracle\ as the base location.</li>
<ul>
<li>For example, install the 64-bit package at &#8220;C:\oracle\instantclient_x64_11_2&#8243; and the 32-bit package at &#8220;C:\oracle\instantclient_x86_11_2&#8243;</li>
</ul>
</ul>
</ul>
<p>Once you have all the items installed, you’ll need to add a couple of registry keys with regedit so that the SSIS connector can find the Oracle Instant Client. Create the necessary keys and string values below where they don’t exist, updating files paths to point to where you extracted the items above (again, C:\oracle\ is assumed for this tutorial):</p>
<ul>
<li> [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]</li>
<ul>
<li>New&rarr;String Value&rarr;Name = TNS_ADMIN&rarr;Value = C:\oracle\tnsnames.ora</li>
<li>New&rarr;String Value&rarr;Name = ORACLE_HOME&rarr;Value</li>
<ul>
<li>For 64-bit OS: C:\oracle\instantclient_x64_11_2</li>
<li>For 32-bit OS: C:\oracle\instantclient_x32_11_2</li>
</ul>
</ul>
<li>[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE] <strong>(64-bit OS only)</strong></li>
<ul>
<li>New&rarr;String Value&rarr;Name = TNS_ADMIN&rarr;Value = C:\oracle\tnsnames.ora</li>
<li>New&rarr;String Value&rarr;Name = ORACLE_HOME&rarr;Value = C:\oracle\instantclient_x86_11_2</li>
</ul>
</ul>
<div>
<p>If you prefer, simply save the following text as a file with extension .reg and run it.</p>
<p><strong>64-bit OS:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">Windows Registry Editor Version 5.00
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE]
&quot;TNS_ADMIN&quot;=&quot;C:\\oracle\\tnsnames.ora&quot;
&quot;ORACLE_HOME&quot;=&quot;C:\\oracle\\instantclient_x32_11_2&quot;
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
&quot;TNS_ADMIN&quot;=&quot;C:\\oracle\\tnsnames.ora&quot;
&quot;ORACLE_HOME&quot;=&quot;C:\\oracle\\instantclient_x64_11_2&quot;</pre></div></div>

<p><strong>32-bit OS:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">Windows Registry Editor Version 5.00
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
&quot;TNS_ADMIN&quot;=&quot;C:\\oracle\\tnsnames.ora&quot;
&quot;ORACLE_HOME&quot;=&quot;C:\\oracle\\instantclient_x32_11_2&quot;</pre></div></div>

</div>
<p>This setup allows you the choice of either using the names defined in TNSNAMES.ORA at the location specified in the registry above OR specifying the server inline in the format of &lt;server.name.trb:port/service&gt;. For example: &lt;servername.path.to.tld:1521/ORA10DEV&gt; (without the angle brackets). That&#8217;s really it! The process is much more streamlined than it was just a short while ago. Two installations and a couple regedit tweaks and you should be all set!</p>


<p><a href="http://feedads.g.doubleclick.net/~a/DVML1nyBq_iwQb3c8BIkhhW1HXw/0/da"><img src="http://feedads.g.doubleclick.net/~a/DVML1nyBq_iwQb3c8BIkhhW1HXw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DVML1nyBq_iwQb3c8BIkhhW1HXw/1/da"><img src="http://feedads.g.doubleclick.net/~a/DVML1nyBq_iwQb3c8BIkhhW1HXw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/ZjKleo-30uQ" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2011/09/07/connecting-to-oracle-with-ssis-2008/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2011/09/07/connecting-to-oracle-with-ssis-2008/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=connecting-to-oracle-with-ssis-2008</feedburner:origLink></item>
<item>
<title>Set Permissions Across SQL Server Database Instances</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/WddIWuHPdes/</link>
<comments>http://www.ideaexcursion.com/2011/05/31/setting-user-permissions-across-database-instances/#comments</comments>
<pubDate>Tue, 31 May 2011 20:35:17 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[SQL Server]]>
</category>
<category>
<![CDATA[T-SQL]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1567</guid>
<description>
<![CDATA[Code to streamline adding and fixing roles for users, groups, and principals across multiple databases on a single SQL Server instance.]]>
</description>
<content:encoded><![CDATA[
<p>As a followup to my post on <a title="SQL Server Principals &amp; Roles Permission Audit" href="http://www.ideaexcursion.com/2011/04/11/sql-server-principals-roles-permission-audit/">SQL Server Principals &amp; Roles Permission Audit</a>, it&#8217;s completely expected that you may want to act on the results of that audit. Specifically, let&#8217;s say you want to organize users into groups and enforce group permissions across the instance. In a particular scenario at my company, we are constantly refreshing databases down from production, which has a nasty side-effect of destroying the finely-tuned permissions we&#8217;ve carefully set in place. What made the most sense to reduce the friction this would cause was to reset the permissions via a job. This allows us to schedule it nightly, fixing any broken permissions, but also makes it easy to fire on demand, should needs dictate. Of course, it would be easiest if this were all contained in a stored procedure, but how do we juggle all these users and groups when you&#8217;re hosting 50 databases?</p>
<p>What made sense for us was to be able to supply the name of a principal, a &#8220;like name&#8221; for the database, and the role that they should have. What the &#8220;like name&#8221; allows us to do is apply a permission to a series of databases based on name. For example: ideaexcursion1, ideaexcursion2, ideaexcursion3 can all be set by supplying the paramater ideaexcursion%. This increases the complexity by forcing us to use a cursor in the proc, but reduces the number of actions we need to manage.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">exec</span> dbo.<span style="color: #202020;">pr_SetGroupPermissions</span>
      @principal <span style="color: #808080;">=</span> <span style="color: #FF0000;">'domain\principalname'</span>
    , @db_likename <span style="color: #FF0000;">'ideaexcursion%'</span>
    , @addrole <span style="color: #FF0000;">'db_owner'</span></pre></div></div>

<p><span id="more-1567"></span><br />
This snippet will—as you&#8217;ll soon see—give domain\principalname the db_owner role in any databases that match LIKE ideaexcursion%. Here&#8217;s the magic behind the stored procedure:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">create</span> <span style="color: #0000FF;">proc</span> dbo.<span style="color: #202020;">pr_SetGroupPermissions</span> @principal sysname, @db_likename sysname, @addrole sysname, @printonly <span style="color: #0000FF;">bit</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
<span style="color: #0000FF;">as</span>
<span style="color: #0000FF;">declare</span>
          @<span style="color: #0000FF;">database</span> sysname
        , @cmd <span style="color: #0000FF;">nvarchar</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">max</span><span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">declare</span> csr_dbname <span style="color: #0000FF;">cursor</span> <span style="color: #0000FF;">for</span>
<span style="color: #0000FF;">select</span> name <span style="color: #0000FF;">from</span> sys.<span style="color: #202020;">databases</span> <span style="color: #0000FF;">where</span> <span style="color: #0000FF;">state</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span> and name like @db_likename
&nbsp;
<span style="color: #0000FF;">open</span> csr_dbname
&nbsp;
<span style="color: #0000FF;">fetch</span> <span style="color: #0000FF;">next</span> <span style="color: #0000FF;">from</span> csr_dbname
<span style="color: #0000FF;">into</span> @<span style="color: #0000FF;">database</span>
&nbsp;
<span style="color: #0000FF;">while</span> <span style="color: #FF00FF;">@@fetch_status</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
<span style="color: #0000FF;">begin</span>
&nbsp;
        <span style="color: #0000FF;">set</span> @cmd <span style="color: #808080;">=</span> <span style="color: #FF0000;">'
USE '</span><span style="color: #808080;">+</span><span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>@<span style="color: #0000FF;">database</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">+</span><span style="color: #FF0000;">'
&nbsp;
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'</span><span style="color: #FF0000;">''</span><span style="color: #808080;">+</span>@principal<span style="color: #808080;">+</span><span style="color: #FF0000;">''</span><span style="color: #FF0000;">')
BEGIN
        IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'</span><span style="color: #FF0000;">''</span><span style="color: #808080;">+</span>@principal<span style="color: #808080;">+</span><span style="color: #FF0000;">''</span><span style="color: #FF0000;">')
                CREATE USER '</span><span style="color: #808080;">+</span><span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>@principal<span style="color: #808080;">&#41;</span><span style="color: #808080;">+</span><span style="color: #FF0000;">' FOR LOGIN '</span><span style="color: #808080;">+</span><span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>@principal<span style="color: #808080;">&#41;</span><span style="color: #808080;">+</span><span style="color: #FF0000;">'
        ELSE
                ALTER USER '</span><span style="color: #808080;">+</span><span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>@principal<span style="color: #808080;">&#41;</span><span style="color: #808080;">+</span><span style="color: #FF0000;">' WITH LOGIN = '</span><span style="color: #808080;">+</span><span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>@principal<span style="color: #808080;">&#41;</span><span style="color: #808080;">+</span><span style="color: #FF0000;">'
&nbsp;
        EXEC dbo.sp_addrolemember N'</span><span style="color: #FF0000;">''</span><span style="color: #808080;">+</span>@addrole<span style="color: #808080;">+</span><span style="color: #FF0000;">''</span><span style="color: #FF0000;">', N'</span><span style="color: #FF0000;">''</span><span style="color: #808080;">+</span>@principal<span style="color: #808080;">+</span><span style="color: #FF0000;">''</span><span style="color: #FF0000;">'
END
'</span>
&nbsp;
        <span style="color: #0000FF;">print</span> @cmd
        <span style="color: #0000FF;">if</span> @printonly <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
                <span style="color: #0000FF;">exec</span><span style="color: #808080;">&#40;</span>@cmd<span style="color: #808080;">&#41;</span>
&nbsp;
        <span style="color: #0000FF;">fetch</span> <span style="color: #0000FF;">next</span> <span style="color: #0000FF;">from</span> csr_dbname
        <span style="color: #0000FF;">into</span> @<span style="color: #0000FF;">database</span>
&nbsp;
<span style="color: #0000FF;">end</span>
&nbsp;
<span style="color: #0000FF;">close</span> csr_dbname
<span style="color: #0000FF;">deallocate</span> csr_dbname</pre></td></tr></table></div>

<p>And here&#8217;s a few notes on what the code does:</p>
<ul>
<li>Line 1: Parameter declaration. Notice that there is an optional @printonly param if you&#8217;d like to see the resulting code, but not execute it</li>
<li>Line 7-8: Set up the cursor. On line 8 is the trick that allows us to use a &#8220;like name&#8221; to simplify the rules. Also, note that we check for &#8220;state = 0&#8243; in the predicate, which corresponds to those with a state of ONLINE. If we didn&#8217;t check this, we would potentially attempt to execute commands against databases in RESTORING, RECOVERING, RECOVERY_PENDING, SUSPECT, EMERGENCY, or OFFLINE states</li>
<li>Line 18-30: The main code which will be evaluated and executed. There are several parts to it to accommodate a variety of situations:
<ul>
<li>Line 19: Switch context to the correct database, since we&#8217;re executing within the confides of dynamic SQL. Also, the name is qualified with quotename(), which means that it should not be qualified when being passed in</li>
<li>Line 21: Validate that the user or group exists, otherwise we will get an error when trying to set it. Since we&#8217;re concerning ourselves with permission to a database, and not an instance, we don&#8217;t bother creating a user if it doesn&#8217;t exist. This is probably smart from a security perspective</li>
<li>Line 23-24: Check if the principal exists within the specific database. If not, create the user</li>
<li>Line 26: If the user already exists, fix any mismatched SIDswith ALTER USER. This is the preferred way to fix mismatched a mismatched SIDwhich was previously handled by sp_change_users_login, which has since been deprecated</li>
<li>Line 28: Assume database login is not valid and add the user or group to the specified role</li>
</ul>
</li>
<li>Line 32:  Always print the commands to be executed</li>
<li>Line 33-34: Execute the code, unless the @printonly parameter has been specified</li>
</ul>
<p>There you have it. A proc that grants specific roles to a principal across your entire database instance.</p>


<p><a href="http://feedads.g.doubleclick.net/~a/29oMBZWLhUb2BETh1SGKJDEaa-0/0/da"><img src="http://feedads.g.doubleclick.net/~a/29oMBZWLhUb2BETh1SGKJDEaa-0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/29oMBZWLhUb2BETh1SGKJDEaa-0/1/da"><img src="http://feedads.g.doubleclick.net/~a/29oMBZWLhUb2BETh1SGKJDEaa-0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/WddIWuHPdes" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2011/05/31/setting-user-permissions-across-database-instances/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2011/05/31/setting-user-permissions-across-database-instances/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=setting-user-permissions-across-database-instances</feedburner:origLink></item>
<item>
<title>SQL Server Principals &amp; Roles Permission Audit</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/xd-qzGQRJpQ/</link>
<comments>http://www.ideaexcursion.com/2011/04/11/sql-server-principals-roles-permission-audit/#comments</comments>
<pubDate>Mon, 11 Apr 2011 20:50:06 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[SQL Server]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1561</guid>
<description>
<![CDATA[If you largely manage users by way of roles, SQL exposes this relationship in a single view, which can produce a report of what principal is part of what role.]]>
</description>
<content:encoded><![CDATA[
<p>Thanks to the expansion of catalog views in SQL Server 2005, managing users and permissions has become much easier. Specifically, if you largely manage users by way of roles, rather than per-object permissions, SQL exposes this relationship in a single view, which can produce a report of what principal is part of what role. Check out the query:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">select</span> <span style="color: #FF00FF;">db_name</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&#91;</span>database_name<span style="color: #808080;">&#93;</span>
        , dbpm.<span style="color: #202020;">name</span>, dbpm.<span style="color: #202020;">type_desc</span>, dbpm.<span style="color: #202020;">create_date</span>, dbpm.<span style="color: #202020;">modify_date</span>
        , dbpr.<span style="color: #202020;">name</span>, dbpr.<span style="color: #202020;">type_desc</span>
<span style="color: #0000FF;">from</span> sys.<span style="color: #202020;">database_role_members</span> dbrm
<span style="color: #0000FF;">left</span> join sys.<span style="color: #202020;">database_principals</span> dbpm
        <span style="color: #0000FF;">on</span> dbrm.<span style="color: #202020;">member_principal_id</span> <span style="color: #808080;">=</span> dbpm.<span style="color: #202020;">principal_id</span>
<span style="color: #0000FF;">left</span> join sys.<span style="color: #202020;">database_principals</span> dbpr
        <span style="color: #0000FF;">on</span> dbrm.<span style="color: #202020;">role_principal_id</span> <span style="color: #808080;">=</span> dbpr.<span style="color: #202020;">principal_id</span>
<span style="color: #0000FF;">order</span> <span style="color: #0000FF;">by</span>
        dbpm.<span style="color: #202020;">name</span>, dbpr.<span style="color: #202020;">name</span></pre></div></div>

<p>This is handily fantastic and works well when you&#8217;re just managing access to a single database. What about if you want to audit logins for the entirety of the database instance? Unfortunately, we have to rely on database cursors to build a query and execute it. The concept is easy, but the details can be a little tricky to manage. Here&#8217;s what I came up with:<br />
<span id="more-1561"></span></p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">declare</span> @cmd <span style="color: #0000FF;">nvarchar</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">max</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">''</span>, @dbname sysname
&nbsp;
<span style="color: #0000FF;">declare</span> csr_dbname <span style="color: #0000FF;">cursor</span> <span style="color: #0000FF;">for</span>
<span style="color: #0000FF;">select</span> <span style="color: #FF00FF;">quotename</span><span style="color: #808080;">&#40;</span>name<span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">from</span> sys.<span style="color: #202020;">databases</span> <span style="color: #0000FF;">where</span> <span style="color: #0000FF;">state</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
&nbsp;
<span style="color: #0000FF;">open</span> csr_dbname
&nbsp;
<span style="color: #0000FF;">fetch</span> <span style="color: #0000FF;">next</span> <span style="color: #0000FF;">from</span> csr_dbname
<span style="color: #0000FF;">into</span> @dbname
&nbsp;
<span style="color: #0000FF;">while</span> <span style="color: #FF00FF;">@@fetch_status</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
<span style="color: #0000FF;">begin</span>
        <span style="color: #0000FF;">set</span> @cmd <span style="color: #808080;">=</span> @cmd <span style="color: #808080;">+</span> <span style="color: #FF0000;">'
select '</span><span style="color: #FF0000;">''</span><span style="color: #808080;">+</span>@dbname<span style="color: #808080;">+</span><span style="color: #FF0000;">''</span><span style="color: #FF0000;">' [database_name]
, dbpm.name [principal_name], dbpm.type_desc [principal_type], dbpm.create_date [principal_create], dbpm.modify_date [principal_modify]
, dbpr.name [role_name], dbpr.type_desc [role_type]
from '</span><span style="color: #808080;">+</span>@dbname<span style="color: #808080;">+</span><span style="color: #FF0000;">'.sys.database_role_members dbrm
left join '</span><span style="color: #808080;">+</span>@dbname<span style="color: #808080;">+</span><span style="color: #FF0000;">'.sys.database_principals dbpm
        on dbrm.member_principal_id = dbpm.principal_id
left join '</span><span style="color: #808080;">+</span>@dbname<span style="color: #808080;">+</span><span style="color: #FF0000;">'.sys.database_principals dbpr
        on dbrm.role_principal_id = dbpr.principal_id
        union all
        '</span>
&nbsp;
        <span style="color: #0000FF;">fetch</span> <span style="color: #0000FF;">next</span> <span style="color: #0000FF;">from</span> csr_dbname
        <span style="color: #0000FF;">into</span> @dbname
&nbsp;
<span style="color: #0000FF;">end</span>
&nbsp;
<span style="color: #0000FF;">close</span> csr_dbname
<span style="color: #0000FF;">deallocate</span> csr_dbname
&nbsp;
<span style="color: #0000FF;">set</span> @cmd <span style="color: #808080;">=</span> <span style="color: #0000FF;">left</span><span style="color: #808080;">&#40;</span>@cmd, <span style="color: #FF00FF;">len</span><span style="color: #808080;">&#40;</span>@cmd<span style="color: #808080;">&#41;</span> <span style="color: #808080;">-</span> <span style="color: #000;">12</span><span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">exec</span><span style="color: #808080;">&#40;</span>@cmd<span style="color: #808080;">&#41;</span></pre></div></div>

<p>There are a couple hacky things in this solution that could be factored out, but I&#8217;m keeping it simple. Here&#8217;s the walkthrough:</p>
<ul>
<li>Line 1: Declare and initialize necessary variables. Note that we&#8217;re combining declaration and initialization in a single step. If you&#8217;re not using SQL Server 2008, you&#8217;ll have to separate the initialization with a distinct &#8220;set @cmd = &#8221;&#8221; command</li>
<li>Line 3-4: Declare the query which defines the cursor. On line 4, we limit state = 0, because otherwise we might get databases in restoring or offline mode. Additionally, QUOTENAME() is used to ensure the input is sanitized for string concatenation. If you wanted to limit the scope of your databases, do it here.</li>
<li>Line 6-12: Standard cursor setup</li>
<li>Line 13-23: Build the query we&#8217;ll eventually use to scan all databases. We inject the database name from the cursor into the query to three-part qualify it, effectively neutralizing the current database context. Also, there&#8217;s a &#8220;union all&#8221; at the end that we&#8217;ll need to take care of later on</li>
<li>Line 25-31: Standard cursor tear-down</li>
<li>Line 33: Chuck the last &#8220;union all&#8221; from the query, lest it be dangling and we receive a parse error. If we were targeting re-usability, it would be smart to put the &#8220;union all&#8221; in a separate variable, rather than calculating the length of a literal</li>
<li>Line 35: Execute the  query. We could optionally print the results here, but they&#8217;re typically longer than what Management Studio will display before truncating</li>
</ul>
<p>It&#8217;s all quite simple and easy to toss into a stored procedure if you want to audit on a regular basis. Setting up a SQL Server Agent job to run monthly and return the results in an email would be straightforward enough. One of the issues I ran into and did not address was the sorting, which you may have noticed is absent in the extended script. This could be rectified by using &#8220;exec insert&#8221; notation, thought the results aren&#8217;t always dependable.</p>


<p><a href="http://feedads.g.doubleclick.net/~a/pqBmEc0GOG027jp4azU3dfueoz0/0/da"><img src="http://feedads.g.doubleclick.net/~a/pqBmEc0GOG027jp4azU3dfueoz0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/pqBmEc0GOG027jp4azU3dfueoz0/1/da"><img src="http://feedads.g.doubleclick.net/~a/pqBmEc0GOG027jp4azU3dfueoz0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/xd-qzGQRJpQ" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2011/04/11/sql-server-principals-roles-permission-audit/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2011/04/11/sql-server-principals-roles-permission-audit/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sql-server-principals-roles-permission-audit</feedburner:origLink></item>
<item>
<title>New Office Outlook 2010 Data File Menu Item</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/Jz1gqIsufws/</link>
<comments>http://www.ideaexcursion.com/2011/01/05/new-office-outlook-2010-data-file-menu-item/#comments</comments>
<pubDate>Wed, 05 Jan 2011 17:59:52 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[Microsoft]]>
</category>
<category>
<![CDATA[quickie]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1554</guid>
<description>
<![CDATA[How to access Office Outlook 2010's "Outlook Data File…" menu item.]]>
</description>
<content:encoded><![CDATA[
<p>Just a quick note on how to create a new Outlook data file. In Office 2010, Outlook received a ribbon revamp, moving several common menu items around. For Outlook 2007 and earlier, you can locate the appropriate option under File?Data Files. In Outlook 2010, create a new data file by drilling down through the &#8220;New Items&#8221; button on the Home tab of the ribbon. If you&#8217;re more visually inclined, here&#8217;s an image to help you locate the menu item:</p>
<p><span id="more-1554"></span></p>
<p><a href="http://static.ideaexcursion.com/wp-content/uploads/2011/01/NewOutlookDataFile.png"><img class="alignnone size-full wp-image-1555" title="New Data File Outlook 2010" src="http://static.ideaexcursion.com/wp-content/uploads/2011/01/NewOutlookDataFile.png" alt="Menu Drilldown for New Data File in Outlook 2010" width="498" height="460" /></a></p>


<p><a href="http://feedads.g.doubleclick.net/~a/Jv8Rm1WQAIIfpLS8RtLPmtVU9e8/0/da"><img src="http://feedads.g.doubleclick.net/~a/Jv8Rm1WQAIIfpLS8RtLPmtVU9e8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Jv8Rm1WQAIIfpLS8RtLPmtVU9e8/1/da"><img src="http://feedads.g.doubleclick.net/~a/Jv8Rm1WQAIIfpLS8RtLPmtVU9e8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/Jz1gqIsufws" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2011/01/05/new-office-outlook-2010-data-file-menu-item/feed/</wfw:commentRss>
<slash:comments>2</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2011/01/05/new-office-outlook-2010-data-file-menu-item/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-office-outlook-2010-data-file-menu-item</feedburner:origLink></item>
<item>
<title>Why RAM Matters Less with OS X Lion</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/h-HRExcbOic/</link>
<comments>http://www.ideaexcursion.com/2010/11/12/why-ram-matters-less-with-os-x-lion/#comments</comments>
<pubDate>Fri, 12 Nov 2010 15:46:54 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[Mac]]>
</category>
<category>
<![CDATA[iOS]]>
</category>
<category>
<![CDATA[iPhone]]>
</category>
<category>
<![CDATA[Lion]]>
</category>
<category>
<![CDATA[MacBook]]>
</category>
<category>
<![CDATA[OS X]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1535</guid>
<description>
<![CDATA[With the introduction of Lion, memory will be less important as a hardware specification for many users due to changes in the future of the Mac ecosystem.]]>
</description>
<content:encoded><![CDATA[
<p>With the introduction of Lion, memory will likely be less important as a hardware specification for many Mac users. Why? There are a few reasons, of which the entire mobile platform, iOS, plays a large role.</p>
<p>First, let’s take a trip down memory lane to the first three versions of the iPhone. Some of the loudest clamor from users rang to the tune of “WE WANT MULTITASKING!” As is typical Apple fashion, they didn’t bother hacking together some barely passable solution, botching the wonderful user experience they’ve cultured. Instead, they told users that it’ll be ready “when it’s ready”.<br />
<span id="more-1535"></span><br />
Copy &amp; Paste is a superb example of this rhetoric. Since introduction of the first iPhone, everyone knew this functionality would eventually arrive on iPhone OS (the name of the operating system before being renamed to iOS). The outstanding questions were “When?” and “How?” In the end, most would agree that the current implementation is both effective and elegant.</p>
<p>If we look back to the introduction of multitasking in iOS 4, it was again on Apple’s terms. Instead of allowing applications to run wild in the background, they were able to multitask in specific, approved ways. Touted as the simplest option to implement, one of those approved methods for achieving multitask-awareness was app suspend/resume.</p>
<h2>Suspend/Resume</h2>
<p>The concept of suspend/resume is quite prevalent today. Probably the most obvious example is the low power “sleep” mode that most modern laptops support. Desktops typically support this mode as well, though users are probably less cognizant of it.</p>
<p>As mentioned above, iOS introduced a similar suspend/resume capability, but at an application level. Assuming the application is interrupted &#8212; whether it is user or system driven &#8212; it can smartly store the current state, allowing the user to bring the application back to focus and continue precisely where they left off. There is no need for the application to completely reload; instead, it can rotate into view and instantly resume.</p>
<p>To this end, I initially micro-managed open applications on the iPhone 4, but I soon realized that resistance was futile. Even if I restarted the phone, recently-used applications were still listed in the multitask springboard. It’s like a “Recent Documents” list where the latest few items were already cached and available for immediate use. Brilliant.</p>
<p>As part of the recent “Back to the Mac” announcement in October 2010, a preview of OS X 10.7, codenamed Lion was presented. The entire lead-up to the demo explained how mobile features of iOS were eventually making their way back into the rest of the Mac ecosystem. One of these features highlighted was application resuming.</p>
<p>Interestingly enough, after hyper-analysis it was noted the dock no longer exhibits markers to indicate which applications are active. I suspect this was intentional. Just as users of multitasking-capable iOS devices need not think about application management, nor should OS X users.</p>
<p>The interesting piece of the current iOS puzzle is that it never requires the user to manage what is running, nor would they care. If memory is exhausted, the application silently quits. During the next launch, it may take a few additional seconds to reload from a cold start, but users are hardly aware of this. I give credit for this to…</p>
<h2>Flash memory/Solid State Disks</h2>
<p>Just as we can hibernate a computer and commit the contents of <acronym title="Random Access Memory">RAM</acronym> to disk, so could we with individual applications. And because <abbr title="Solid State Drive">SSD</abbr>’s are clearly destined to replace mechanical drives in the consumer space, we need not worry about load times as has historically been the case.</p>
<p>Take a look at the latest MacBook Air. A full cold boot has gone from several minutes to mere seconds. That kind of improvement is astounding. Apple took this approach a step further (or actually, a step back depending on how you view the situation) and created a new state between hibernate and sleep where the computer “slumbers” in just a couple seconds and returns from this state in the same amount of time. Furthermore, the laptop can hold this state for up to 30 days. If an entire <abbr title="Operating System">OS</abbr> can but brought in and out of such a deep state of rest, what kind of performance can we expect to see from a similar feature on a per-application basis?</p>
<p>Let’s say you’re working on a presentation in Keynote. You decided to load Photoshop to edit an image you want included in the slideshow. Would anyone care if the state of Keynote was swapped/paged out of <acronym title="Random Access Memory">RAM</acronym>? In days of yore with slow 5400<abbr title="Rotations Per Minute">RPM</abbr> hard drives, perhaps. In modern times, where <abbr title="Solid State Drive">SSD</abbr>&#8216;s easily read above 100 <abbr title="MegaByte">MB</abbr>/sec, probably not.</p>
<h2>Limitations</h2>
<p>Don’t misunderstand, this prospect isn’t for everyone. I don’t expect 12-core Mac Pros loaded with 32GB of RAM to take advantage of this feature. No, this is not a feature that will permeate throughout the entire Mac ecosystem. Instead, it’s a feature for the masses. There&#8217;s a reason why the Fall 2010 refresh of the MacBook Air came only in 2<abbr title="GigaByte">GB</abbr> and 4<abbr title="GigaByte">GB</abbr> configurations. It’s for those of us that want an iPad-like experience for light content creation.</p>
<p>It means less emphasis on hardware. It means less dependence on application management. It means less user confusion. OS X 10.7 is destined to make productivity a “set &amp; forget” affair. And I welcome our new Lion overlords.</p>


<p><a href="http://feedads.g.doubleclick.net/~a/0LPinrMfUqf9WJzJrAhVy_F1358/0/da"><img src="http://feedads.g.doubleclick.net/~a/0LPinrMfUqf9WJzJrAhVy_F1358/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0LPinrMfUqf9WJzJrAhVy_F1358/1/da"><img src="http://feedads.g.doubleclick.net/~a/0LPinrMfUqf9WJzJrAhVy_F1358/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/h-HRExcbOic" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2010/11/12/why-ram-matters-less-with-os-x-lion/feed/</wfw:commentRss>
<slash:comments>4</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2010/11/12/why-ram-matters-less-with-os-x-lion/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=why-ram-matters-less-with-os-x-lion</feedburner:origLink></item>
<item>
<title>Cache multiple values in a Map Container for fast in-memory lookup</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/8t4iumTQwyo/</link>
<comments>http://www.ideaexcursion.com/2010/06/29/cache-multiple-values-in-a-map-container-for-fast-in-memory-lookup/#comments</comments>
<pubDate>Tue, 29 Jun 2010 21:24:15 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[Dynamics AX]]>
</category>
<category>
<![CDATA[Dynamics AX 2009]]>
</category>
<category>
<![CDATA[X++]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1517</guid>
<description>
<![CDATA[Use this technique to reduce repeated trips to tables to lookup record details. Instead, cache the information once and reap speed benefits throughout your code]]>
</description>
<content:encoded><![CDATA[
<p>And thus begins my foray in to X++ development for Dynamics AX 2009. Here&#8217;s a proof of concept Job that I created to stuff multiple values into a Map using a Container. This allows me to lookup a few customer details without repeatedly making trips back to CustTable.</p>

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> MapContainerTest<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    Map                     custNotesMap;
    <span style="color: #0000ff;">Container</span>               custContainer;
    CustTable               custTable;
    SalesSourceSystemId     admarcSystemId <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;DPRADM&quot;</span>;
    <span style="color: #0000ff;">Container</span>               conCustDetails;
    <span style="color: #0000ff;">str</span>                     admarcAccountId <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;000123456&quot;</span>;
    ;
&nbsp;
    custNotesMap <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> Map<span style="color: #000000;">&#40;</span>Types<span style="color: #00007f;">::</span><span style="color: #000000;">String</span><span style="color: #00007f;">,</span> Types<span style="color: #00007f;">::</span><span style="color: #0000ff;">Container</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">while</span> <span style="color: #0000ff;">select</span> AdmarcAccountId<span style="color: #00007f;">,</span> RecId<span style="color: #00007f;">,</span> TableId<span style="color: #00007f;">,</span> dataAreaId<span style="color: #00007f;">,</span> PartyId <span style="color: #0000ff;">from</span> custTable <span style="color: #0000ff;">where</span> custTable.<span style="color: #000000;">AdmarcSystemId</span> <span style="color: #00007f;">==</span> admarcSystemId
    <span style="color: #000000;">&#123;</span>
        custContainer <span style="color: #00007f;">=</span> <span style="color: #0000ff;">conNull</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        custContainer <span style="color: #00007f;">=</span> <span style="color: #000000;">&#91;</span>custTable.<span style="color: #000000;">RecId</span><span style="color: #00007f;">,</span> custTable.<span style="color: #000000;">TableId</span><span style="color: #00007f;">,</span> custTable.<span style="color: #000000;">dataAreaId</span><span style="color: #00007f;">,</span> custTable.<span style="color: #000000;">PartyId</span><span style="color: #000000;">&#93;</span>;
&nbsp;
        custNotesMap.<span style="color: #000000;">insert</span><span style="color: #000000;">&#40;</span>custTable.<span style="color: #000000;">AdmarcAccountId</span><span style="color: #00007f;">,</span> custContainer<span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span>custNotesMap.<span style="color: #0000ff;">exists</span><span style="color: #000000;">&#40;</span>admarcAccountId<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        conCustDetails <span style="color: #00007f;">=</span> custNotesMap.<span style="color: #000000;">lookup</span><span style="color: #000000;">&#40;</span>admarcAccountId<span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">else</span>
        error<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Customer not found.&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
    info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;RecId: %1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">conpeek</span><span style="color: #000000;">&#40;</span>conCustDetails<span style="color: #00007f;">,</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;TableId: %1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">conpeek</span><span style="color: #000000;">&#40;</span>conCustDetails<span style="color: #00007f;">,</span> <span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;dataAreaId: %1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">conpeek</span><span style="color: #000000;">&#40;</span>conCustDetails<span style="color: #00007f;">,</span> <span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;PartyId: %1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">conpeek</span><span style="color: #000000;">&#40;</span>conCustDetails<span style="color: #00007f;">,</span> <span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>In fact, it&#8217;s pretty fast and I&#8217;m using similar caching technique all over the place to speed up large jobs.</p>


<p><a href="http://feedads.g.doubleclick.net/~a/dpCg7bXo105K1yVSJfWP-w50_Kg/0/da"><img src="http://feedads.g.doubleclick.net/~a/dpCg7bXo105K1yVSJfWP-w50_Kg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dpCg7bXo105K1yVSJfWP-w50_Kg/1/da"><img src="http://feedads.g.doubleclick.net/~a/dpCg7bXo105K1yVSJfWP-w50_Kg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/8t4iumTQwyo" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2010/06/29/cache-multiple-values-in-a-map-container-for-fast-in-memory-lookup/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2010/06/29/cache-multiple-values-in-a-map-container-for-fast-in-memory-lookup/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cache-multiple-values-in-a-map-container-for-fast-in-memory-lookup</feedburner:origLink></item>
<item>
<title>Ubuntu VirtualBox Server Redux Addendum</title>
<link>http://feeds.ideaexcursion.com/~r/IdeaExcursion/~3/c7xG5OlFZU4/</link>
<comments>http://www.ideaexcursion.com/2010/05/25/ubuntu-virtualbox-server-redux-addendum/#comments</comments>
<pubDate>Tue, 25 May 2010 11:25:53 +0000</pubDate>
<dc:creator>Taylor Gerring</dc:creator>
<category>
<![CDATA[VirtualBox]]>
</category>
<guid isPermaLink="false">http://www.ideaexcursion.com/?p=1498</guid>
<description>
<![CDATA[There are several attributes and utilities that can be configured or installed to make the experience of managing a VirtualBox server much easier.]]>
</description>
<content:encoded><![CDATA[
<p>Although the last article on <a title="Ubuntu VirtualBox Server Redux" href="http://www.ideaexcursion.com/2010/03/16/ubuntu-virtualbox-server-redux/">running a VirtualBox server</a> gets you up and running with a minimum installation, there are several things that can be configured or installed to make the experience of managing a VirtualBox server much easier.<br />
<span id="more-1498"></span></p>
<h2>Guest Additions</h2>
<p>Probably the most common need is to install guest additions. Because the virtual machines are running in headless mode, there&#8217;s no menu to easily select &#8220;Install Guest Additions&#8221;. However, this option merely automates the mounting of an ISO. We can replicate this functionality from the command line. Note that the path to the ISO may vary depending on your host environment.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#run this on your host</span>
VBoxManage storageattach <span style="color: #ff0000;">&quot;LAMP1&quot;</span> <span style="color: #660033;">--storagectl</span> <span style="color: #ff0000;">&quot;IDEController&quot;</span> <span style="color: #660033;">--port</span> <span style="color: #000000;">1</span> <span style="color: #660033;">--device</span> <span style="color: #000000;">0</span> <span style="color: #660033;">--type</span> dvddrive <span style="color: #660033;">--medium</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>virtualbox<span style="color: #000000; font-weight: bold;">/</span>VBoxGuestAdditions.iso
<span style="color: #666666; font-style: italic;">#run these commands on the guest</span>
<span style="color: #666666; font-style: italic;">#install packages necessary to build and install the additions</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential linux-headers-<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #666666; font-style: italic;">#run the Guest Addtions installation and reboot</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>cdrom
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>cdrom<span style="color: #000000; font-weight: bold;">/</span>VBoxLinuxAdditions-x86.run</pre></div></div>

<p>If you&#8217;d like to mount another disc, you&#8217;ll need to eject the ISO first.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#unmount the disc in the guest</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>cdrom
<span style="color: #666666; font-style: italic;">#instruct VirtualBox to emulate an empty drive</span>
VBoxManage storageattach <span style="color: #ff0000;">&quot;LAMP1&quot;</span> <span style="color: #660033;">--storagectl</span> <span style="color: #ff0000;">&quot;IDEController&quot;</span> <span style="color: #660033;">--port</span> <span style="color: #000000;">0</span> <span style="color: #660033;">--device</span> <span style="color: #000000;">0</span> <span style="color: #660033;">--type</span> dvddrive <span style="color: #660033;">--medium</span> emptydrive</pre></div></div>

<h2>Shared Folders (guest additions neccessary for shared folders)</h2>
<p>Shared folders are a common way to transfer files between guest and host. First, you&#8217;ll need to successfully install guest additions. Once done, adding is easy as following the below template. Just customize the <abbr title="Virtual Machine">VM</abbr> name, share name and host path.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">VBoxManage sharedfolder add <span style="color: #ff0000;">&quot;LAMP1&quot;</span> <span style="color: #660033;">--name</span> <span style="color: #ff0000;">&quot;dropbox&quot;</span> <span style="color: #660033;">--hostpath</span> ~<span style="color: #000000; font-weight: bold;">/</span>Dropbox<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2>Changing the <acronym title="Media Access Control">MAC</acronym> address</h2>
<p>This is probably not a common need, but if you&#8217;ve got <abbr title="Internet Protocol">IP</abbr> addressed reserved for certain devices, you&#8217;ll need to ensure the <acronym title="Media Access Control">MAC</acronym> address stays the same between <abbr title="Virtual Machine">VM</abbr> setups and tear-downs. The change from auto-generated is easy.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#First, check the current MAX address</span>
VBoxManage showvminfo <span style="color: #ff0000;">&quot;LAMP1&quot;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> NIC\ <span style="color: #000000;">1</span>:
<span style="color: #666666; font-style: italic;">#Now, set the MAC address to whatever you want</span>
VBoxManage modifyvm <span style="color: #ff0000;">&quot;LAMP1&quot;</span> <span style="color: #660033;">--macaddress1</span> 0800279859FF</pre></div></div>

<h2><abbr title="Universal Serial Bus">USB</abbr> support</h2>
<p>I&#8217;m not sure how many people use <abbr title="Universal Serial Bus">USB</abbr> support in headless mode, but if you need to mount a device directly in the guest OS, VirtualBox provides that ability. Permission settings borrowed from <a title="Virtual Box" href="http://wiki.flexion.org/VirtualBox.html">http://wiki.flexion.org/VirtualBox.html</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Add proper permissions to USB device</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;none /proc/bus/usb usbfs devgid=%s,devmode=664 0 0&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">grep</span> vboxusers <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f3</span> <span style="color: #660033;">-d</span><span style="color: #ff0000;">':'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab
VBoxManage modifyvm <span style="color: #ff0000;">&quot;LAMP1&quot;</span> <span style="color: #660033;">--usb</span> on <span style="color: #660033;">--usbehci</span> on</pre></div></div>

<h2>VM Management with VBoxTool</h2>
<p>By far, the best tool I&#8217;ve used for automated VM management is <a title="VBoxTool" href="http://vboxtool.sourceforge.net/">VBoxTool</a>. It&#8217;s really just a collection of scripts to automate tasks, but the killer feature is the autostart and autosave of virtual machines on boot and shutdown. While it facilitates other aspects of VM management, those two alone make it worth the trouble of configuring it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>vboxtool
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>vboxtool
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;http://downloads.sourceforge.net/project/vboxtool/vboxtool/0.4/vboxtool-0.4.zip?use_mirror=kent&quot;</span> <span style="color: #660033;">-O</span> vboxtool-<span style="color: #000000;">0.4</span>.zip
<span style="color: #c20cb9; font-weight: bold;">unzip</span> vboxtool-<span style="color: #000000;">0.4</span>.zip
<span style="color: #7a0874; font-weight: bold;">cd</span> script
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> vboxtool<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:root vboxtool<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> vboxtool <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> vboxtoolinit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d vboxtoolinit defaults <span style="color: #000000;">99</span> <span style="color: #000000;">10</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vboxtool
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vboxtool
<span style="color: #666666; font-style: italic;">#Configure /etc/vboxtool/machines.conf to register machines with VBoxTool</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'LAMP1,3391'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">-a</span> machines.conf
<span style="color: #666666; font-style: italic;">#Configure /etc/vboxtool/vboxtool.conf to indicate which user that machines should start under</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;vbox_user='%s'&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">-a</span> vboxtool.conf
vboxtool autostart</pre></div></div>

<p>If for some reason you ever decide to remove VBoxTool, you&#8217;ll need to unregister it from boot with the below command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update-rc.d <span style="color: #660033;">-f</span> vboxtoolinit remove</pre></div></div>

<h2>VBoxWeb</h2>
<p>Although the <a title="vboxweb" href="http://vboxweb.blogspot.com/">VBoxWeb</a> project still has some rough edges and the blog isn&#8217;t updated often, it holds a lot of promise. If you&#8217;d like to check it out, use the following commands to download and install it. <a title="Install VirtualBox Web Console - Project Hosting on Google Code" href="http://code.google.com/p/vboxweb/wiki/install">Full guide</a> available on their own website.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-simplejson subversion
<span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>vboxweb.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> vboxweb-read-only
<span style="color: #7a0874; font-weight: bold;">cd</span> vboxweb-read-only
python VBoxWebSrv.py adduser $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;">#Below starts VBoxWeb in the background</span>
python VBoxWebSrv.py <span style="color: #000000; font-weight: bold;">&amp;</span>amp;</pre></div></div>



<p><a href="http://feedads.g.doubleclick.net/~a/SLXeyErHL4weDsbbqaco_o7LqGU/0/da"><img src="http://feedads.g.doubleclick.net/~a/SLXeyErHL4weDsbbqaco_o7LqGU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/SLXeyErHL4weDsbbqaco_o7LqGU/1/da"><img src="http://feedads.g.doubleclick.net/~a/SLXeyErHL4weDsbbqaco_o7LqGU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/IdeaExcursion/~4/c7xG5OlFZU4" height="1" width="1"/>]]></content:encoded>
<wfw:commentRss>http://www.ideaexcursion.com/2010/05/25/ubuntu-virtualbox-server-redux-addendum/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
<feedburner:origLink>http://www.ideaexcursion.com/2010/05/25/ubuntu-virtualbox-server-redux-addendum/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ubuntu-virtualbox-server-redux-addendum</feedburner:origLink></item>
</channel>
</rss><!-- Served from: www.ideaexcursion.com @ 2012-05-28 14:13:10 by W3 Total Cache -->

