<?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/"
	xmlns:series="http://organizeseries.com/"
	>

<channel>
	<title>The Pineridge Group</title>
	<atom:link href="http://www.tpginc.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tpginc.net</link>
	<description>providing software, web and gis services</description>
	<lastBuildDate>Wed, 15 May 2013 22:38:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Python Sharing Objects across Namespaces</title>
		<link>http://www.tpginc.net/software/python-sharing-objects-across-namespaces/</link>
		<comments>http://www.tpginc.net/software/python-sharing-objects-across-namespaces/#comments</comments>
		<pubDate>Sat, 04 May 2013 00:15:20 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[undefined]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=173</guid>
		<description><![CDATA[I have an application that runs on Postgres &#38; Mysql.  Each program checks to determine the database type and then imports either postgres_db as db_util or mysql_db as db_util.  This works without a problem if all code referencing the class &#8230; <a href="http://www.tpginc.net/software/python-sharing-objects-across-namespaces/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have an application that runs on Postgres &amp; Mysql.  Each program checks to determine the database type and then imports either postgres_db as db_util or mysql_db as db_util.  This works without a problem if all code referencing the class db_util is in the __main__ module.  When I started putting code in classes <span id="more-173"></span>and importing the class, the class would throw an error: &#8220;global name &#8216;db_util&#8217; is not defined&#8221;.  What follows is a solution to this problem.  I don&#8217;t know if it is Pythonic and would like to hear any commments.</p>
<p>The Problem:</p>
<p>When a python script starts, the main script is loaded and given the __name__ of &#8216;__main__&#8217; and it is a module unto itself.  If you import a file, it creates a module with its own namespace and the two do not share, unless explicitly told to share.</p>
<p>What must be done is to develop a pattern to forces the modules to share.  But as an application developer, you must decide if the classes or instantances are to be shared and if the shared object is a global within the module (refenced by name) or within the class (referenced by self.name).</p>
<p>Another concern is that modules and classes should be stand-alone and if there are dependencies, these need to be explicitly defined in module. That way, everything needed for the code to run is defined in the code. In the long run, it should make debugging much easier.</p>
<p>The code samples that follow passes the instance, but the commented code passes the class.</p>
<p>The structure is:<br />
db_example.py<br />
|-dbi.py   (import the db module)<br />
|-dbfunct  (uses db module)</p>
<p>db_example.py</p>
<pre>#!/usr/bin/python
'''
test of scope
'''
import classes.dbi as dbi       #get db_util based on dbtype
#du=dbi.db_util               #add class to module global
du=dbi.du                       #add instance du to module global
from classes.dbfunc import dbfunc as fn

print 'globals:',dir()
print 'modules','fn:',fn,'du:',du
print ''
print 'from main'
du.m1()                  #method 1
du.m2()                  #method 2

print ''
print 'from imports'
fd=fn()
fd.ref_1()
fd.ref_2()</pre>
<p>dbi.py</p>
<pre>#database import
#put logic to get db type
#db='MySQL'
db='Postgres'
if db == 'MySQL':
from mysql_db import db_util
elif db == 'Postgres':
from postgres_db import postgres_db as db_util
du=db_util()            #create the instance

print 'dbi globals:',dir()
print ''</pre>
<p>mysql_db.py</p>
<pre>class db_util(object):
    _db='mysql'
    def __init__(self):
        print 'created',self._db,'class'
        pass

    def m1(self):
        print "this is m1 from",self._db
    def m2(self):
        print "this is m2 from",self._db</pre>
<p>postgres_db.py</p>
<pre>class postgres_db(object):

    _db='postgres'

    def __init__(self):
        print 'created',self._db,'class'

    def m1(self):
        print "this is m1 from",self._db
    def m2(self):
        print "this is m2 from",self._db</pre>
<p>dbfunc.py</p>
<pre>import dbi as dbi       #get db_util based on dbtype
#db_util=dbi.db_util       #add class to module global
du=dbi.du               #add the instance as a global
class dbfunc(object):
''' a unique function or process that justifies being a class and needs the db_util instance '''

    def print_globals(self):
        print 'from classc'
        print 'globals:',dir()
        print 'modules','ca:',ca,'CA:',ClassA
        print ''

    def ref_1(self):
        print 'from dbfunc ref_1  ==&gt;',
        du.m1()
    def ref_2(self):
        print 'from dbfunc ref_2  ==&gt;',
        du.m2()</pre>
<p>The main program imports the db import module which determines the database type and imports the appropriate db_util file. Then creates an instance of db_util as du. In the module that imports the dbi.py module, the db_util instance defined in dbi is defined in the globals for the module with the command du=dbi.du.</p>
<p>Once the concept of each module is a namespace and there is not a &#8216;global&#8217; as in C/C++, this makes sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/software/python-sharing-objects-across-namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YII under Fedora with SELinux</title>
		<link>http://www.tpginc.net/linux/yii-under-fedora-with-selinux/</link>
		<comments>http://www.tpginc.net/linux/yii-under-fedora-with-selinux/#comments</comments>
		<pubDate>Sun, 14 Oct 2012 23:47:24 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=122</guid>
		<description><![CDATA[in index.php set the timezone after the definitions #set timezone date_default_timezone_set('America/Denver'); require_once($yii); Yii::createWebApplication($config)-&#62;run(); for error CException: Application runtime path "/var/www/html/yiitest/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process. temp setting chcon -Rv &#8230; <a href="http://www.tpginc.net/linux/yii-under-fedora-with-selinux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>in index.php set the timezone after the definitions</p>
<pre>#set timezone
date_default_timezone_set('America/Denver');

require_once($yii);
Yii::createWebApplication($config)-&gt;run();</pre>
<p>for error CException:</p>
<pre>Application runtime path "/var/www/html/yiitest/protected/runtime" 
is not valid. Please make sure it is a directory writable by the Web 
server process.</pre>
<p>temp setting</p>
<pre>chcon -Rv --type=httpd_sys_content_t /var/www/html</pre>
<p>To set the context permanently:</p>
<pre>semanage fcontext -a -t httpd_sys_content_t "/path to/html(/.*)?"</pre>
<p>For full exlplanation</p>
<p>http://wiki.centos.org/HowTos/SELinux</p>
<p><a title="SELinux Howto" href="http://wiki.centos.org/HowTos/SELinux" target="_blank">SELinux HowTo</a></p>
<p>http://docs.fedoraproject.org/en-US/Fedora/13/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/yii-under-fedora-with-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL and Server Side Cursors</title>
		<link>http://www.tpginc.net/linux/mysql-and-server-side-cursors/</link>
		<comments>http://www.tpginc.net/linux/mysql-and-server-side-cursors/#comments</comments>
		<pubDate>Mon, 13 Aug 2012 15:36:29 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=80</guid>
		<description><![CDATA[Common wisdom says &#8220;MySQL does not support server side cursors&#8221;. I searched and did not find anything that indicated this was old information. After a lot of unsuccessful work to get MySQL to handle cursors with 1 million plus rows, &#8230; <a href="http://www.tpginc.net/linux/mysql-and-server-side-cursors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Common wisdom says &#8220;MySQL does not support server side cursors&#8221;. I searched and did not find anything that indicated this was old information.  After a lot of unsuccessful work to get MySQL to handle cursors with 1 million plus rows, I was directed to use Postgres.</p>
<p>After installing Postgres and running benchmarks, I was unable to get the same transaction through-put as I had achieved with MySQL. This may be a tuning issue, but after a week of working on it the best I could get was 20,000 rows per minute in Postgres versus 350,000 per minute rows in MySQL.  So back to MySql and rereading the documentation for the MySQLdb interface for Python.  Quite by accident I read about <strong>SSCursor and SSDictCursor</strong> in the Using and Extending section of the documentation.  These cursor types will open a server side cursor and will process the large transaction set.  As a bonus, it performs almost as well as the regular cursor.</p>
<p>On my i-3, 3gig memory Fedora 17 box, I am achieving over 300,000 rows per minute which is acceptable for the processes being performed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/mysql-and-server-side-cursors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgress &#8211; Fedora 17 Login Problem</title>
		<link>http://www.tpginc.net/linux/postgress-fedora-17-login-problem/</link>
		<comments>http://www.tpginc.net/linux/postgress-fedora-17-login-problem/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 00:08:43 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[fedora 17]]></category>
		<category><![CDATA[phppgadmin]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=73</guid>
		<description><![CDATA[Upgraded from Fedora 15 to Fedora 17 and installed Postgres db as I needed the functionality of a server-side query.  After the upgrade, I was unable to log on to phpPgAdmin and in the httpd error log I was seeing &#8230; <a href="http://www.tpginc.net/linux/postgress-fedora-17-login-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Upgraded from Fedora 15 to Fedora 17 and installed Postgres db as I needed the functionality of a server-side query.  After the upgrade, I was unable to log on to phpPgAdmin and in the httpd error log I was seeing the message.</p>
<pre>PHP Strict Standards:  Only variables should be passed
 by reference in /usr/share/phpPgAdmin/redirect.php on line 14</pre>
<p>Finally, I thought about SELinux and in the boolean options section there is an option</p>
<pre>apache - Allow HTTPD scripts and modules to access databases</pre>
<p>I enabled this option and the problem is solved.</p>
<p>For those who use the command line</p>
<pre dir="ltr">setsebool -P httpd_can_network_connect_db 1</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/postgress-fedora-17-login-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Child theme based on Zenon Pro</title>
		<link>http://www.tpginc.net/wordpress/create-child-theme-based-on-zenon/</link>
		<comments>http://www.tpginc.net/wordpress/create-child-theme-based-on-zenon/#comments</comments>
		<pubDate>Mon, 28 May 2012 21:29:02 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=70</guid>
		<description><![CDATA[If you are using the WordPress Zenon theme and  need to make some heavy customization, you may want to follow the best practices to create a child theme. Unfortunately, the Zenon theme does not support the child themes due to &#8230; <a href="http://www.tpginc.net/wordpress/create-child-theme-based-on-zenon/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you are using the WordPress Zenon theme and  need to make some heavy customization, you may want to follow the best practices to create a child theme. Unfortunately, the Zenon theme does not support the child themes due to some inconsistent coding.  The following patches to the main theme will allow the support child themes.  This code should work for the Lite and Pro version, but it has not been tested on the Lite version.  The code was passed back to the theme developer for inclusion in future releases and hopefully a future release will include it.<span id="more-70"></span> In case you need the patch before it is released into the theme, here it is:</p>
<p>in functions.php</p>
<p>at line 450</p>
<p style="padding-left: 30px;"><code>if ( STYLESHEETPATH == TEMPLATEPATH ) {<br />
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');<br />
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');<br />
} else {<br />
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');<br />
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');<br />
}</code></p>
<p>change to</p>
<p style="padding-left: 30px;"><code>if (is_dir(STYLESHEETPATH.'/admin/')) {<br />
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');<br />
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');<br />
} else {<br />
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');<br />
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');<br />
}</code></p>
<p>in options.php</p>
<p>at line 79</p>
<p style="padding-left: 30px;"><code>$imagepath = get_stylesheet_directory_uri() . '/admin/images/';</code></p>
<p>change to</p>
<p style="padding-left: 30px;"><code>$imagepath = OPTIONS_FRAMEWORK_DIRECTORY . 'images/';</code></p>
<p>in admin/options_framework.php</p>
<p>at line 194</p>
<p style="padding-left: 30px;"><code>jQuery('#of-option-documentation').load('<!--?php echo get_stylesheet_directory_uri(); ?-->/admin/documentation.php', function(){<br />
jQuery.getScript("<!--?php echo get_stylesheet_directory_uri(); ?-->/admin/js/external.js", function(){});<br />
});<br />
});<br />
jQuery('#of-option-about').load('<!--?php echo get_stylesheet_directory_uri(); ?-->/admin/about.php')<br />
jQuery('#of-option-upgrade').load('<!--?php echo get_stylesheet_directory_uri(); ?-->/admin/upgrade.php')<br />
});</code></p>
<p>change to</p>
<p style="padding-left: 30px;"><code>jQuery('#of-option-documentation').load('<!--?php echo OPTIONS_FRAMEWORK_DIRECTORY; ?-->documentation.php', function(){<br />
jQuery.getScript("<!--?php echo OPTIONS_FRAMEWORK_DIRECTORY; ?-->js/external.js", function(){});<br />
});<br />
});<br />
jQuery('#of-option-about').load('<!--?php echo OPTIONS_FRAMEWORK_DIRECTORY; ?-->about.php')<br />
jQuery('#of-option-upgrade').load('<!--?php echo OPTIONS_FRAMEWORK_DIRECTORY; ?-->upgrade.php')<br />
});</code></p>
<p>In header.php line 8 change (thanks to Arne for this update) :</p>
<p style="padding-left: 30px;"><code>&lt;link rel="stylesheet" media="only screen and (max-width: 480px)" href="&lt;?php echo get_template_directory_uri();?&gt;/mobile.css" /&gt;</code></p>
<p>to:</p>
<p style="padding-left: 30px;"><code>&lt;link rel="stylesheet" media="only screen and (max-width: 480px)" href="&lt;?php echo get_stylesheet_directory_uri();?&gt;/mobile.css" /&gt;</code></p>
<p>That should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/wordpress/create-child-theme-based-on-zenon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Address Parsing Routine</title>
		<link>http://www.tpginc.net/software/address-parsing-routine/</link>
		<comments>http://www.tpginc.net/software/address-parsing-routine/#comments</comments>
		<pubDate>Thu, 10 May 2012 04:39:21 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[address parse]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=65</guid>
		<description><![CDATA[To support a marketing project, I developed a screen scraping  program which harvested names and addresses from a county public website and downloaded the information in a csv format.  This file was then edited in Excel and mail merged to &#8230; <a href="http://www.tpginc.net/software/address-parsing-routine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To support a marketing project, I developed a screen scraping  program which harvested names and addresses from a county public website and downloaded the information in a csv format.  This file was then edited in Excel and mail merged to a Word document, saving hours of labor each week.</p>
<p>One challenge of the project was to cleanse the addresses to reduced the number of returns from the mailing due to invalid addresses.  As part of the cleansing process, the address was run through a parser written in PHP.  This code was found online and was a good starting spot. However, there were some problems with parsing streets, cities and states that had two words.  Several modifications later, some of the problems were cleared up, but several adjustments are still pending.</p>
<p>I made the changes needed for the project, but time did not permit correcting all the issues.</p>
<p>The updates address parse routine can be located at <a href="http://github.com/cswaim/" target="_blank">http:github.com/cswaim</a>.  Let me hear how you are using this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/software/address-parsing-routine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trimble Standard Interface Protocol (TSIP)</title>
		<link>http://www.tpginc.net/linux/trimble-standard-interface-protocol-tsi/</link>
		<comments>http://www.tpginc.net/linux/trimble-standard-interface-protocol-tsi/#comments</comments>
		<pubDate>Thu, 03 May 2012 04:30:02 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[trimble standard interface protocol]]></category>
		<category><![CDATA[tsip]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=63</guid>
		<description><![CDATA[For a recent project, the client required that several remote computers be time synch&#8217;ed by a Trimble GPS unit.  The software running on the remote computers was written in C++.  I was unable to find a generalized routine to get &#8230; <a href="http://www.tpginc.net/linux/trimble-standard-interface-protocol-tsi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For a recent project, the client required that several remote computers be time synch&#8217;ed by a Trimble GPS unit.  The software running on the remote computers was written in C++.  I was unable to find a generalized routine to get the gps time, but I did locate some code that defined all the command and report messages, so using that base code, I developed a routine to issue commands to the gps and process the returned messages.</p>
<p>I have posted the class in a github repository and have included as sample driver.  You can find the repository at<a title="GITHUB tsip" href="http://github.com/cswaim/gps" target="_blank"> http://github.com/cswaim/gps</a>.  If you use this, let me hear how you are using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/trimble-standard-interface-protocol-tsi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin Update</title>
		<link>http://www.tpginc.net/wordpress/plugin-update/</link>
		<comments>http://www.tpginc.net/wordpress/plugin-update/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 21:49:25 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=43</guid>
		<description><![CDATA[I heard from several international friends this weekend after updating the tpg_get_posts plugin.  They all had the same message, &#8220;your upgrade broke my website&#8221; or variants of that message.  And they were right. The change was to allow any of &#8230; <a href="http://www.tpginc.net/wordpress/plugin-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I heard from several international friends this weekend after updating the tpg_get_posts plugin.  They all had the same message, &#8220;your upgrade broke my website&#8221; or variants of that message.  And they were right.<span id="more-43"></span></p>
<p>The change was to allow any of the get_posts options to be used in the shortcode, instead of just the ones predefined in the default table.  Simple.  For the record, I had tested the change and it was working on two sights. So I pushed it to the WordPress plugin site.</p>
<p>I started getting messages the plugin was throwing errors, but I could not recreate the problem.  Finally, someone sent me the shortcode being used that was causing the problem.  Just the shortcode, no parameters.  My tests did not include testing with no parameters being passed in the shortcode.  But once I saw the shortcode, the problem was obvious.  By the way, this no parameter test has now been added to my test site.</p>
<p>Not the best way to meet new friends, but it was nice to hear that people were actually using the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/wordpress/plugin-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Access to MySQL on Fedora</title>
		<link>http://www.tpginc.net/linux/remote-access-to-mysql-on-fedora/</link>
		<comments>http://www.tpginc.net/linux/remote-access-to-mysql-on-fedora/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 21:24:42 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=42</guid>
		<description><![CDATA[A recent project which involved working with MySQL Workbench and accessing a MySQL database on a Fedora 14 computer has proven to be a challenge in getting the connection established. Besides receiving rather meaningless errors Error connecting SSH tunnel: Could &#8230; <a href="http://www.tpginc.net/linux/remote-access-to-mysql-on-fedora/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A recent project which involved working with MySQL Workbench and accessing a MySQL database on a Fedora 14 computer has proven to be a challenge in getting the connection established. Besides receiving rather meaningless errors<span id="more-42"></span></p>
<pre>Error connecting SSH tunnel: Could not open socket to *addr*
-or-
Can't connect to MySQL server on 127.0.0.1 (10061)</pre>
<p>which may be a result of my not knowing how to read them &#8211; there was nothing to indicate what was causing the problem.</p>
<p>I added the following<span style="font-family: Helvetica,Arial,sans-serif;"> to the /etc/sysconfig/iptables</span></p>
<pre><span style="font-family: Helvetica,Arial,sans-serif;"><span style="font-family: Helvetica,Arial,sans-serif;"> -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT</span></span></pre>
<p>but the connection still failed.</p>
<p>I finally found a clue when I tried to connect locally to a Fedora system and saw security message pop up on the Fedora box.  Of course I did not write it down, but it pointed me to the setting for  SELinux Management.  Going to System/Administration/SELinux Management on the Fedora computer hosting MySQL, I started looking at the ssh options under the Boolean selection menu.  I turned on the</p>
<pre> allow sshd to forward port connections</pre>
<p>and that was all it took.</p>
<p>I am unsure what security holes this opens, but it allows Workbench to connect and that helps me manage the remote database.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/remote-access-to-mysql-on-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH to Remote Site without password</title>
		<link>http://www.tpginc.net/linux/ssh-to-remote-site/</link>
		<comments>http://www.tpginc.net/linux/ssh-to-remote-site/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 03:56:26 +0000</pubDate>
		<dc:creator>cswaim</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tpginc.net/?p=39</guid>
		<description><![CDATA[When running ssh or scp from a script, there is a need to establish a connection to the remote site without being prompted for a password.  This quick reference should get the job done. Create Public Key Authentication # ssh-keygen &#8230; <a href="http://www.tpginc.net/linux/ssh-to-remote-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When running ssh or scp from a script, there is a need to establish a connection to the remote site without being prompted for a password.  This quick reference should get the job done.<span id="more-39"></span></p>
<h2>Create Public Key Authentication</h2>
<pre># ssh-keygen -t rsa</pre>
<p>Press enter twice to create a key without a pass phrase. Then copy .ssh/id_rsa.pub to remote computer, placing it in the .ssh folder.</p>
<pre> # scp .ssh/id_rsa.pub userid@xxxxxxx:.ssh/id_ras.pub</pre>
<h2>Logon to remote computer and build authorized key ring</h2>
<p>To add the new key to the authorized keys, append the new key to authorized_keys file.  Note the access level of the file should be 600.  SSH is very picky about this and may not accept a less restrictive access setting.</p>
<pre># cd .ssh
# cat id_ras.pub &gt;&gt; authorized_keys
# chmod 600 authorized_keys</pre>
<p>Finally, logout of the remote computer and logoff and log back on local/client computer &#8211; do not skip this step if you generated the key in this session.</p>
<p>Test the change by ssh to site.  If no password is requested, it worked.</p>
<h2>Debugging</h2>
<p>If the ssh test prompts for the password,  then rerun ssh with the option -vvv to get the detailed debugging information.</p>
<p>1) Make sure you logged out of the local account and back in.  This reloads the credentials.</p>
<p>2) Make sure the id_rsa.pub file was appended to the authorized_keys</p>
<p>3) Verify the permissions on the file (600 works for me on Fedora 14) and 700 on the .ssh folder.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tpginc.net/linux/ssh-to-remote-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
