<?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>greg felice / professional blog</title>
	<atom:link href="http://gregfelice.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregfelice.com</link>
	<description>developing people &#38; building productive teams / large scale scrum / agile ITIL operations</description>
	<lastBuildDate>Fri, 17 Feb 2012 23:58:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Large Scale Scrum: Employ a Product Mindset for Better Multi-Team Collaboration</title>
		<link>http://gregfelice.com/using-a-product-focus-to-manage-scrum-team-interdependencies/</link>
		<comments>http://gregfelice.com/using-a-product-focus-to-manage-scrum-team-interdependencies/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 15:24:29 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[product]]></category>
		<category><![CDATA[scaling-scrum]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=280</guid>
		<description><![CDATA[Author&#8217;s Notes: The Lean Product concept is hot right now &#8211; but it primarily focuses on getting the customer-product fit right. This article has a different focus &#8212; application of  product concepts to scale scrum. If you&#8217;ve been Scrumming for &#8230; <a href="http://gregfelice.com/using-a-product-focus-to-manage-scrum-team-interdependencies/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Author&#8217;s Notes: The Lean Product concept is hot right now &#8211; but it primarily focuses on <span style="text-decoration: underline;">getting the customer-product fit right</span>. This article has a different focus &#8212; application of  product concepts to <span style="text-decoration: underline;">scale scrum</span>.</em></p>
<p>If you&#8217;ve been Scrumming for a while in a large organization, chances are you&#8217;re asking yourself:</p>
<p><em>How do I manage interdependencies between Scrum Teams?</em></p>
<p>This can be a problem &#8211; large organizations with strong in-house technical capabilities will have interrelated service oriented architectures, layered architectures, infrastructure groups, all relying on each other to deliver the end solution.</p>
<p>If you look at the Scrum community&#8217;s response on how to manage delivery between these teams, there&#8217;s typically one answer: Scrum of Scrums. This is, in my opinion, punting on the problem. It doesn&#8217;t even begin to address this complex issue in a repeatable and structured fashion.</p>
<p>Applying a product mindset to technical teams can help.</p>
<p>Let&#8217;s paint a scenario.</p>
<p>Acme Widgets is a large organization. Producing their beloved widgets involves the following teams:</p>
<p>Consumers</p>
<ul>
<li>Web Team A</li>
<li>Web Team B</li>
<li>Web Team C</li>
<li>Web Team D</li>
</ul>
<p>Shared Services</p>
<ul>
<li>App Platform Team A (Shared Service)</li>
<li>Infrastructure Team A (Shared Service)</li>
</ul>
<p>Note the web teams rely heavily on capabilities provided by shared services groups. This shared services model is typical of most complex tech shops.</p>
<p>If we go with a simple approach to managing this complexity, the shared services leads might conduct scrums of scrums with the consumer team leads. This certainly helps, but there are still issues to be addressed:</p>
<ul>
<li>Do consumer or shared services backlogs contain the stories?</li>
<li>How do shared services teams think about their velocity?</li>
</ul>
<p>While we can arrive at rules on how we export or import stories from one team to another, the problems of work tracking and interdependencies between consumers and producers here are tough to solve &#8211; establishing process rules and having a scrum of scrums doesn&#8217;t make it all better.</p>
<p>Let&#8217;s introduce the product concept.</p>
<p>Early in my software career, there were tons and tons of opportunities to work on custom software development projects &#8211; the web software domain was still immature &#8211; it hadn&#8217;t  codified and packaged solutions for problem domains. Nice thing about this &#8211; the cost of custom software development was high &#8212; we made money &#8212; but the cost to the customer was high as well.</p>
<p>As the software industry matured, more and more productized solutions emerged. Businesses favor productized solutions because they are significantly cheaper than a custom solution. Once you invest the effort in packaging a product and enter mass-production mode, your overall cost per unit drops, and keeps dropping the more units you sell. The other big benefit here is the entanglement between the customer and the producer is greatly simplified &#8212; you know your customer&#8217;s needs, and you provide a configurable product/solution to meet their needs without full-blown requirements &amp; analysis phases, construction efforts, QA phases, etc.</p>
<p>Let&#8217;s go into a little detail on applying a product mindset to the Acme Widgets scenario.</p>
<p>Remember:</p>
<ul>
<li>Consumer teams are customers.</li>
<li>Shared services teams produce products.</li>
</ul>
<p>Steps for Applying a Product Focus:</p>
<p><em>Understand your customer types.</em></p>
<p>Think about your product, and your customer types. What categories do they fall into? Examples: Small, Medium, Large? High Security Risk, Low Security Risk?</p>
<p><em>Streamline your requirements process.</em></p>
<p>Create a systematic requirements gathering process that starts with identifying the customer type of the requestor, then offering them the minimal product set that meets their needs, and avoids unstructured analysis. Better yet, make it self service and template-based.</p>
<p><em>Provide delivery and support SLAs.</em></p>
<p>With a constrained set of variables to consider, your confidence in your ability to estimate service levels around product delivery and support will increase. Customers appreciate this, and it lets you do better demand and expectation management.</p>
<p><em>Standardize your change and deployment process.</em></p>
<p>Standardizing your product has other benefits that the customer won&#8217;t directly see: because your product has less moving parts, the change management and review process can be simplified, perhaps even pre-approved. This eliminates wasteful gates, and speeds delivery even further. (For the ITIL heads in the room &#8211; think of incentivizing your teams by allowing those with the right product focus to move from Normal to Standard Change protocols).</p>
<p>At this point, lets go back to our original problem, and talk about how the product-centric approach can help scrum teams.</p>
<p>Scrum Teams without Product Focus</p>
<ul>
<li>Tight coupling and deep integration of work efforts between teams</li>
<li>Detailed work planning between collaborating groups</li>
<li>Stories and technical tasks are imported and exported across backlogs to coordinate efforts</li>
<li>Cross-team velocity rules/calculations are complex, cumbersome</li>
</ul>
<div><span style="font-size: 15px; line-height: 28px;">Scrum Teams with Product Focus</span></div>
<ul>
<li>Looser coupling, better encapsulation of internal work efforts</li>
<li>Communication via standardized interfaces (standard requirements templates, estimates, SLAs)</li>
<li>Consumer teams rely on ever-more-reliable SLAs for delivery forecasting</li>
<li>Product team stories around external commitments become simplified, standardized, with smaller point values</li>
<li>Product team does less and less custom work, and/or can flag work as custom and cover under different service class models</li>
</ul>
<div><span style="font-size: 15px; line-height: 26px;">Managing interdependencies between scrum teams in  environments will always remain complex &#8211; but employing a product mindset can help reduce the amount of variables you need simultaneously consider.</span></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/using-a-product-focus-to-manage-scrum-team-interdependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default Route Ping and Failover Script [Solaris/Ruby]</title>
		<link>http://gregfelice.com/default-route-failure-detection-script-solarisruby/</link>
		<comments>http://gregfelice.com/default-route-failure-detection-script-solarisruby/#comments</comments>
		<pubDate>Thu, 27 May 2010 04:07:53 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=175</guid>
		<description><![CDATA[Wrote this for my squid boxes. They&#8217;re built with lots of redundancy &#8211; I can fail over to a different NIC/IP address in the event of a connectivity failure. Written and tested on Solaris, runs as a Ruby daemon. #!/usr/local/bin/ruby &#8230; <a href="http://gregfelice.com/default-route-failure-detection-script-solarisruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wrote this for my squid boxes. They&#8217;re built with lots of redundancy &#8211; I can fail over to a different NIC/IP address in the event of a connectivity failure. </p>
<p>Written and tested on Solaris, runs as a Ruby daemon.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/local/bin/ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/smtp'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'daemons'</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;"># defaultroute_failover.rb runs as a daemon.</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;">#  $ ruby myproc_control.rb start</span>
<span style="color:#008000; font-style:italic;">#      (myproc.rb is now running in the background)</span>
<span style="color:#008000; font-style:italic;">#  $ ruby myproc_control.rb restart</span>
<span style="color:#008000; font-style:italic;">#      (...)</span>
<span style="color:#008000; font-style:italic;">#  $ ruby myproc_control.rb stop</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;"># For testing purposes you can even run myproc.rb without forking in the background:</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;">#  $ ruby myproc_control.rb run</span>
<span style="color:#008000; font-style:italic;">#</span>
&nbsp;
<span style="color:#008000; font-style:italic;">###########################</span>
<span style="color:#008000; font-style:italic;"># LOCAL CONFIGS</span>
<span style="color:#008000; font-style:italic;">#</span>
router_a = <span style="color:#996600;">&quot;161.201.128.1&quot;</span>
router_b = <span style="color:#996600;">&quot;62.50.202.65&quot;</span>
&nbsp;
admin_email=<span style="color:#996600;">&quot;noc@foo.com&quot;</span>
sleep_interval=<span style="color:#006666;">60</span>
debug=<span style="color:#0000FF; font-weight:bold;">false</span>
mail_enabled=<span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;">###########################</span>
&nbsp;
hostname = <span style="color:#996600;">`hostname`</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
&nbsp;
active_defaultrouter = <span style="color:#996600;">&quot;&quot;</span>
backup_defaultrouter = <span style="color:#996600;">&quot;&quot;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> get_defaultrouter
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">`netstat -rn | grep '^default' | awk '{ print $2 }'`</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> ping<span style="color:#006600; font-weight:bold;">&#40;</span>host<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;/usr/local/sbin/fping -r 5 -t 1000 -p 3000 -q #{host} &gt;/dev/null 2&gt;&amp;1&quot;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>$?.<span style="color:#9900CC;">exitstatus</span> == <span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">else</span> 
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> mail_admin<span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> mail_enabled
    from = <span style="color:#996600;">&quot;root@#{hostname}.foo.com&quot;</span>
    to = admin_email
    <span style="color:#6666ff; font-weight:bold;">Net::SMTP</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'localhost'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>smtp<span style="color:#006600; font-weight:bold;">|</span>
      smtp.<span style="color:#9900CC;">send_message</span> msg, from, to
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> switch_defaultrouter
  <span style="color:#996600;">`route delete default #{active_defaultrouter}`</span>
  <span style="color:#996600;">`route add default #{backup_defaultrouter}`</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#############################################################################################################################</span>
&nbsp;
Daemons.<span style="color:#9900CC;">run_proc</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'defaultroute_failover.rb'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#CC0066; font-weight:bold;">loop</span> <span style="color:#9966CC; font-weight:bold;">do</span>
&nbsp;
    active_defaultrouter = get_defaultrouter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> active_defaultrouter == router_a
      backup_defaultrouter = router_b
    <span style="color:#9966CC; font-weight:bold;">elsif</span> active_defaultrouter == router_b
      backup_defaultrouter = router_a
    <span style="color:#9966CC; font-weight:bold;">else</span>
      msg = <span style="color:#996600;">&quot;Active default router is an unrecognized IP address: #{active_defaultrouter}. Exiting with no actions.&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> msg <span style="color:#9966CC; font-weight:bold;">if</span> debug
      mail_admin msg
      <span style="color:#CC0066; font-weight:bold;">exit</span> <span style="color:#006666;">1</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> debug
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;router_a = #{router_a}&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;router_b = #{router_b}&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;active_defaultrouter = #{active_defaultrouter}&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;backup_defaultrouter = #{backup_defaultrouter}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> ! ping<span style="color:#006600; font-weight:bold;">&#40;</span>active_defaultrouter<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;I canont ping the active default router at #{active_defaultrouter}!!!&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> debug
      <span style="color:#9966CC; font-weight:bold;">if</span> ping<span style="color:#006600; font-weight:bold;">&#40;</span>backup_defaultrouter<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;I can ping the backup default router at #{backup_defaultrouter}.&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> debug
        switch_defaultrouter <span style="color:#9966CC; font-weight:bold;">if</span> !debug
        msg = <span style="color:#996600;">&quot;#{hostname} proxy defaultrouter unpingable. switched defaultrouter from #{active_defaultrouter} to #{backup_defaultrouter}.&quot;</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> msg <span style="color:#9966CC; font-weight:bold;">if</span> debug
        mail_admin msg
      <span style="color:#9966CC; font-weight:bold;">else</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;I can NOT ping the backup default router at #{backup_defaultrouter}!!!&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> debug
        msg = <span style="color:#996600;">&quot;#{hostname} proxy defaultrouter and backup defaultrouter unpingable.&quot;</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> msg <span style="color:#9966CC; font-weight:bold;">if</span> debug
        mail_admin msg
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;I can ping the active default router at #{active_defaultrouter} with no issues.&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> debug
    <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#CC0066; font-weight:bold;">sleep</span> sleep_interval
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/default-route-failure-detection-script-solarisruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Database Create Script, In Ruby</title>
		<link>http://gregfelice.com/oracle-database-create-script-in-ruby/</link>
		<comments>http://gregfelice.com/oracle-database-create-script-in-ruby/#comments</comments>
		<pubDate>Thu, 27 May 2010 03:43:30 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sqlplus]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=161</guid>
		<description><![CDATA[You can find this script anywhere written in bash. I decided to bang one out in Ruby. Most importantly, it&#8217;ll show a way to invoke sqlplus and pass in SQL as an argument. sid.conf ############################################################################################### $oracle_version=&#34;11.1.0&#34; &#160; $sid=&#34;orcl&#34; &#160; $oracle_base=&#34;/oracle/apps/oracle/oracle&#34; &#8230; <a href="http://gregfelice.com/oracle-database-create-script-in-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You can find this script anywhere written in bash. I decided to bang one out in Ruby. Most importantly, it&#8217;ll show a way to invoke sqlplus and pass in SQL as an argument.</p>
<p>sid.conf</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">###############################################################################################</span>
<span style="color:#ff6633; font-weight:bold;">$oracle_version</span>=<span style="color:#996600;">&quot;11.1.0&quot;</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$sid</span>=<span style="color:#996600;">&quot;orcl&quot;</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$oracle_base</span>=<span style="color:#996600;">&quot;/oracle/apps/oracle/oracle&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$oracle_home</span>=<span style="color:#996600;">&quot;#{$oracle_base}/product/11.1.0/db_1&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># datafile location</span>
<span style="color:#ff6633; font-weight:bold;">$data_home</span>=<span style="color:#996600;">&quot;#{$oracle_base}/oradata/#{$sid}&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># pfile location</span>
<span style="color:#ff6633; font-weight:bold;">$pfile_home</span>=<span style="color:#996600;">&quot;#{$oracle_base}/admin/#{$sid}/pfile&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># change default for production</span>
<span style="color:#ff6633; font-weight:bold;">$ctl1</span>=<span style="color:#996600;">&quot;#{$data_home}/control1.ctl&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$ctl2</span>=<span style="color:#996600;">&quot;/opt/oracle/oradata/#{$sid}/control2.ctl&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$ctl3</span>=<span style="color:#996600;">&quot;/backup/oracle/oradata/#{$sid}/control3.ctl&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># change default for production</span>
<span style="color:#ff6633; font-weight:bold;">$redo1</span>=<span style="color:#996600;">&quot;#{$data_home}/redo01.log&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$redo2</span>=<span style="color:#996600;">&quot;#{$data_home}/redo02.log&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$redo3</span>=<span style="color:#996600;">&quot;#{$data_home}/redo03.log&quot;</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$password</span>=<span style="color:#996600;">&quot;xxxxxxx&quot;</span>
<span style="color:#008000; font-style:italic;">###############################################################################################</span></pre></div></div>

<p>create_db.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
&nbsp;
<span style="color:#000080; font-style:italic;">=begin
&nbsp;
create database script.
&nbsp;
todo: autocreate oratab entry
&nbsp;
=end</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;"># invoke sqlplus as sysdba, run sql, return output.</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#9966CC; font-weight:bold;">def</span> sqlplus<span style="color:#006600; font-weight:bold;">&#40;</span>sql<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> sql
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$debug</span>
  connect_string = <span style="color:#006600; font-weight:bold;">%</span>Q<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/as sysdba&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  sqlplus = <span style="color:#996600;">&quot;#{$oracle_home}/bin/sqlplus -s #{connect_string}&quot;</span>
  output = <span style="color:#996600;">&quot;&quot;</span>
&nbsp;
  headers= <span style="color: #cc0000; font-style: italic;">&lt;&lt;txt
set pages 0
set lines 300
set head off
set echo off
set verify off
set feedback off
txt</span>
&nbsp;
  <span style="color:#CC00FF; font-weight:bold;">IO</span>.<span style="color:#9900CC;">popen</span><span style="color:#006600; font-weight:bold;">&#40;</span>sqlplus, <span style="color:#996600;">&quot;w+&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>pipe<span style="color:#006600; font-weight:bold;">|</span>
    pipe.<span style="color:#CC0066; font-weight:bold;">puts</span> sql
    pipe.<span style="color:#9900CC;">close_write</span>
    output = pipe.<span style="color:#9900CC;">read</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> output
  <span style="color:#0000FF; font-weight:bold;">return</span> output
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;"># create the init.ora pfile</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#9966CC; font-weight:bold;">def</span> create_init_ora_file
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$oracle_version</span> == <span style="color:#996600;">&quot;10.2.0&quot;</span>
    init_ora = <span style="color: #cc0000; font-style: italic;">&lt;&lt;txt
      control_files = (#{$ctl1},#{$ctl2},#{$ctl3})
      undo_management = AUTO
      undo_tablespace = undotbs01
      db_name = #{$sid}
      db_block_size = 8192
      sga_max_size = 1073741824   # 1GB
      sga_target = 1073741824     # 1GB
txt</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">elsif</span> <span style="color:#ff6633; font-weight:bold;">$oracle_version</span> == <span style="color:#996600;">&quot;11.1.0&quot;</span>
&nbsp;
    init_ora = <span style="color: #cc0000; font-style: italic;">&lt;&lt;txt
      # log_archive_dest_1='LOCATION=/home/oracle/apps/oracle/oracle/product/11.1.0/db_1/dbs/arch'
      # log_archive_format=%t_%s_%r.dbf
      db_block_size=8192
      open_cursors=300
      db_domain=&quot;&quot;
      db_name=#{$sid}
      control_files = (#{$ctl1},#{$ctl2},#{$ctl3})
      compatible=11.1.0.0.0
      diagnostic_dest=#{$oracle_base}
      # memory_target=4294967296 # 4GB
      memory_target=1073741824 # 1GB
      processes=200
      sessions=225
      audit_file_dest=#{$oracle_base}/admin/#{$sid}/adump
      audit_trail=db
      remote_login_passwordfile=EXCLUSIVE
      dispatchers=&quot;(PROTOCOL=TCP) (SERVICE=#{$sid}XDB)&quot;
      undo_tablespace=undotbs01
txt</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#CC0066; font-weight:bold;">puts</span> init_ora
  f = <span style="color:#996600;">&quot;#{$oracle_home}/dbs/init#{$sid}.ora&quot;</span>
  <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>f, <span style="color:#996600;">&quot;w&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>f, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> f.<span style="color:#CC0066; font-weight:bold;">puts</span> init_ora <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> create_password_file
  cmd=<span style="color:#996600;">&quot;orapwd file=#{$oracle_home}/dbs/orapw#{$sid} password=#{$password}&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> cmd
  <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#008000; font-style:italic;">#{cmd}]</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> create_db_dirs
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$oracle_version</span> == <span style="color:#996600;">&quot;10.2.0&quot;</span>
    <span style="color:#008000; font-style:italic;"># datafiles dir</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/oradata/#{$sid}]</span>
    <span style="color:#008000; font-style:italic;"># archive files dir</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/dbs/arch/#{$sid}]</span>
    <span style="color:#008000; font-style:italic;"># dump files dirs</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/admin/#{$sid}/adump]</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/admin/#{$sid}/bdump]</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/admin/#{$sid}/cdump]</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/admin/#{$sid}/udump]</span>
  <span style="color:#9966CC; font-weight:bold;">elsif</span> <span style="color:#ff6633; font-weight:bold;">$oracle_version</span> == <span style="color:#996600;">&quot;11.1.0&quot;</span>
    <span style="color:#008000; font-style:italic;"># note: oracle 11 stores database related files off of oracle_base, not off of oracle_home.</span>
    <span style="color:#008000; font-style:italic;"># adump directory</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_base}/admin/#{$sid}/adump]</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_base}/admin/#{$sid}/dpdump]</span>
    <span style="color:#008000; font-style:italic;"># pfile location</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_base}/admin/#{$sid}/pfile]</span>
    <span style="color:#008000; font-style:italic;"># oradata</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_base}/oradata/#{$sid}]</span>
    <span style="color:#008000; font-style:italic;"># dbs</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/dbs]</span>
    <span style="color:#008000; font-style:italic;"># dbs arch</span>
    <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>mkdir <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{$oracle_home}/dbs/arch]</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> prompt<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{s} Continue? [Y/N]&quot;</span>
  choice = STDIN.<span style="color:#CC0066; font-weight:bold;">gets</span>
  choice.<span style="color:#CC0066; font-weight:bold;">chomp!</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span> <span style="color:#9966CC; font-weight:bold;">if</span> choice != <span style="color:#996600;">&quot;Y&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;">################################################################################################</span>
&nbsp;
<span style="color:#008000; font-style:italic;">##############################################################################</span>
<span style="color:#ff6633; font-weight:bold;">$sid</span>=ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$sid</span> == <span style="color:#0000FF; font-weight:bold;">nil</span> 
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;SID must be passed as a parameter. Exiting.&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
sidconfig = <span style="color:#996600;">&quot;#{$sid}.conf&quot;</span>
<span style="color:#996600;">&quot;Loading sidconfig for #{$sid}...&quot;</span>
<span style="color:#CC0066; font-weight:bold;">load</span> sidconfig
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$debug</span>=<span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#008000; font-style:italic;">##############################################################################</span>
&nbsp;
prompt <span style="color:#996600;">&quot;About to create database for SID: #{$sid}&quot;</span>
&nbsp;
prompt <span style="color:#996600;">&quot;Create dbdirs&quot;</span>
create_db_dirs
&nbsp;
prompt <span style="color:#996600;">&quot;Create init.ora&quot;</span>
create_init_ora_file
&nbsp;
prompt <span style="color:#996600;">&quot;Create password file&quot;</span>
create_password_file
&nbsp;
prompt <span style="color:#996600;">&quot;Create spfile&quot;</span>
sqlplus <span style="color:#996600;">&quot;create spfile from pfile;&quot;</span>
&nbsp;
prompt <span style="color:#996600;">&quot;Startup nomount&quot;</span>
sqlplus <span style="color:#996600;">&quot;startup nomount&quot;</span>
&nbsp;
prompt <span style="color:#996600;">&quot;Create database&quot;</span>
sql = <span style="color: #cc0000; font-style: italic;">&lt;&lt;txt
CREATE DATABASE &quot;#{$sid}&quot;
   USER SYS IDENTIFIED BY #{$password}
   USER SYSTEM IDENTIFIED BY #{$password}
   LOGFILE GROUP 1 ('#{$redo1}') SIZE 100M,
           GROUP 2 ('#{$redo2}') SIZE 100M,
           GROUP 3 ('#{$redo3}') SIZE 100M
   MAXLOGFILES 16
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 200
   MAXINSTANCES 8
   CHARACTER SET UTF8
   NATIONAL CHARACTER SET AL16UTF16
     DATAFILE '#{$data_home}/system01.dbf' SIZE 325M REUSE
   EXTENT MANAGEMENT LOCAL
   SYSAUX 
     DATAFILE '#{$data_home}/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TEMPORARY TABLESPACE temp
     TEMPFILE '#{$data_home}/temp01.dbf' SIZE 100M REUSE
   UNDO TABLESPACE undotbs01 
     DATAFILE '#{$data_home}/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
txt</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#CHARACTER SET WE8ISO8859P1</span>
<span style="color:#008000; font-style:italic;">#NATIONAL CHARACTER SET UTF8</span>
&nbsp;
sqlplus sql
&nbsp;
&nbsp;
sql = <span style="color: #cc0000; font-style: italic;">&lt;&lt;txt
&nbsp;
CREATE TABLESPACE users LOGGING
     DATAFILE '#{$data_home}/users01.dbf' 
     SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED 
     EXTENT MANAGEMENT LOCAL;
txt</span>
&nbsp;
prompt <span style="color:#996600;">&quot;Create users tbs&quot;</span>
sqlplus sql
&nbsp;
prompt <span style="color:#996600;">&quot;Run catalog.sql&quot;</span>
sqlplus <span style="color:#996600;">&quot;@?/rdbms/admin/catalog.sql&quot;</span>
&nbsp;
prompt <span style="color:#996600;">&quot;Run catproc.sql&quot;</span>
sqlplus <span style="color:#996600;">&quot;@?/rdbms/admin/catproc.sql&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/oracle-database-create-script-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very Basic REST and the Google Provisioning API In Ruby</title>
		<link>http://gregfelice.com/a-gdata-ruby-rest-example/</link>
		<comments>http://gregfelice.com/a-gdata-ruby-rest-example/#comments</comments>
		<pubDate>Thu, 27 May 2010 00:57:42 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gdata]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=141</guid>
		<description><![CDATA[In this post, I&#8217;m walking the user through an app that talks to Google via their Provisioning API. I&#8217;ll be talking about the following: - Ruby/Rails - HTTP Basic Authorization - REST - Google GData and Google Provisioning API This &#8230; <a href="http://gregfelice.com/a-gdata-ruby-rest-example/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;m walking the user through an app that talks to Google via their Provisioning API. </p>
<p>I&#8217;ll be talking about the following: </p>
<p>- Ruby/Rails<br />
- HTTP Basic Authorization<br />
- REST<br />
- Google GData and Google Provisioning API</p>
<p>This article is a work in progress.</p>
<p>provisioner_google.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
 <span style="color:#9966CC; font-weight:bold;">def</span> retrieve_user<span style="color:#006600; font-weight:bold;">&#40;</span>username<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">ArgumentError</span>, <span style="color:#996600;">&quot;username blank&quot;</span>, <span style="color:#CC0066; font-weight:bold;">caller</span> <span style="color:#9966CC; font-weight:bold;">if</span> username.<span style="color:#9900CC;">empty</span>?
      resp = <span style="color:#0066ff; font-weight:bold;">@rest_client</span>.<span style="color:#9900CC;">GET</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/a/feeds/foo.com/user/2.0/#{username}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      feed = Document.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>resp.<span style="color:#9900CC;">body</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">unless</span> ! XPath.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span> feed, <span style="color:#996600;">&quot;/AppsForYourDomainErrors&quot;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">empty</span>?
        xn = ProvXn.<span style="color:#9900CC;">new</span>
        xn.<span style="color:#9900CC;">givenname</span> = feed.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;//apps:name&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;givenName&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        xn.<span style="color:#9900CC;">familyname</span> = feed.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;//apps:name&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;familyName&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        xn.<span style="color:#9900CC;">username</span> = feed.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;//apps:login&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;userName&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> xn
      <span style="color:#9966CC; font-weight:bold;">end</span>
      error_code = feed.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;//AppsForYourDomainErrors/error&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;errorCode&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      reason = feed.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;//AppsForYourDomainErrors/error&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;reason&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> error_code == <span style="color:#996600;">'1301'</span>
        <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::RecordNotFound</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        <span style="color:#CC0066; font-weight:bold;">raise</span> ProvisionerException.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>error_code, reason<span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#996600;">&quot;unhandled error&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># currently only supports changes to password.                                                                                                                                                                                           </span>
    <span style="color:#9966CC; font-weight:bold;">def</span> update_user_attributes<span style="color:#006600; font-weight:bold;">&#40;</span>attributes<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">ArgumentError</span>, <span style="color:#996600;">&quot;username blank&quot;</span>, <span style="color:#CC0066; font-weight:bold;">caller</span> <span style="color:#9966CC; font-weight:bold;">if</span> attributes<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'username'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">empty</span>?
      path = <span style="color:#996600;">&quot;/a/feeds/foo.com/user/2.0/#{attributes[&quot;</span>username<span style="color:#996600;">&quot;]}&quot;</span>
      xml = <span style="color:#006600; font-weight:bold;">&lt;&lt;</span>TXT                     
&nbsp;
      <span style="color:#006600; font-weight:bold;">&lt;</span>?xml version=<span style="color:#996600;">&quot;1.0&quot;</span> encoding=<span style="color:#996600;">&quot;UTF-8&quot;</span>?<span style="color:#006600; font-weight:bold;">&gt;</span>                                                                                                                                                                                                 
      <span style="color:#006600; font-weight:bold;">&lt;</span>atom:entry xmlns:atom=<span style="color:#996600;">&quot;http://www.w3.org/2005/Atom&quot;</span> xmlns:apps=<span style="color:#996600;">&quot;http://schemas.google.com/apps/2006&quot;</span> xmlns:gd=<span style="color:#996600;">&quot;http://schemas.google.com/g/2005&quot;</span><span style="color:#006600; font-weight:bold;">&gt;</span>                                                                                     
        <span style="color:#006600; font-weight:bold;">&lt;</span>atom:id<span style="color:#006600; font-weight:bold;">&gt;</span>https:<span style="color:#006600; font-weight:bold;">//</span>apps<span style="color:#006600; font-weight:bold;">-</span>apis.<span style="color:#9900CC;">google</span>.<span style="color:#9900CC;">com</span><span style="color:#006600; font-weight:bold;">/</span>a<span style="color:#006600; font-weight:bold;">/</span>feeds<span style="color:#006600; font-weight:bold;">/</span>foo.<span style="color:#9900CC;">com</span><span style="color:#006600; font-weight:bold;">/</span>user<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006666;">2.0</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{ attributes['username'] }&lt;/atom:id&gt;                                                                                                                                </span>
        <span style="color:#006600; font-weight:bold;">&lt;</span>apps:login userName=<span style="color:#996600;">&quot;#{ attributes['username'] }&quot;</span> password=<span style="color:#996600;">&quot;#{ attributes['password'] }&quot;</span> suspended=<span style="color:#996600;">&quot;false&quot;</span> admin=<span style="color:#996600;">&quot;false&quot;</span> changePasswordAtNextLogin=<span style="color:#996600;">&quot;false&quot;</span> agreedToTerms=<span style="color:#996600;">&quot;true&quot;</span><span style="color:#006600; font-weight:bold;">/&gt;</span>                                                   
      <span style="color:#006600; font-weight:bold;">&lt;/</span>atom:entry<span style="color:#006600; font-weight:bold;">&gt;</span>                                                                                                                                                                                                                          
&nbsp;
TXT
      xmldoc = Document.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>xml<span style="color:#006600; font-weight:bold;">&#41;</span>
      resp = <span style="color:#0066ff; font-weight:bold;">@rest_client</span>.<span style="color:#9900CC;">PUT</span><span style="color:#006600; font-weight:bold;">&#40;</span>path, xmldoc.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Test.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/a-gdata-ruby-rest-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bombproofing: &#8220;Bonding&#8221; Multiple NICs to One Network Interface</title>
		<link>http://gregfelice.com/bombproofing-bonding-multiple-nics-to-one-network-interface/</link>
		<comments>http://gregfelice.com/bombproofing-bonding-multiple-nics-to-one-network-interface/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 03:07:35 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=48</guid>
		<description><![CDATA[Concept: Two network cards backing one IP address. One card fails, you&#8217;re still up. http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s2-modules-bonding.html Example will show bonding of 2 network cards to one IP address (macs and IPs changed to protect the innocent). Step 1: Create /etc/modprobe.conf entries &#8230; <a href="http://gregfelice.com/bombproofing-bonding-multiple-nics-to-one-network-interface/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Concept: Two network cards backing one IP address. One card fails, you&#8217;re still up.</p>
<p><a title="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s2-modules-bonding.html" href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s2-modules-bonding.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s2-modules-bonding.html</a></p>
<div id="attachment_69" class="wp-caption alignnone" style="width: 650px"><img class="size-full wp-image-69" title="bond0" src="http://gregfelice.com/wp-content/uploads/2009/08/bond0.PNG" alt="linux channel bonding" width="640" height="512" /><p class="wp-caption-text">linux channel bonding</p></div>
<p>Example will show bonding of 2 network cards to one IP address (macs and IPs changed to protect the innocent).</p>
<p><span style="text-decoration: underline;">Step 1: Create /etc/modprobe.conf entries</span></p>
<blockquote>
<pre style="padding-left: 30px;">alias bond0 bonding</pre>
</blockquote>
<p><span style="text-decoration: underline;">Step 2: Create ifcfg-bond0 file in /etc/sysconfig/network-scripts</span></p>
<blockquote>
<pre style="padding-left: 30px;">DEVICE=bond0
BOOTPROTO=static
BROADCAST=999.999.999.255
IPADDR=999.999.999.999
NETMASK=255.255.255.0
NETWORK=999.999.999.0
ONBOOT=yes</pre>
</blockquote>
<p><span style="text-decoration: underline;">Step 3: Modify existing ifcfg-eth0 and ifcfg-eth1 files in /etc/sysconfig/network-scripts</span></p>
<p>(ifcfg-eth0):</p>
<blockquote>
<pre style="padding-left: 30px;">DEVICE=eth0
BOOTPROTO=none
HWADDR=00:xx:xx:xx:xx:xx
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=0</pre>
</blockquote>
<p>(ifcfg-eth1):</p>
<blockquote>
<pre style="padding-left: 30px;">DEVICE=eth1
BOOTPROTO=none
HWADDR=xx:x3:xx:xx:88:xx
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no</pre>
</blockquote>
<p><span style="text-decoration: underline;">Step 4: Re-initialize network</span></p>
<blockquote>
<pre style="padding-left: 30px;">/sbin/service network restart</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/bombproofing-bonding-multiple-nics-to-one-network-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chiclet</title>
		<link>http://gregfelice.com/awesome/</link>
		<comments>http://gregfelice.com/awesome/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 22:07:20 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://gregfelice.com/?p=13</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/feZ4-r5SfTI&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/feZ4-r5SfTI&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://gregfelice.com/awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

