<?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>GreenO</title>
	<atom:link href="http://blog.chrisgreenough.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chrisgreenough.com</link>
	<description>GreenO from Technical to Personal and everything in between!</description>
	<lastBuildDate>Tue, 03 Apr 2012 17:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using Mobile to Increase Engagement at Northern Arizona University @BbWorldTransact</title>
		<link>http://blog.chrisgreenough.com/2012/04/using-mobile-to-increase-engagement-at-northern-arizona-university-bbworldtransact/</link>
		<comments>http://blog.chrisgreenough.com/2012/04/using-mobile-to-increase-engagement-at-northern-arizona-university-bbworldtransact/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 17:38:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technobabble]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=200</guid>
		<description><![CDATA[Below is a presentation I gave at this years Blackboard World Transact conference. It was a great experience and I think many people took some great information away. Below is the slide deck. Using Mobile to Increase Engagement at Northern Arizona University]]></description>
			<content:encoded><![CDATA[<p>Below is a presentation I gave at this years Blackboard World Transact conference. It was a great experience and I think many people took some great information away. Below is the slide deck.</p>
<div style="width:425px" id="__ss_12161885"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/greenoch/bb-transact2012" title="Using Mobile to Increase Engagement at Northern Arizona University">Using Mobile to Increase Engagement at Northern Arizona University</a></strong><object id="__sse12161885" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bbtransact2012-120326111845-phpapp01&#038;stripped_title=bb-transact2012&#038;userName=greenoch" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse12161885" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bbtransact2012-120326111845-phpapp01&#038;stripped_title=bb-transact2012&#038;userName=greenoch" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2012/04/using-mobile-to-increase-engagement-at-northern-arizona-university-bbworldtransact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle, RedHat, vm.swappiness and Huge Pages</title>
		<link>http://blog.chrisgreenough.com/2012/01/oracle-redhat-vm-swappiness-and-huge-pages/</link>
		<comments>http://blog.chrisgreenough.com/2012/01/oracle-redhat-vm-swappiness-and-huge-pages/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 21:50:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technobabble]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=182</guid>
		<description><![CDATA[Here are some details on our Blackboard Learn install. I put it together from a request from a colleague from another university. Hopefully others will find it useful.
Especially useful and not Blackboard specific, are the Oracle tuning parameters for RedHat. These seem very important and will be for Oracle and other memory intensive applications.]]></description>
			<content:encoded><![CDATA[<h1>Update</h1>
<p>The night after I wrote this, Apache crashed on all of our nodes. So that thing about not worrying about the web server nodes, scratch that! <img src='http://blog.chrisgreenough.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  We added another node, now running 4 user facing nodes. I think that is what you call jinxing you self!</p>
<h1>Original Post</h1>
<p>Here are some details on our Blackboard Learn install. I put it together from a request from a colleague from another university. Hopefully others will find it useful.</p>
<p>Especially useful and not Blackboard specific, are the Oracle tuning parameters for RedHat. These seem very important and will be for Oracle and other memory intensive applications.</p>
<p>We are running 3 user facing nodes all with the same config. We also have an admin node that we keep out of the LB, maybe still scared from the old Vista days. It seems all jobs get distributed across all the nodes regardless from where they are started. I see it really as a node ready for service now if we see we need it, but have not had the need yet nor do I see it needed in the near future.</p>
<p>We have been fighting more with our Oracle DB then anything else. The nodes seem to handle the traffic just fine, but Oracle has been working VERY hard. We had to make some changes to our Oracle server due to swapping that occurred. I learned more about Kernel tweaking in the last few weeks then I ever cared to know. Even found my favorite Kernel parameter, vm.swappiness. The end result was to have Oracle use Huge Pages to GUARANTEE that swapping NEVER happens. This server has 32GB of memory, we were only allocating like 12GB to Learn and it was still swapping. The way the linux kernel is optimized is not geared for having 32GB of memory and a bunch of filesystem cache was pushing out our Oracle processes and killing everything. I have also added those tuning parameters. I also attached a few PDF&#8217;s that lead us to these parameters. The Oracle 10g Recommendations v1-_2 pdf from RedHat is the best of them I think.</p>
<p>I also added the extra.tomcat option as there are some thread things that we changed to increase GC performance on these large memory footprints.</p>
<h1>Hardware</h1>
<p>App Nodes are all Xen VM&#8217;s with 8 VCPU&#8217;s and 18GB Memory running RedHat 5.6<br />
Oracle 11.2.0.2 server is a Bare Metal Dell r710 w/ 32GB of memory with sga_target set to 8GB and pga_aggregate_target set to 4GB. You can&#8217;t use Automatic Memory Management with Huge Pages.</p>
<h5>bbconfig.properties</h5>
<p>bbconfig.min.heapsize.tomcat=8192m<br />
bbconfig.max.heapsize.tomcat=8192m<br />
bbconfig.max.permsize.tomcat=512m<br />
bbconfig.max.stacksize.tomcat=320k<br />
bbconfig.jvm.options.extra.tomcat=-XX:NewSize=2048m -XX:MaxNewSize=2048m -XX:SurvivorRatio=4 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseTLAB -XX:ParallelCMSThreads=2 -XX:ParallelGCThreads=4 -XX:+PrintVMOptions -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCTaskTimeStamps -XX:+PrintCommandLineFlags -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -Xloggc:/usr/local/blackboard/logs/tomcat/gc.log -Dcom.sun.management.snmp.port=1162 -Dcom.sun.management.snmp.acl.file=/home/bbuser/snmp.acl -Dsun.net.inetaddr.ttl=86400</p>
<p>bbconfig.appserver.maxthreads=200</p>
<p>bbconfig.database.instance.maxpoolsize=200</p>
<p>bbconfig.unix.httpd.maxclients=200</p>
<h2>Oracle Parameters</h2>
<p><code><br />
processes integer 1800<br />
sessions integer 2736<br />
transactions integer 3009<br />
</code></p>
<h2>Oracle OS Kernel Tuning</h2>
<h3>Made Kernel changes so dirty pages in memory are written out more frequently</h3>
<p><code><br />
vm.dirty_background_ratio = 3<br />
vm.dirty_ratio = 15<br />
vm.dirty_expire_centisecs = 500<br />
vm.dirty_writeback_centisecs = 100<br />
</code></p>
<h3>Changed the kernel parameter that determines how aggressive swapping is done. Set to 0 so swapping is only done when needed.</h3>
<p><code><br />
vm.swappiness = 0<br />
</code></p>
<h3>Configured hugepages for Oracle which makes the memory pagesize larger for Oracle processes (this memory is not swappable)</h3>
<p><code><br />
vm.nr_hugepages = 6656<br />
vm.hugetlb_shm_group = 101<br />
</code><br />
ulimit settings for Oracle:<br />
<code><br />
oracle soft memlock 13631488<br />
oracle hard hemlock 13631488<br />
</code><br />
<a href="http://blog.chrisgreenough.com/wp-content/uploads/2012/01/scroft_240_turning_rhel_for_oracle.pdf">scroft_240_turning_rhel_for_oracle</a></p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2012/01/RHELTuningandOptimizationforOracleV11.pdf">RHELTuningandOptimizationforOracleV11</a></p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2012/01/summit_jbw_2010_presentation.pdf">summit_jbw_2010_presentation</a></p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2012/01/Oracle-10-g-recommendations-v1_2.pdf">Oracle-10-g-recommendations-v1_2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2012/01/oracle-redhat-vm-swappiness-and-huge-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft &#8211; with a Catch</title>
		<link>http://blog.chrisgreenough.com/2011/07/integration-between-blackboard-learn%e2%84%a2-release-9-1-vista-8-others-and-peoplesoft-with-a-catch/</link>
		<comments>http://blog.chrisgreenough.com/2011/07/integration-between-blackboard-learn%e2%84%a2-release-9-1-vista-8-others-and-peoplesoft-with-a-catch/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 21:20:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[Blackboard]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[WS-Security]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=175</guid>
		<description><![CDATA[Here is a presentation I gave at BlackBoard World 2011 Developers Conference. Below is the slide deck. Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft &#8211; with a Catch Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft &#8211; with a Catch]]></description>
			<content:encoded><![CDATA[<p>Here is a presentation I gave at BlackBoard World 2011 Developers Conference. Below is the slide deck.</p>
<div style="width:425px" id="__ss_8578037"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/greenoch/bbw" title="Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft - with a Catch">Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft &#8211; with a Catch</a></strong><object id="__sse8578037" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=2011-presentation-110712161345-phpapp01&#038;stripped_title=bbw&#038;userName=greenoch" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse8578037" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=2011-presentation-110712161345-phpapp01&#038;stripped_title=bbw&#038;userName=greenoch" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2011/07/2011-presentation.pptx">Integration Between Blackboard Learn™, Release 9.1, Vista 8, Others and PeopleSoft &#8211; with a Catch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2011/07/integration-between-blackboard-learn%e2%84%a2-release-9-1-vista-8-others-and-peoplesoft-with-a-catch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Daqri</title>
		<link>http://blog.chrisgreenough.com/2011/04/first-daqri/</link>
		<comments>http://blog.chrisgreenough.com/2011/04/first-daqri/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 20:31:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technobabble]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=144</guid>
		<description><![CDATA[Not exactly sure what Daqri is, maybe About.me but heavy on QR? About.me is much better looking, but I think this may have legs. UPDATE: OK&#8230; Got it&#8230; Augmented Reality! Check out my GreenO hovering over my desk! You can even look around it. Made a quick O using Google SketchUp and added an Augmented [...]]]></description>
			<content:encoded><![CDATA[<p>Not exactly sure what <a href="http://bit.ly/kzV8d6 ">Daqri</a> is, maybe <a href="http://bit.ly/iAV93U ">About.me</a> but heavy on QR? <a href="http://bit.ly/iAV93U ">About.me</a> is much better looking, but I think this may have legs.</p>
<div class="wp-caption aligncenter" style="width: 358px"><a href="http://bit.ly/kzV8d6 "><img class=" " title="My Daqri" src="http://daqri.com/gridfs/qrcode/jJCRZApbg3y.jpg" alt="My Daqri" width="348" height="348" /></a><p class="wp-caption-text">Scan with your favorite QR scanner or the Daqri app</p></div>
<p>UPDATE:</p>
<p>OK&#8230; Got it&#8230; Augmented Reality! Check out my GreenO hovering over my desk! You can even look around it. Made a quick O using <a href="http://sketchup.google.com/">Google SketchUp</a> and added an Augmented Reality widget to my Daqri. Kinda neat, not sure what else I can do with it, but if I ever create that fancy new invention this would be a GREAT way to show it off!</p>
<div id="attachment_150" class="wp-caption aligncenter" style="width: 330px"><a href="http://blog.chrisgreenough.com/wp-content/uploads/2011/04/IMG_05341.png"><img class="size-full wp-image-150" title="Daqri Augmented Reality" src="http://blog.chrisgreenough.com/wp-content/uploads/2011/04/IMG_05341.png" alt="A big O floating above a QR code on my desk." width="320" height="480" /></a><p class="wp-caption-text">Tried to make it Green but could not get the texture to take</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2011/04/first-daqri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WS-Security and Python, a Blackboard Story</title>
		<link>http://blog.chrisgreenough.com/2011/01/ws-security-and-python-a-blackboard-story/</link>
		<comments>http://blog.chrisgreenough.com/2011/01/ws-security-and-python-a-blackboard-story/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 22:34:47 +0000</pubDate>
		<dc:creator>GreenO</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[Blackboard]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Service]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=136</guid>
		<description><![CDATA[We have a current integration with Blackboard Vista and as we start to deploy Blackboard Learn we wanted to use this same integration with this new end point. The feed is written in Python and the Learn web services use WS-Security for authentication/authorization. I could find very little information on WS-Security and Python. We decided [...]]]></description>
			<content:encoded><![CDATA[<p>We have a current integration with Blackboard Vista and as we start to deploy Blackboard Learn we wanted to use this same integration with this new end point. The feed is written in Python and the Learn web services use WS-Security for authentication/authorization. I could find very little information on WS-Security and Python. We decided to go with ZSI for our web services layer in Python. After digging for a long time we found that ZSI allows a hook to a Signature Handler that signs each soap packet before its was sent! PERFECT&#8230; Now what!</p>
<p>This is my first WS-Security via Python so I am not sure if there is some liberty taken with this protocol by Blackboard or not. The Blackboard looks like it uses the Rampart module for Axis, so I would hope it is standard. Below is our Signature Handler that is working GREAT!</p>
<p>Also below is a sample of how its used for Blackboard Learn. Learn uses a sessionId in the &#8220;password&#8221; field for WS-Security. This session is then authenticated using web services calls. The info below connects the Context web services for the first time and requests a session. You can then reuse the sessionId it creates and just reuse the Signature Handler created for the other web services calls. </p>
<p><strong>Complete Signature Handler</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">random</span>
<span style="color: #ff7700;font-weight:bold;">import</span> hashlib
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">binascii</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
<span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
Created on Oct 27, 2010
&nbsp;
@author: cdg2
'</span><span style="color: #483d8b;">''</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> SignatureHandler<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
    classdocs
    '</span><span style="color: #483d8b;">''</span>
    OASIS_PREFIX = <span style="color: #483d8b;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401&quot;</span>
    SEC_NS = OASIS_PREFIX + <span style="color: #483d8b;">&quot;-wss-wssecurity-secext-1.0.xsd&quot;</span>
    UTIL_NS = OASIS_PREFIX + <span style="color: #483d8b;">&quot;-wss-wssecurity-utility-1.0.xsd&quot;</span>
    PASSWORD_DIGEST_TYPE = OASIS_PREFIX + <span style="color: #483d8b;">&quot;-wss-username-token-profile-1.0#PasswordDigest&quot;</span>
    PASSWORD_PLAIN_TYPE = OASIS_PREFIX + <span style="color: #483d8b;">&quot;-wss-username-token-profile-1.0#PasswordText&quot;</span>
    log=<span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SignatureHandler&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,<span style="color: #dc143c;">user</span>,password,useDigest=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
        Constructor
        '</span><span style="color: #483d8b;">''</span>
        <span style="color: #008000;">self</span>._user=<span style="color: #dc143c;">user</span>
        <span style="color: #008000;">self</span>._created=<span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%Y-%m-%dT%H:%M:%SZ'</span>,<span style="color: #dc143c;">time</span>.<span style="color: black;">gmtime</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>._nonce=hashlib.<span style="color: #dc143c;">new</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sha&quot;</span>,<span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">digest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>useDigest<span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>._passwordType=<span style="color: #008000;">self</span>.<span style="color: black;">PASSWORD_DIGEST_TYPE</span>
            digest=hashlib.<span style="color: #dc143c;">new</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sha&quot;</span>,<span style="color: #008000;">self</span>._nonce+<span style="color: #008000;">self</span>._created+password<span style="color: black;">&#41;</span>.<span style="color: black;">digest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            <span style="color: #008000;">self</span>._password=<span style="color: #dc143c;">binascii</span>.<span style="color: black;">b2a_base64</span><span style="color: black;">&#40;</span>digest<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>:-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #008000;">self</span>._passwordType=<span style="color: #008000;">self</span>.<span style="color: black;">PASSWORD_PLAIN_TYPE</span>
            <span style="color: #008000;">self</span>._password=password
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> sign<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,soapWriter<span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># create element</span>
        securityElem = soapWriter._header.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:Security&quot;</span><span style="color: black;">&#41;</span>
        securityElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">SEC_NS</span><span style="color: black;">&#41;</span>
        securityElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SOAP-ENV:mustunderstand&quot;</span>, <span style="color: #483d8b;">&quot;true&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        timestampElem = securityElem.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:Timestamp&quot;</span><span style="color: black;">&#41;</span>
        timestampElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">UTIL_NS</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        createdElem = timestampElem.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:Created&quot;</span><span style="color: black;">&#41;</span>
        createdElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">UTIL_NS</span><span style="color: black;">&#41;</span>
&nbsp;
        createdElem.<span style="color: black;">createAppendTextNode</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._created<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        usernameTokenElem = securityElem.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:UsernameToken&quot;</span><span style="color: black;">&#41;</span>
        usernameTokenElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">SEC_NS</span><span style="color: black;">&#41;</span>
        usernameTokenElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsu&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">UTIL_NS</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        usernameElem = usernameTokenElem.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:Username&quot;</span><span style="color: black;">&#41;</span>
        usernameElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">SEC_NS</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        passwordElem = usernameTokenElem.<span style="color: black;">createAppendElement</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;wsse:Password&quot;</span><span style="color: black;">&#41;</span>
        passwordElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;xmlns:wsse&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">SEC_NS</span><span style="color: black;">&#41;</span>
        passwordElem.<span style="color: black;">node</span>.<span style="color: black;">setAttribute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Type&quot;</span>, <span style="color: #008000;">self</span>._passwordType<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># create element</span>
        <span style="color: #808080; font-style: italic;">#nonceElem = usernameTokenElem.createAppendElement(&quot;&quot;, &quot;wsse:Nonce&quot;)</span>
        <span style="color: #808080; font-style: italic;">#nonceElem.node.setAttribute(&quot;xmlns:wsse&quot;, self.SEC_NS)</span>
&nbsp;
&nbsp;
&nbsp;
        <span style="color: #808080; font-style: italic;"># put values in elements</span>
        usernameElem.<span style="color: black;">createAppendTextNode</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._user<span style="color: black;">&#41;</span>
        passwordElem.<span style="color: black;">createAppendTextNode</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._password<span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># binascii.b2a_base64 adds a newline at the end</span>
        <span style="color: #808080; font-style: italic;">#nonceElem. createAppendTextNode(binascii.b2a_base64(self._nonce)[:-1])</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">log</span>.<span style="color: black;">debug</span><span style="color: black;">&#40;</span>soapWriter<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> verify<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,soapWriter<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span></pre></div></div>

<p><strong>Out of context snippet for connection</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">        <span style="color: #008000;">self</span>.<span style="color: black;">baseUrl</span>=baseUrl
        locator = Context_WSLocator<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">sigHandler</span> = SignatureHandler<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;session&quot;</span>,<span style="color: #483d8b;">&quot;nosession&quot;</span>,<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">port</span>=locator.<span style="color: black;">getContext_WSPortType</span><span style="color: black;">&#40;</span>baseUrl<span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">port</span>.<span style="color: black;">binding</span>.<span style="color: black;">sig_handler</span>=<span style="color: #008000;">self</span>.<span style="color: black;">sigHandler</span>
&nbsp;
        request = getServerVersionRequest<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        response = <span style="color: #008000;">self</span>.<span style="color: black;">port</span>.<span style="color: black;">getServerVersion</span><span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>
&nbsp;
        ret = response._return
        <span style="color: #008000;">self</span>.<span style="color: black;">log</span>.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Connecting to ContextWS version: %s&quot;</span> <span style="color: #66cc66;">%</span> ret._version<span style="color: black;">&#41;</span>
&nbsp;
        request = initializeVersion2Request<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        response = <span style="color: #008000;">self</span>.<span style="color: black;">port</span>.<span style="color: black;">initializeVersion2</span><span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>
        sessionId = response._return
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">sigHandler</span> = SignatureHandler<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;session&quot;</span>,sessionId,<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">port</span>.<span style="color: black;">binding</span>.<span style="color: black;">sig_handler</span>=<span style="color: #008000;">self</span>.<span style="color: black;">sigHandler</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">log</span>.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Received sessionId:%s from initializeVersion2 and set as password&quot;</span> <span style="color: #66cc66;">%</span>sessionId<span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">log</span>.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Should be all set to use other functions!&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">loginTool</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;venderId&quot;</span>,<span style="color: #483d8b;">&quot;programId&quot;</span>,<span style="color: #483d8b;">&quot;sharedSecret&quot;</span><span style="color: black;">&#41;</span>
.....
<span style="color: #ff7700;font-weight:bold;">def</span> loginTool<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,vendorId,programId,sharedSecret<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">log</span>.<span style="color: black;">debug</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;loginTool&quot;</span><span style="color: black;">&#41;</span>
        request = loginToolRequest<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        request._password = sharedSecret
        request._clientVendorId = vendorId
        request._clientProgramId = programId
&nbsp;
        response = <span style="color: #008000;">self</span>.<span style="color: black;">port</span>.<span style="color: black;">loginTool</span><span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> response._return</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2011/01/ws-security-and-python-a-blackboard-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Projects</title>
		<link>http://blog.chrisgreenough.com/2010/12/new-projects/</link>
		<comments>http://blog.chrisgreenough.com/2010/12/new-projects/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 20:14:29 +0000</pubDate>
		<dc:creator>GreenO</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=129</guid>
		<description><![CDATA[Just a quick update on Projects. We have been on a mad sprint to our first Production semester on Blackboard Learn. During this process we have been creating many different projects to solve problems and integrate BB9.1 on our campus. I will keep this post updated we release more projects to the wild. Blackboard CAS [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick update on Projects.</p>
<p>We have been on a mad sprint to our first Production semester on Blackboard Learn. During this process we have been creating many different projects to solve problems and integrate BB9.1 on our campus. I will keep this post updated we release more projects to the wild.</p>
<p><strong>Blackboard CAS Fallback Authentication Module</strong><br />
This module allows the use of CAS, LDAP and internal Bb authentication. Get more info at the URL below.<br />
<a href="http://code.google.com/p/blackboard-cas-fallback/">http://code.google.com/p/blackboard-cas-fallback/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2010/12/new-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tcl Script to Probe SSH Connections for Cisco ACE Router</title>
		<link>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/</link>
		<comments>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 19:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=110</guid>
		<description><![CDATA[We were having problems with default TCP probes on port 22 from our Cisco ACE Load Balancer showing up in our logs as bad SSH connections. I modified a Cisco TCL script for checking SSL to send a greeting to a SSH server and check that a SSH greeting is returned. It by no means [...]]]></description>
			<content:encoded><![CDATA[<p>We were having problems with default TCP probes on port 22 from our Cisco ACE Load Balancer showing up in our logs as bad SSH connections. I modified a Cisco TCL script for checking SSL to send a greeting to a SSH server and check that a SSH greeting is returned. It by no means does a complete login, but it does check to make sure the SSH service is alive. Tested on RedHat and Ubuntu. Let me know if this works on other services.</p>
<p>Ubuntu</p>
<pre>
root@***:/var/log# uname -a
Linux ***2.6.31-19-generic-pae #56-Ubuntu SMP Thu Jan 28 02:29:51 UTC 2010 i686 GNU/Linux
root@***:/var/log# ssh -V
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
</pre>
<p>Redhat</p>
<pre>
[root@*** root]# uname -a
Linux *** 2.4.21-63.ELsmp #1 SMP Wed Oct 28 23:15:46 EDT 2009 i686 i686 i386 GNU/Linux
[root@*** root]# ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
</pre>
<p>sshProbe.tcl<br />
<a href='http://blog.chrisgreenough.com/wp-content/uploads/2010/02/SSH_PROBE_SCRIPT.tcl_.txt'>SSH_PROBE_SCRIPT.tcl</a></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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!name = SSH_PROBE_SCRIPT</span>
<span style="color: #808080; font-style: italic;">########################################################################################</span>
<span style="color: #808080; font-style: italic;"># </span>
<span style="color: #808080; font-style: italic;"># Description :</span>
<span style="color: #808080; font-style: italic;">#    Script connects sends a connect request to a SSH server to see if its alive.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># ACE version :</span>
<span style="color: #808080; font-style: italic;">#   1.0+</span>
<span style="color: #808080; font-style: italic;">#    </span>
<span style="color: #808080; font-style: italic;"># Author :</span>
<span style="color: #808080; font-style: italic;">#   Chris Greenough (Chris.Greenough@nau.edu)</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Parameters :</span>
<span style="color: #808080; font-style: italic;">#   [debugFlag]</span>
<span style="color: #808080; font-style: italic;">#     debug  - default 0. Do NOT turn on while multiple probes are configured</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Example config :</span>
<span style="color: #808080; font-style: italic;">#       probe sshProbe script</span>
<span style="color: #808080; font-style: italic;">#           script SSH_PROBE [0]</span>
<span style="color: #808080; font-style: italic;"># </span>
<span style="color: #808080; font-style: italic;">########################################################################################</span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># debug procedure</span>
<span style="color: #808080; font-style: italic;"># set the EXIT_MSG environment varaible to help debug</span>
<span style="color: #808080; font-style: italic;"># also print the debug message when debug flag is on</span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">proc</span> ace_debug <span style="color: black;">&#123;</span> msg <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span> 
    <span style="color: #ff7700;font-weight:bold;">global</span> debug ip port EXIT_MSG
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #ff3333;">$msg</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: black;">&#91;</span> <span style="color: #008000;">info</span> exists ip <span style="color: black;">&#93;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: black;">&#91;</span> <span style="color: #008000;">info</span> exists port <span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span> 
	<span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #483d8b;">&quot;[ info script ]:$ip:$port: $EXIT_MSG &quot;</span>
    <span style="color: black;">&#125;</span>  
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: black;">&#91;</span> <span style="color: #008000;">info</span> exists debug <span style="color: black;">&#93;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #ff3333;">$debug</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span> 
	<span style="color: #008000;">puts</span> <span style="color: #ff3333;">$EXIT_MSG</span>
    <span style="color: black;">&#125;</span> 
<span style="color: black;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># main </span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;initializing varaible&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #483d8b;">&quot;Error config:  script SSH_PROBE  &lt;debug(0|1)&gt;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ip <span style="color: #ff3333;">$scriptprobe_env</span><span style="color: black;">&#40;</span>realIP<span style="color: black;">&#41;</span> 
<span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: #ff3333;">$scriptprobe_env</span><span style="color: black;">&#40;</span>realPort<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">## if port is 0 , use default port 22</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$port</span> == <span style="color: #ff4500;">0</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span>
    <span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: #ff4500;">22</span>
<span style="color: black;">&#125;</span> 
<span style="color: #ff7700;font-weight:bold;">set</span> debug <span style="color: black;">&#91;</span> <span style="color: #008000;">lindex</span> <span style="color: #008000;"><span style="color: #ff3333;">$argv</span></span> <span style="color: #ff4500;">0</span> <span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$debug</span> == <span style="color: #483d8b;">&quot;&quot;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span>
    <span style="color: #ff7700;font-weight:bold;">set</span> debug <span style="color: #ff4500;">0</span>
<span style="color: black;">&#125;</span> 
<span style="color: #808080; font-style: italic;"># open connection </span>
ace_debug <span style="color: #483d8b;">&quot;opening socket&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> sock <span style="color: black;">&#91;</span> <span style="color: #008000;">socket</span> <span style="color: #ff3333;">$ip</span> <span style="color: #ff3333;">$port</span> <span style="color: black;">&#93;</span>
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;setting fconfigure to binary&quot;</span>
<span style="color: #008000;">fconfigure</span> <span style="color: #ff3333;">$sock</span> -translation <span style="color: #008000;">binary</span> 
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;sending ssh client hand-shake message&quot;</span>
<span style="color: #808080; font-style: italic;"># Sending SSH-2.0-SecureCRT_6.5.0 (build 335) SecureCRT??</span>
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_hello <span style="color: #483d8b;">&quot;5353482d322e302d5365637572654352545f362e352e3020286275696c642033333529205365637572654352540d0a&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_length  <span style="color: black;">&#91;</span> <span style="color: #008000;">string</span> length <span style="color: #ff3333;">$ssh_hello</span> <span style="color: black;">&#93;</span>
<span style="color: #008000;">puts</span> -nonewline <span style="color: #ff3333;">$sock</span> <span style="color: black;">&#91;</span> <span style="color: #008000;">binary</span> <span style="color: #008000;">format</span> <span style="color: #483d8b;">&quot;H${ssh_length}&quot;</span> <span style="color: #ff3333;">$ssh_hello</span> <span style="color: black;">&#93;</span>
<span style="color: #008000;">flush</span> <span style="color: #ff3333;">$sock</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  read frist 100 bytes from server</span>
ace_debug <span style="color: #483d8b;">&quot;receiving response&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> lines <span style="color: black;">&#91;</span> <span style="color: #008000;">read</span> <span style="color: #ff3333;">$sock</span> <span style="color: #ff4500;">100</span> <span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  close connection</span>
ace_debug <span style="color: #483d8b;">&quot;closing socket&quot;</span>
<span style="color: #008000;">close</span> <span style="color: #ff3333;">$sock</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  parsing the 1st 3 bytes from the ssh headers </span>
<span style="color: #808080; font-style: italic;">#  if it is not a ssh hand shake successful message. failed the probe with exit 30002</span>
<span style="color: #808080; font-style: italic;"># If the server responds with its SSH info then it must be alive</span>
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_header <span style="color: #483d8b;">&quot;SSH&quot;</span>
&nbsp;
ace_debug <span style="color: #ff3333;">$lines</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #66cc66;">!</span><span style="color: black;">&#91;</span> <span style="color: #008000;">binary</span> <span style="color: #008000;">scan</span> <span style="color: #ff3333;">$lines</span> <span style="color: #483d8b;">&quot;@0a3&quot;</span> res <span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span> 
    ace_debug <span style="color: #483d8b;">&quot;probe fail : ssh server response parsing failure&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30002</span>
<span style="color: black;">&#125;</span> 
ace_debug <span style="color: #ff3333;">$res</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$res</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff3333;">$ssh_header</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span> 
    ace_debug <span style="color: #483d8b;">&quot;probe fail : ssh hand shake failure with $res !&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30002</span>
<span style="color: black;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">#  Everything went fine. probe exit with success exit_code 30001</span>
ace_debug <span style="color: #483d8b;">&quot;probe success&quot;</span>
<span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30001</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle RMAN backups to Amazon s3</title>
		<link>http://blog.chrisgreenough.com/2009/11/oracle-rman-backups-to-amazon-s3/</link>
		<comments>http://blog.chrisgreenough.com/2009/11/oracle-rman-backups-to-amazon-s3/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 18:45:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=104</guid>
		<description><![CDATA[Was looking into backup solutions for a big oracle database and ran across a plugin to RMAN to backup directly to s3! http://www.oracle.com/technology/software/tech/cloud/index.html Seems like a very interesting option. &#8220;As Cloud Backups are done over the public Internet, their performance is highly dependent on Internet network throughput – typically less than 1 MB/Sec per connection. [...]]]></description>
			<content:encoded><![CDATA[<p>Was looking into backup solutions for a big oracle database and ran across a plugin to RMAN to backup directly to s3! <a href="http://www.oracle.com/technology/software/tech/cloud/index.html">http://www.oracle.com/technology/software/tech/cloud/index.html</a> Seems like a very interesting option. </p>
<p>&#8220;As Cloud Backups are done over the public Internet, their performance is highly<br />
dependent on Internet network throughput – typically less than 1 MB/Sec per<br />
connection. Additionally, Cloud vendors may also throttle sessions to prevent<br />
individual users from consuming disproportionate amounts of resources.<br />
According to internal tests conducted at Oracle, Amazon S3 limits an individual<br />
session’s read/write throughput to around 2-3 MB/Sec. However by using the right<br />
Oracle Database Backup in the Cloud Page 9<br />
combination of parallelism and compression, backup speeds of up to 40-50<br />
MB/Sec were attained. &#8221; </p>
<p>Plenty fast for a great offsite backup solution! Can get a little pricy for terabytes of data, but a cheap for 100&#8242;s of gigs. May be a good solution for people in need of off site backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2009/11/oracle-rman-backups-to-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java String Performance</title>
		<link>http://blog.chrisgreenough.com/2009/11/java-string-performance/</link>
		<comments>http://blog.chrisgreenough.com/2009/11/java-string-performance/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 18:36:16 +0000</pubDate>
		<dc:creator>GreenO</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=94</guid>
		<description><![CDATA[I have know for a long time that the + operation for Strings in Java is horrible for performance. Because Strings are immutable in Java another String object is created for each +, not so good! I did notice the other day that there is a String.concat() operation. I wondered if it would run faster [...]]]></description>
			<content:encoded><![CDATA[<p>I have know for a long time that the + operation for Strings in Java is horrible for performance. Because Strings are immutable in Java another String object is created for each +, not so good! I did notice the other day that there is a String.concat() operation. I wondered if it would run faster then + or even as fast as a StringBuilder. The following is the test.</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
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Date</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">class</span> st<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> args<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Test the + operator. We know this one is bad.</span>
		<span style="color: #666666; font-style: italic;">// Its good to know its still bad in Java6</span>
		<span style="color: #000066; font-weight: bold;">long</span> t <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">100000</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
			x <span style="color: #339933;">=</span> x <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">long</span> e <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Time to use the + operations on a string: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>e<span style="color: #339933;">-</span>t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Test the String.concat method. </span>
		<span style="color: #666666; font-style: italic;">// Is it any faster?</span>
		t<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">100000</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
			x <span style="color: #339933;">=</span> x.<span style="color: #006633;">concat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		e<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Time to use the concat method on a string: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>e<span style="color: #339933;">-</span>t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Finaly out baseline. We know StringBuilder is(was)</span>
		<span style="color: #666666; font-style: italic;">// the fastest way to build Strings.</span>
		t<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		StringBuilder sb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> StringBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">100000</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
			sb.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> xx<span style="color: #339933;">=</span>sb.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		e<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Time to use a StringBuilder object: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>e<span style="color: #339933;">-</span>t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And the results are!</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">abc:~ def$ java -version
java version &quot;1.6.0_15&quot;
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
abc:~ def$ javac st.java
abc:~ def$ java st
Time to use the + operations on a string: 29464
Time to use the concat method on a string: 7075
Time to use a StringBuilder object: 2
abc:~ def$</pre></div></div>

<p>So, what did we learn? </p>
<li>The + operator and Strings is still BAD!</li>
<li>The concat method is MUCH faster then the + operator</li>
<li>The StringBuilder is still the fastest method to create a String in Java</li>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2009/11/java-string-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle, Python, and Red Hat Enterprise Linux 4 using cx_Oracle</title>
		<link>http://blog.chrisgreenough.com/2009/10/oracle-python-and-red-hat-enterprise-linux-4-using-cx_oracle/</link>
		<comments>http://blog.chrisgreenough.com/2009/10/oracle-python-and-red-hat-enterprise-linux-4-using-cx_oracle/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:34:33 +0000</pubDate>
		<dc:creator>GreenO</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[Oracle Python Red Hat Enterprise Linux cx_Oracle]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=78</guid>
		<description><![CDATA[fter a bunch of trial and error, the following packages are needed to Install <a href="http://cx-oracle.sourceforge.net/">cx_Oracle</a> for Python and the required Oracle Instant Client for Red Hat Enterprise Linux 4. Its not that this is too difficult, its that RHEL4 is old. Getting the two to place nice took a sec to figure out. This will install cx_Oracle for python that comes with RHEL4, which as of this writing is Python version 2.3.4 for Red Hat Enterprise Linux AS release 4 (Nahant Update 8). I am sure you can use the newer libraries with the a new install of Python, but I wanted to stay as close as possible to the versions supported by Red Hat. For better for worse! ;-)]]></description>
			<content:encoded><![CDATA[<p>After a bunch of trial and error, the following packages are needed to Install <a href="http://cx-oracle.sourceforge.net/">cx_Oracle</a> for Python and the required Oracle Instant Client for Red Hat Enterprise Linux 4. Its not that this is too difficult, its that RHEL4 is old. Getting the two to place nice took a sec to figure out. This will install cx_Oracle for python that comes with RHEL4, which as of this writing is Python version 2.3.4 for Red Hat Enterprise Linux AS release 4 (Nahant Update 8). I am sure you can use the newer libraries with the a new install of Python, but I wanted to stay as close as possible to the versions supported by Red Hat. For better for worse! <img src='http://blog.chrisgreenough.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>1. Download the cx_Oracle library.<br />
	wget http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-4.3.1-10g-py23-1.i386.rpm?download</p>
<p>2. Install cx_Oracle<br />
	rpm -i cx_Oracle-4.3.1-10g-py23-1.i386.rpm</p>
<p>3. Download Oracle Instant Client from the URL below. Must be logged in so do this from a browser.</p>
<p>http://download.oracle.com/otn/linux/instantclient/10204/oracle-instantclient-basiclite-10.2.0.4-1.i386.rpm</p>
<p>4. Install Oracle Instant Client<br />
	rpm -i oracle-instantclient-basic-10.2.0.4-1.i386.rpm</p>
<p>5. Add the path to the instant client libs to LD_LIBRARY_PATH.<br />
	echo &#8220;export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client/lib/:\$LD_LIBRARY_PATH&#8221; >> /etc/profile</p>
<p>Thats it! Want to be sure?</p>
<p><code>[xyz@pdq ~]$ python2<br />
Python 2.3.4 (#1, Jul 16 2009, 07:01:37)<br />
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2<br />
Type "help", "copyright", "credits" or "license" for more information.<br />
>>> import cx_Oracle<br />
>>> oraConn=cx_Oracle.Connection("username/password@server/SqlNetAlias")<br />
>>> curs = oraConn.cursor()<br />
>>> curs.execute("select 1 from dual")<br />
[<cx_Oracle.NUMBER with value None>]<br />
>>> rows = curs.fetchmany(curs.arraysize)<br />
>>> for row in rows:<br />
...     print row[0]<br />
...<br />
1<br />
>>> oraConn.close()<br />
>>> </code></p>
<p>The more I learn about cx_Oracle and Python I will try to update this space. All I know right now is that it is FAST! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2009/10/oracle-python-and-red-hat-enterprise-linux-4-using-cx_oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.915 seconds -->

