<?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>infinite possibility</title>
	<atom:link href="http://anypossibility.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://anypossibility.com/blog</link>
	<description>Naoko Reeves&#039;s Blog</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:32:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PostgreSQL Utility for EnterpriseDB Installation</title>
		<link>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/</link>
		<comments>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 05:00:05 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=382</guid>
		<description><![CDATA[PostgreSQL Installer provided by EnterpriseDB is so handy and make your life very easy for OS X Desktop installation. Maybe I just don&#8217;t know the handy utility but I wrote a shell script to control/display various tasks hence I wanted to share this with you. The utility contains: start &#124; stop &#124; restart &#124; stopfast [...]]]></description>
			<content:encoded><![CDATA[<p>PostgreSQL Installer provided by EnterpriseDB is so handy and make your life very easy for OS X Desktop installation.</p>
<p>Maybe I just don&#8217;t know the handy utility but I wrote a shell script to control/display various tasks hence I wanted to share this with you.</p>
<p>The utility contains: start | stop | restart | stopfast | stopnow | status | vac_status | show_connections | version | restore backup</p>
<blockquote>
<pre></pre>
<pre>NODE_NAME=`uname -n`</pre>
<pre>NODE_NAME=${NODE_NAME%%\.*local}</pre>
<pre>NODE_NUMBER=${NODE_NAME##*SQL-}</pre>
<pre>PGBIN=/Library/PostgreSQL/9.1/bin</pre>
<pre>PGDATA=/Library/PostgreSQL/9.1/data</pre>
<pre>pidof(){</pre>
<pre># usage: `pidof`</pre>
<pre>ps -ef | grep postgres | awk '{if ($3==1)print $2}'</pre>
<pre>}</pre>
<pre>start(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" == "" ] ; then</pre>
<pre>echo "Starting postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl -w start -D ${PGDATA} -l ${PGDATA}/pg_log/startup.log"</pre>
<pre>else</pre>
<pre>status</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stop(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m smart -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stopfast(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m fast -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stopnow(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m immediate -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>status(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "postgres is running"</pre>
<pre>echo `ps -ef | grep postgres | grep -v grep | awk '{if ($3==1) print "Postgres: " $8 ", Data Directory: " $10}'`</pre>
<pre>else</pre>
<pre>echo "postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>vac_status(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"select relname, last_autovacuum, last_autoanalyze from pg_stat_user_tables where last_autovacuum IS NOT NULL order by last_autovacuum desc\""</pre>
<pre>}</pre>
<pre>show_connections(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"SELECT datname, usename, procpid, client_addr, waiting, query_start, current_query FROM pg_stat_activity;\""</pre>
<pre>}</pre>
<pre>version(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"SELECT version()\""</pre>
<pre>}</pre>
<pre>restore_bak(){</pre>
<pre>echo "backup file path : "</pre>
<pre>read BACKUPFILEPATH</pre>
<pre>echo "database name : "</pre>
<pre>read DBNMAE</pre>
<pre>chmod -R 777 $BACKUPFILEPATH</pre>
<pre>cat ${BACKUPFILEPATH} | gunzip | ${PGBIN}/psql -U postgres ${DBNMAE}</pre>
<pre>${PGBIN}/psql -d ${DBNMAE} -U postgres &lt; /users.sql</pre>
<pre>}</pre>
<pre>case "$1" in</pre>
<pre>start)</pre>
<pre>start</pre>
<pre>;;</pre>
<pre>stop)</pre>
<pre>stop</pre>
<pre>;;</pre>
<pre>status)</pre>
<pre>status</pre>
<pre>;;</pre>
<pre>restart)</pre>
<pre>stop</pre>
<pre>start</pre>
<pre>;;</pre>
<pre>stopfast)</pre>
<pre>stopfast</pre>
<pre>;;</pre>
<pre>stopnow)</pre>
<pre>stopnow</pre>
<pre>;;</pre>
<pre>vac_status)</pre>
<pre>vac_status</pre>
<pre>;;</pre>
<pre>show_connections)</pre>
<pre>show_connections</pre>
<pre>;;</pre>
<pre>restore_bak)</pre>
<pre>restore_bak</pre>
<pre>;;</pre>
<pre>version)</pre>
<pre>version</pre>
<pre>;;</pre>
<pre>*)</pre>
<pre>echo "Usage: $0 { start | stop | restart | stopfast | stopnow | status | vac_status | show_connections | version | restore_bak }"</pre>
<pre>exit 1</pre>
<pre>esac</pre>
<pre>exit 0</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL DB Version Control with apgdiff</title>
		<link>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/</link>
		<comments>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 04:05:41 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=378</guid>
		<description><![CDATA[apgdiff (Another PostgreSQL Diff Tool) is so easy to setup and use. # you need at least Java 1.6 $ java -version java version &#8220;1.6.0_29&#8243; Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) # download binary and that&#8217;s it. $ curl -O http://apgdiff.startnet.biz/download/apgdiff-2.3-bin.zip $ unzip apgdiff-2.3-bin.zip # create [...]]]></description>
			<content:encoded><![CDATA[<p><a title="apgdiff" href="http://apgdiff.startnet.biz/">apgdiff </a>(Another PostgreSQL Diff Tool) is so easy to setup and use.</p>
<p># you need at least Java 1.6</p>
<blockquote><p>$ java -version</p>
<p>java version &#8220;1.6.0_29&#8243;<br />
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)<br />
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)</p></blockquote>
<p># download binary and that&#8217;s it.</p>
<blockquote><p>$ curl -O http://apgdiff.startnet.biz/download/apgdiff-2.3-bin.zip<br />
$ unzip apgdiff-2.3-bin.zip</p></blockquote>
<p># create SQL dump files</p>
<blockquote><p>$ pg_dump &#8211;host HOST_IP &#8211;port 5432 -U DB_USER -s -f new.sql ALPHA_DB<br />
$ pg_dump &#8211;host HOST_IP &#8211;port 5432 -U USER -s -f old.sql PROD_DB</p></blockquote>
<p># generate upgrade statement</p>
<blockquote><p>$ PATH_TO_APGDIFF=/tmp/apgdiff<br />
$ java -jar $PATH_TO_APGDIFF/apgdiff-2.3.jar &#8211;ignore-start-with old.sql new.sql &gt; upgrade.sql</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Know how to use Chrome developer tools I &#8211; Disable Cache</title>
		<link>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/</link>
		<comments>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 21:50:37 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=366</guid>
		<description><![CDATA[1. Open Web Developer Tools (Option + Command + i) or (Menu &#62; View &#62; Developer &#62; Developer Tools &#160; &#160; &#160; &#160; 2. Disable Cache 2.1. Go to Settings 2.1.1. Click Gear icon on lower bottom 2.1.2. Check Disable Cache &#160;]]></description>
			<content:encoded><![CDATA[<p>1. Open Web Developer Tools<br />
(Option + Command + i) or (Menu &gt; View &gt; Developer &gt; Developer Tools</p>
<p><a href="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.26.41-PM.png"><img class="alignleft size-medium wp-image-368" title="Screen shot 2012-01-29 at 2.26.41 PM" src="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.26.41-PM-300x124.png" alt="" width="300" height="124" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2. Disable Cache</p>
<p>2.1. Go to Settings</p>
<p>2.1.1. Click Gear icon on lower bottom</p>
<p>2.1.2. Check Disable Cache</p>
<p><a href="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.27.28-PM1.png"><img class="alignleft size-large wp-image-373" title="Screen shot 2012-01-29 at 2.27.28 PM" src="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.27.28-PM1-1024x181.png" alt="" width="1024" height="181" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python &#8211; Calling Python Function From Terminal</title>
		<link>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/</link>
		<comments>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 02:00:33 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=347</guid>
		<description><![CDATA[#!/usr/local/bin/python # how to call this # $ python /Users/nreeves/Desktop/test.py greeting &#8220;How are you?&#8221; # &#62;&#62; Hello greeting # $ python /Users/nreeves/Desktop/test.py food &#8220;Rice&#8221; &#8220;Potato&#8221; # &#62;&#62;I want to eat food and food # $ python /Users/nreeves/Desktop/test.py foo &#8220;bar&#8221; # &#62;&#62;programmer error! import sys def greeting(arg1):     print&#8216;Hello%s&#8216;% (arg1) def food(arg1, arg2):     print&#8216;I want to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #808080;">#!/usr/local/bin/python</span><br />
<span style="color: #808080;"># how to call this</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py greeting &#8220;How are you?&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt; Hello greeting</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py food &#8220;Rice&#8221; &#8220;Potato&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt;I want to eat food and food</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py foo &#8220;bar&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt;programmer error!</span></p>
<p><span style="color: #ff6600;">import </span><span style="color: #800000;">sys</span></p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">greeting</span>(arg1):<br />
<span style="color: #ff6600;">    print</span><span style="color: #008000;">&#8216;Hello</span><span style="color: #800000;">%s</span><span style="color: #008000;">&#8216;</span><span style="color: #ff6600;">%</span> (arg1)</p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">food</span>(arg1, arg2):<br />
<span style="color: #ff6600;">    print</span><span style="color: #008000;">&#8216;I want to eat</span><span style="color: #800000;">%s</span><span style="color: #008000;">and</span><span style="color: #800000;">%s</span><span style="color: #008000;">&#8216;</span><span style="color: #ff6600;">%</span> (arg1, arg2)</p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">main</span>():<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 1: function<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 2: arg1<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 3: arg2<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]</p>
<p><span style="color: #ff6600;">    if</span> function <span style="color: #ff6600;">==</span><span style="color: #008000;">&#8220;greeting&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;greeting(arg1)<br />
<span style="color: #ff6600;">    elif</span> function <span style="color: #ff6600;">==</span><span style="color: #008000;">&#8220;food&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;food(arg1, arg2)<br />
<span style="color: #ff6600;">    else</span>:<br />
<span style="color: #ff6600;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print</span><span style="color: #008000;">&#8220;programmer error!&#8221;</span></p>
<p><span style="color: #ff6600;">if</span> <span style="color: #0000ff;">__name__</span> <span style="color: #ff6600;">==</span> <span style="color: #008000;">&#8220;__main__&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;main()</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL &#8211; Document PostgreSQL functions</title>
		<link>http://anypossibility.com/blog/2012/01/document-postgresql-functions/</link>
		<comments>http://anypossibility.com/blog/2012/01/document-postgresql-functions/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 19:25:46 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=338</guid>
		<description><![CDATA[Yep, documentation is critical. Everyone knows that Search-ability of the documentation is critical as documentation. We started to document postgreSQL trigger/functions and created view to list function name, definition and comments etc&#8230; It is pretty handy and would like to share this with you. &#8211; Add Comments COMMENT ON FUNCTION my_function(text) IS &#8216;function description&#8217;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, documentation is critical. Everyone knows that <img src='http://anypossibility.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Search-ability of the documentation is critical as documentation.</p>
<p>We started to document postgreSQL trigger/functions and created view to list function name, definition and comments etc&#8230; It is pretty handy and would like to share this with you.</p>
<p>&#8211; Add Comments</p>
<blockquote><p>COMMENT ON FUNCTION my_function(text) IS &#8216;function description&#8217;;</p></blockquote>
<p>&nbsp;</p>
<p>&#8211; Search by Comments</p>
<blockquote><p>SELECT * from pg_catalog.pg_description WHERE description = &#8216;function description&#8217;; &#8212; Search for Specific description</p></blockquote>
<p>&nbsp;</p>
<p>&#8211; List All Functions along with Comments</p>
<blockquote><p>SELECT p.proname<br />
,p.proargnames<br />
,obj_description(p.oid)<br />
,pg_get_functiondef(p.oid)<br />
,CASE WHEN p.prorettype=2279 THEN &#8216;Trigger Function&#8217; ELSE &#8216;Function&#8217; END as type<br />
FROM pg_proc p<br />
JOIN pg_namespace nspance ON nspance.oid = p.pronamespace<br />
WHERE<br />
nspname=&#8217;public&#8217; AND proowner &lt;&gt; 10<br />
&#8211; AND proname = &#8216;my_function&#8217; &#8212; Search for Specific function<br />
&#8211; AND p.prorettype=2279 &#8212; Triggere Function Only<br />
ORDER BY 5, 1</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/document-postgresql-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Python2.7.2, apache, wsgi on Ubuntu 10.04 LTS</title>
		<link>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/</link>
		<comments>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 02:30:30 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=323</guid>
		<description><![CDATA[My initial attept failed miserably as you can see my post from here&#8230; After bunch of help from many intelligent people I successfully setup Python2.7.2, apache, wsgi for Ubunut 10.04 LTS ++++++++++++++++++++++++++++++ + References: + 1. How to install 2.7 comment made by Alen here + 2. How to install wsgi ++++ # ==== Setup [...]]]></description>
			<content:encoded><![CDATA[<p>My initial attept failed miserably as you can see my post from <a href="http://stackoverflow.com/questions/7561221/undefined-symbol-pyobject-nextnotimplemented-error-when-loading-psycopg2-modu">here</a>&#8230;</p>
<p>After bunch of help from many intelligent people I successfully setup Python2.7.2, apache, wsgi for Ubunut 10.04 LTS</p>
<p>++++++++++++++++++++++++++++++<br />
+ References:<br />
+ 1. How to install 2.7 comment made by Alen <a href="http://askubuntu.com/questions/17841/will-python2-7-be-available-for-lucid-in-future ">here</a><br />
+ 2. <a href="http://grok.zope.org/documentation/tutorial/installing-and-setting-up-grok-under-mod-wsgi/installing-and-configuring-mod-wsgi ">How to install wsgi</a><br />
++++</p>
<blockquote><p># ==== Setup Ubuntu 10.04 on VMWare # on server:<br />
# install basic stuff&#8230;<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
sudo apt-get install openssh-server # only if you want to use ssh<br />
sudo apt-get install vim # only if you like vim&#8230;.<br />
sudo apt-get install libpq-dev<br />
sudo apt-get install curl # only if you like over wget.. I am just so used to curl over wget since os-x (my dev machine) doesn&#8217;t have wget<br />
sudo apt-get install build-essential</p></blockquote>
<p>##### # Install Python 2.7.2 #####</p>
<blockquote><p>sudo vim /etc/apt/sources.list</p></blockquote>
<p># add the following 2 lines at the bottom of the file:</p>
<blockquote><p>deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main<br />
deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main</p></blockquote>
<p># issue the following command:</p>
<blockquote><p>sudo apt-key adv &#8211;keyserver keyserver.ubuntu.com &#8211;recv-keys DB82666C<br />
sudo apt-get update<br />
sudo apt-get install python2.7 python2.7-dev</p></blockquote>
<p># verify instllation</p>
<blockquote><p>which python &gt;&gt;/usr/local/bin/python<br />
python -V &gt;&gt; Python 2.7.2</p></blockquote>
<p># verify the linkage</p>
<blockquote><p>ldd /usr/local/bin/python2.7</p></blockquote>
<p>##### # Install Apache #####<br />
# you need to install apache2-dev for wsgi installation</p>
<blockquote><p>sudo apt-get install apache2 apache2-dev</p></blockquote>
<p># then add domain.</p>
<blockquote><p>sudo vim /etc/apache2/conf.d/fqdn<br />
# add: &#8220;ServerName localhost&#8221; without quotes</p></blockquote>
<p>################################<br />
# install wsgi<br />
################################<br />
# if wsgi is installed via apt-get then purge it:</p>
<blockquote><p>sudo apt-get purge libapache2-mod-wsgi</p>
<p>mkdir tmp # or wherever you want to compile<br />
cd tmp<br />
curl -O http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz tar xzf mod_wsgi-3.3.tar.gz<br />
rm mod_wsgi-3.3.tar.gz<br />
cd mod_wsgi-3.3 ./configure &#8211;with-python=/usr/local/bin/python make sudo make install<br />
# the load declaration for the module needs to go wsgi.load<br />
sudo vim /etc/apache2/mods-available/wsgi.load<br />
# then add the following line: &#8220;LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so&#8221; without quotes<br />
# Then you have to activate the wsgi module with:<br />
sudo a2enmod wsgi</p></blockquote>
<p># That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open SSH (Port 22) on Fedora 15</title>
		<link>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/</link>
		<comments>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 01:13:14 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=313</guid>
		<description><![CDATA[So Fedora 15 with GNOME 3 is very beautiful. I really like it. Mac&#8217;s spotlight like search is +1. I had a bit hard time accessing my macbook to Fedora 15 via SSH so I thought I should share this with you. 1. Modify sshd_conf file (/etc/ssh/sshd_config): Find Line &#8220;Port 22&#8243; and uncomment the line [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000080;">So Fedora 15 with GNOME 3 is very beautiful. I really like it. Mac&#8217;s spotlight like search is +1.</span></p>
<p><span style="color: #000080;">I had a bit hard time accessing my macbook to Fedora 15 via SSH so I thought I should share this with you.</span></p>
<p><span style="color: #000080;">1. Modify sshd_conf file (/etc/ssh/sshd_config): Find Line &#8220;Port 22&#8243; and uncomment the line</span></p>
<p><span style="color: #000080;">2. Restart sshd service by issuing </span></p>
<blockquote><p><span style="color: #000080;">$ service sshd stop$ service sshd restart</span></p></blockquote>
<p><span style="color: #000080;">3. Let&#8217;s check to see if sshd is running</span></p>
<blockquote><p><span style="color: #000080;">$ service sshd status# or you could$ ps aux|grep sshd</span></p></blockquote>
<p><span style="color: #000080;">3. Okay, let&#8217;s test it. Go to client (my case is my macbook) and issued $ ssh username@ip_address Connect then I got <em>&#8220;Connection Refused&#8221;</em> Error. So looks like I need to mess with firewall (iptables).</span></p>
<p><span style="color: #000080;">3.1 Edit file /etc/sysconfig/iptables and add the following line. Note that this should go above the first instance of -A INPUT otherwise other rule might block you as rule will will be read from top down and stops as soon as it meets the rule.</span></p>
<blockquote>
<div><span style="color: #000080;"># to open ssh</span><br />
<span style="color: #000080;"> -A INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 22 -j ACCEPT</span></div>
</blockquote>
<div><span style="color: #000080;">3.2. Save and close the file and restart iptables as follows:</span></div>
<blockquote>
<div><span style="color: #000080;">$ service iptables restart</span></div>
</blockquote>
<div><span style="color: #000080;">4. Then try this again: $ ssh username@ip_address Hopefully you are connected&#8230;.</span></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL &#8211; Document Table and Column Description (Comments on Table and Column)</title>
		<link>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/</link>
		<comments>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 04:08:27 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=303</guid>
		<description><![CDATA[&#8211; Add comment to table COMMENT ON TABLE fnl is &#8216;Customer Information&#8217; &#8211; Add comment to column COMMENT ON COLUMN customer.id is &#8216;customer primary key&#8217; &#160; &#8211; Retrieve Info Individually SELECT col_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;), 1) SELECT obj_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;)) &#160; &#8211; Retrieve Info [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8211; Add comment to table</p>
<p>COMMENT ON TABLE fnl is &#8216;Customer Information&#8217;</p>
<p>&#8211; Add comment to column</p>
<p>COMMENT ON COLUMN customer.id is &#8216;customer primary key&#8217;</p>
<p>&nbsp;</p>
<p>&#8211; Retrieve Info Individually</p>
<p>SELECT col_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;), 1)</p>
<p>SELECT obj_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;))</p>
<p>&nbsp;</p>
<p>&#8211; Retrieve Info for one table</p>
<p>SELECT</p>
<p>cols.column_name</p>
<p>,(select pg_catalog.obj_description(oid) from pg_catalog.pg_class c where c.relname=cols.table_name) as table_comment</p>
<p>,(select pg_catalog.col_description(oid,cols.ordinal_position::int) from pg_catalog.pg_class c where c.relname=cols.table_name) as column_comment</p>
<p>FROM information_schema.columns cols</p>
<p>WHERE cols.table_catalog=&#8217;database_name&#8217; and cols.table_name=&#8217;customer&#8217;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>postgreSQL &#8211; inconsistent performance</title>
		<link>http://anypossibility.com/blog/2011/08/postgresql-inconsistent-performance/</link>
		<comments>http://anypossibility.com/blog/2011/08/postgresql-inconsistent-performance/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 03:55:53 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=297</guid>
		<description><![CDATA[We have this query to join 4 tables. For some reason, the performance of this query was inconsistent on Server A. First run took 6 sec, 2nd run took 300 ms then 3rd run took 6 sec again etc&#8230; We dump the data to other server and run the same query, very consistent result &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>We have this query to join 4 tables.</p>
<p>For some reason, the performance of this query was inconsistent on Server A. First run took 6 sec, 2nd run took 300 ms then 3rd run took 6 sec again etc&#8230;</p>
<p>We dump the data to other server and run the same query, very consistent result &#8211; about 100 ms almost all the time.</p>
<p>We even got &#8220;<em>could not read from hash-join temporary file</em>&#8221; error and crashed Server A. We end up finding out that work_mem of the Server A is set to very low compare to other servers.</p>
<p>So followed this: http://wiki.postgresql.org/wiki/Performance_Optimization and we changed 2 settings:</p>
<p>work_mem to 16MB &#8211; default is 1MB and it was the default value</p>
<p>effective_cache_size &#8211; this one was also default of 128MB&#8230; so I set it to 3GB (machie has 6 GB and according to the wiki, half of the size of RAM would be good)</p>
<p>Then restart the server and yes, the performance was so consistent and was producing the same result as other server.</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/postgresql-inconsistent-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get IP address on your mac from Terminal</title>
		<link>http://anypossibility.com/blog/2011/08/how-to-get-ip-address-on-your-mac-from-terminal/</link>
		<comments>http://anypossibility.com/blog/2011/08/how-to-get-ip-address-on-your-mac-from-terminal/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 03:40:58 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=294</guid>
		<description><![CDATA[This will give you ethernet one ifconfig en0 &#124; grep &#8216;inet &#8216; &#124; cut -d &#8216; &#8216; -f2 This will give you airport one ifconfig en1 &#124; grep &#8216;inet &#8216; &#124; cut -d &#8216; &#8216; -f2 so if you are writing script to get your IP in either case you could: MYIP=`ifconfig en0 &#124; grep [...]]]></description>
			<content:encoded><![CDATA[<p>This will give you ethernet one</p>
<blockquote><p>ifconfig en0 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2</p></blockquote>
<p>This will give you airport one</p>
<blockquote><p>ifconfig en1 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2</p></blockquote>
<p>so if you are writing script to get your IP in either case you could:</p>
<blockquote>
<div id="_mcePaste">MYIP=`ifconfig en0 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2`</div>
<div id="_mcePaste">if [$MYIP -eq '']; then</div>
<div id="_mcePaste">MYIP=`ifconfig en1 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2`</div>
<div id="_mcePaste">fi</div>
<p>MYIP=`ifconfig en0 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2`if [$MYIP -eq '']; then	MYIP=`ifconfig en1 | grep &#8216;inet &#8216; | cut -d &#8216; &#8216; -f2`fi</p>
<p>echo $MYIP</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/how-to-get-ip-address-on-your-mac-from-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

