<?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>.zugiart &#187; zen</title>
	<atom:link href="http://www.zugiart.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zugiart.com</link>
	<description>Software Engineering, buddhism, and everything else in between.</description>
	<lastBuildDate>Mon, 09 Jan 2012 05:50:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>mount.cifs Centos5 and Windows Server 2003</title>
		<link>http://www.zugiart.com/2012/01/mount-cifs-centos5-and-windows-server-2003/</link>
		<comments>http://www.zugiart.com/2012/01/mount-cifs-centos5-and-windows-server-2003/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 05:06:53 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[cifs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[server2003]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1805</guid>
		<description><![CDATA[We were trying to mount a remote directory shared by Windows Server 2003 SP2 machine using CIFS, or Common internet filesystem,&#160;from a Linux CentOS5 machine and we couldn&#8217;t get it going. So then I went on and scoured info from the net, until finally I stumbled upon all this info.&#160;In many post/pages on the net, [...]]]></description>
			<content:encoded><![CDATA[<p>We were trying to mount a remote directory shared by Windows Server 2003 SP2 machine using CIFS, or Common internet filesystem,&nbsp;from a Linux CentOS5 machine and we couldn&#8217;t get it going. So then I went on and scoured info from the net, until finally I stumbled upon all this info.&nbsp;In many post/pages on the net, people usually only tell you either information on Windows side, or information on Linux side, I&#8217;ll try to post both of my finding.&nbsp;</p>
<p><span style="font-size: large;">Windows Server authentication configuration</span></p>
<p style="padding-left: 30px;">It is important to know what specific protocol is being used to authenticate the client that tries to access the shared folder (e.g. NTLM or NTLMv2 ?). Especially in a corporate setting, the authentication setting is quite key and is strongly enforced. I figure out the settings when I stumble upon the guide to <a href="http://www.imss.caltech.edu/node/395">Enable NTLMv2 on Windows Server 2003</a>&nbsp;(from which I link the image below without prior consent <img src='http://www.zugiart.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p style="padding-left: 30px;">To do this, you go to Start &gt; Program Files &gt; Administration Tools &gt; Local Security Policy</p>
<p style="padding-left: 30px;"><img src="http://www-test.imss.caltech.edu/sites/default/files/legacy/ntlmv2-w2k3sp1-02.jpg" alt="Enabling NTLMv2 On Windows Server 2003" width="600" height="304" /></p>
<p style="padding-left: 30px;">The guide shows how to set Windows Server 2003 to use NTLMv2, but in knowing this, you will know what the configuration is on the server that you are trying to access/mount into the linux box. If you are the sysadmin of the windows server, then all is well. But otherwise, you know how and what to ask from the sysadmin.&nbsp;</p>
<p><span style="font-size: large;">Using mount.cifs in /etc/fstab</span></p>
<p style="padding-left: 30px;">As we know, <a href="http://en.wikipedia.org/wiki/Fstab">/etc/fstab</a>&nbsp;is used to specify the filesystem mounting. Mount directive specified here will be executed during system startup, so whatever you put in here will persist across reboots. The command <strong>mount -a</strong>&nbsp;forces Linux to reload the config.</p>
<p style="padding-left: 30px;">Information about CIFS mount can be found in the man page. The command <a href="http://linux.die.net/man/8/mount.cifs">man mount.cifs</a>&nbsp;reveals all that you need to know about CIFS mount in Linux.</p>
<p style="padding-left: 30px;">The below is extracted from Wikipedia, which actually provides the working configuration that got our problem solved:</p>
<pre class="de1" style="font-family: monospace, Courier !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; background-color: #f9f9f9; font: normal normal normal 1em/1.2em monospace; margin-top: 0px; margin-bottom: 0px; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; font-size: 13px; text-align: left; border-image: initial; padding-left: 30px; border: 0px none white;"><span class="co0" style="color: #666666; font-style: italic;"># mounting cifs</span>
<span class="sy0" style="font-weight: bold;">//</span>pingu<span class="sy0" style="font-weight: bold;">/</span>ashare  <span class="sy0" style="font-weight: bold;">/</span>store<span class="sy0" style="font-weight: bold;">/</span>pingu cifs <span class="re2" style="color: #007800;">credentials</span>=<span class="sy0" style="font-weight: bold;">/</span>root<span class="sy0" style="font-weight: bold;">/</span>smbpass.txt,<span style="color: #007800;">sec</span>=ntlmv2 <span class="nu0">0</span> <span class="nu0">0</span></pre>
<p style="padding-left: 30px;">&nbsp;</p>
<p style="padding-left: 30px;"><strong><span style="font-size: medium;">credentials=/path/to/file</span></strong></p>
<p style="padding-left: 30px;">The option can be used to specify the file that contains the credential information. In this case, the file may look like this:</p>
<pre class="de1" style="font-family: monospace, Courier !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; background-color: #f9f9f9; font: normal normal normal 1em/1.2em monospace; margin-top: 0px; margin-bottom: 0px; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; font-size: 13px; text-align: left; border-image: initial; padding-left: 30px; border: 0px none white;"><span class="re2" style="color: #007800;">username</span>=&lt;username&gt;
</pre>
<pre class="de1" style="font-family: monospace, Courier !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; background-color: #f9f9f9; font: normal normal normal 1em/1.2em monospace; margin-top: 0px; margin-bottom: 0px; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; font-size: 13px; text-align: left; border-image: initial; padding-left: 30px; border: 0px none white;">
<pre class="de1" style="font-family: monospace, Courier !important; border-image: initial; font: normal normal normal 1em/1.2em monospace; margin-top: 0px; margin-bottom: 0px; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; padding: 0px; border: 0px none white;"><span class="re2" style="color: #007800;">password</span>=&lt;password&gt;</pre>
</pre>
<p style="padding-left: 30px;">The nice thing with this approach is, as the creds are stored in the file, even though it is in clear text, you can protect it as usual with the good ol&#8217; filesystem security. You may put it in /root, or in any other directory and set the appropriate permission. On top of <strong>username</strong>&nbsp;and <strong>password</strong>, you can also specify <strong>domain</strong>&nbsp;in the credential file. However, Windows server usually assumes a default domain (as the server should be registerer against a domain controller). So usually, the domain part is not needed.</p>
<p style="padding-left: 30px;"><span style="font-size: medium;"><strong>sec=ntlmv2</strong></span></p>
<p style="padding-left: 30px;">Credentials&nbsp;are not the only option you can use. If you try the above and fail, know that CIFS support different authentication protocol. So check the server side config, choose the right auth type try it on in <strong>/etc/fstab</strong>, do <strong>mount -a</strong> and see what happens.&nbsp;</p>
<p><span style="font-size: large;">Debugging</span></p>
<p style="padding-left: 30px;">To see what the OS is doing you can try <strong>dmesg | less</strong></p>
<p style="padding-left: 30px;">To see the CIFS mount status, you can try <strong>cat /proc/fs/cifs/DebugData</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2012/01/mount-cifs-centos5-and-windows-server-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generic Python XML-RPC CLI Client (With apache extension support)</title>
		<link>http://www.zugiart.com/2011/10/generic-python-xml-rpc-cli-client-with-apache-extension-support/</link>
		<comments>http://www.zugiart.com/2011/10/generic-python-xml-rpc-cli-client-with-apache-extension-support/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 05:10:16 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xml-rpc]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1757</guid>
		<description><![CDATA[This code snippet is a generic python xml-rpc client that supports custom extensions. This is tested with pytnon 2.6 &#8211; usage is as follow: Interactive mode # run the client like so: python client.py --url=http://serverUrl:port/path/to/serverPoint &#160; # in interactive mode, you see the CLI interface like so: &#91;timestamp&#93; http://serverUrl:port/path/to/serverPoint xmlrpc &#62;&#62; helloWorld&#40;&#34;hello zen&#34;&#41; hello zen [...]]]></description>
			<content:encoded><![CDATA[<p>This code snippet is a generic python xml-rpc client that supports custom extensions. This is tested with pytnon 2.6 &#8211; usage is as follow: </p>
<h3>Interactive mode</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># run the client like so:</span>
python client.py <span style="color: #660033;">--url</span>=http:<span style="color: #000000; font-weight: bold;">//</span>serverUrl:port<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>serverPoint
&nbsp;
<span style="color: #666666; font-style: italic;"># in interactive mode, you see the CLI interface like so: </span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>timestamp<span style="color: #7a0874; font-weight: bold;">&#93;</span> http:<span style="color: #000000; font-weight: bold;">//</span>serverUrl:port<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>serverPoint
xmlrpc <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> helloWorld<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;hello zen&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
hello zen <span style="color: #666666; font-style: italic;">#&lt;- this is the response from the server</span></pre></div></div>

<h3>Oneliner mode</h3>
<p>You can invoke the client as a one-liner, by passing the xmlrpc function to be called using the &#8211;cmd option. Like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python client.py <span style="color: #660033;">--url</span>=http:<span style="color: #000000; font-weight: bold;">//</span>serverUrl:port<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>serverPoint <span style="color: #660033;">--cmd</span>=<span style="color: #ff0000;">'helloWorld(&quot;hello zen&quot;)'</span></pre></div></div>

<p>Which is quite powerful, because now we can include this as part of shell scripts that can invoke/leverage existing xml-rpc service. </p>
<h2>client.py script</h2>
<p>The <b>CustomXmlRpcExtensionTransport</b> is what allows xml-rpc extensions to be parsed properly via the client. Here, (limited) support for <a href="http://ws.apache.org/xmlrpc/types.html">Apache xml-rpc extension data types</a> is added. Specifically &#8211; ex:nil as None; ex:i2, ex:i4, ex:i8 as numbers/int. This approach does not override original xmlrpclib implementation, but rather extends it.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">xmlrpclib</span> <span style="color: #ff7700;font-weight:bold;">import</span> Transport, ServerProxy
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">readline</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cmd</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">traceback</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">pprint</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">optparse</span> <span style="color: #ff7700;font-weight:bold;">import</span> OptionParser
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> CustomXmlRpcExtensionTransport<span style="color: black;">&#40;</span>Transport<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;
    This Transport allows for the parser's dispatch object to be modified to cater for additional 
    extension tags. In case the client need to be extend to interoperate with other provider, 
    such as apache xml-rpc service points. 
    see also http://bugs.python.org/issue8792
    &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> getparser<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #dc143c;">parser</span>, unmarshaller = Transport.<span style="color: black;">getparser</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
        dispatch = unmarshaller.<span style="color: black;">dispatch</span>.<span style="color: #dc143c;">copy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        unmarshaller.<span style="color: black;">dispatch</span> = dispatch
        <span style="color: #808080; font-style: italic;"># Now we can add custom types</span>
        dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;ex:nil&quot;</span><span style="color: black;">&#93;</span> = dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;nil&quot;</span><span style="color: black;">&#93;</span>
        dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;ex:i2&quot;</span><span style="color: black;">&#93;</span>  = dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;int&quot;</span><span style="color: black;">&#93;</span>
        dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;ex:i4&quot;</span><span style="color: black;">&#93;</span>  = dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;int&quot;</span><span style="color: black;">&#93;</span>
        dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;ex:i8&quot;</span><span style="color: black;">&#93;</span>  = dispatch<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;int&quot;</span><span style="color: black;">&#93;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">parser</span>, unmarshaller                                                                                                                                                                                                                                                                                                                              
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> XmlRpcClientConsole<span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span>.<span style="color: black;">Cmd</span><span style="color: black;">&#41;</span>: 
    <span style="color: #483d8b;">&quot;&quot;&quot;
    Generic xml rpc client console. Allows for seamlessly working with compatible xml-rpc server.
    &quot;&quot;&quot;</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>, url<span style="color: black;">&#41;</span>:
        <span style="color: #dc143c;">cmd</span>.<span style="color: black;">Cmd</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">url</span> = url<span style="color: #66cc66;">;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">server</span> = ServerProxy<span style="color: black;">&#40;</span>url, transport=CustomXmlRpcExtensionTransport<span style="color: black;">&#40;</span>use_datetime=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#verbose=True,)</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">pp</span> = <span style="color: #dc143c;">pprint</span>.<span style="color: black;">PrettyPrinter</span><span style="color: black;">&#40;</span>indent=<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">updatePrompt</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> updatePrompt<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">prompt</span> = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[%s] %s<span style="color: #000099; font-weight: bold;">\n</span>xmlrpc &gt;&gt; &quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">datetime</span>.<span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%Y.%m.%d %H:%M:%S&quot;</span><span style="color: black;">&#41;</span>,<span style="color: #008000;">self</span>.<span style="color: black;">url</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> default<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, line<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            result=<span style="color: #008000;">None</span>
            <span style="color: #ff7700;font-weight:bold;">exec</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;result=self.server.%s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">pp</span>.<span style="color: #dc143c;">pprint</span><span style="color: black;">&#40;</span>result<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># default formatter: pretty print the resultant data</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, ex:
            <span style="color: #dc143c;">traceback</span>.<span style="color: black;">print_exc</span><span style="color: black;">&#40;</span>ex<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span><span style="color: #66cc66;">;</span> <span style="color: #008000;">self</span>.<span style="color: black;">updatePrompt</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> do_help<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,line<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;-------------------------------------&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;GENERIC XML RPC CLIENT CONSOLE - HELP&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;-------------------------------------&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Simply type in the function name on the xml-rpc service end, like you would&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;on any good ol' python program. For example, if the other side has a method&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;called helloWorld(strparam), you can invoke it like so:&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;... xmlrpc &gt;&gt; helloWorld('hello zen')&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;the client is therefore completely transparent and exposes the full capabilities&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;of the server end. have fun.&quot;</span> <span style="color: #808080; font-style: italic;"># -zen</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> 
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">parser</span> = OptionParser<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;&quot;Generic XML RPC Client console&quot;&quot;&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;--url&quot;</span>, dest=<span style="color: #483d8b;">&quot;url&quot;</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;The XML RPC service URL to connect&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;--cmd&quot;</span>, dest=<span style="color: #483d8b;">&quot;cmd&quot;</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;A one-off command to execute&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: black;">&#40;</span>options, args<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">parser</span>.<span style="color: black;">parse_args</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">url</span> == <span style="color: #008000;">None</span> :
        <span style="color: #dc143c;">parser</span>.<span style="color: black;">print_help</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
    console = XmlRpcClientConsole<span style="color: black;">&#40;</span>options.<span style="color: black;">url</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: #dc143c;">cmd</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span> :
        <span style="color: #808080; font-style: italic;"># run the cmd and bomb out</span>
        console.<span style="color: black;">default</span><span style="color: black;">&#40;</span>options.<span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;for help using the console, type 'help'&quot;</span>
        <span style="color: #808080; font-style: italic;"># enter into cmd loop for interactive session</span>
        console.<span style="color: black;">cmdloop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/10/generic-python-xml-rpc-cli-client-with-apache-extension-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache xml-rpc handling null/nil</title>
		<link>http://www.zugiart.com/2011/07/apache-xml-rpc-handle-null-nil/</link>
		<comments>http://www.zugiart.com/2011/07/apache-xml-rpc-handle-null-nil/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 15:37:30 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[xml-rpc]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1685</guid>
		<description><![CDATA[If you have used xml-rpc extensively, you will know that one of the most annoying aspect of XML-RPC is the fact that NULL values are not supported as part of the core spec. This is an issue, because NULL is such a key concept in the mainstream languages such as Python, Java and .NET &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>If you have used xml-rpc extensively, you will know that one of the most annoying aspect of XML-RPC is the fact that NULL values are not supported as part of the core spec. This is an issue, because NULL is such a key concept in the mainstream languages such as Python, Java and .NET &#8211; not to mention that NULL is also a supported data type in mainstream relational DB such as MySQL and Postgres. This means that if you write an xml-rpc service that publishes a data service on top of a database, your code have to handle what to do with NULL values that are stored in the db.</p>
<p>For this, we rely on the vendor extension. Now, Python&#8217;s extension uses &lt;nil /&gt;. Jayrock&#8217;s .NET xml rpc extension for null is also &lt;nil /&gt;. However for Apache&#8217;s xml-rpc implementation, the null extension is expressed as &lt;ex:nil /&gt;. If you have stumbled across this, fear not. You CAN tell apache xml-rpc to use both &lt;nil /&gt; and &lt;ex:nil /&gt; for Null:</p>
<h3>XmlRpcTypeNil : The  implementation</h3>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.ws.commons.util.NamespaceContextImpl</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.common.TypeFactoryImpl</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.common.XmlRpcController</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.common.XmlRpcStreamConfig</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.parser.NullParser</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.parser.TypeParser</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.serializer.NullSerializer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.serializer.TypeSerializer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.xml.sax.SAXException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * This class extends Type Factory Impl to provide concrete type factory for handling
 * Null values. In this case the tag comparison uses NullSerializer.NIL_TAG as opposed
 * to EX_NIL_TAG
 *
 * @author zsugiart
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> XmlRpcTypeNil <span style="color: #000000; font-weight: bold;">extends</span> TypeFactoryImpl <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> XmlRpcTypeNil<span style="color: #009900;">&#40;</span>XmlRpcController pController<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>pController<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> TypeParser getParser<span style="color: #009900;">&#40;</span>XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, <span style="color: #003399;">String</span> pURI, <span style="color: #003399;">String</span> pLocalName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>NullSerializer.<span style="color: #006633;">NIL_TAG</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>pLocalName<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> NullSerializer.<span style="color: #006633;">EX_NIL_TAG</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>pLocalName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> NullParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getParser</span><span style="color: #009900;">&#40;</span>pConfig, pContext, pURI, pLocalName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> TypeSerializer getSerializer<span style="color: #009900;">&#40;</span>XmlRpcStreamConfig pConfig, <span style="color: #003399;">Object</span> pObject<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pObject <span style="color: #000000; font-weight: bold;">instanceof</span> XmlRpcTypeNil<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> NullSerializer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getSerializer</span><span style="color: #009900;">&#40;</span>pConfig, pObject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>Client &amp; Server configuration</h3>
<p>The most important thing here is the <a href="http://people.apache.org/~jochen/xmlrpc/apidocs/org/apache/xmlrpc/common/XmlRpcController.html">XmlRpcController&#8217;s setTypeFactory method</a>. Also remember that both XmlRpcClient and XmlRpcServer extends from XmlRpcController. Which means:</p>
<p>On the client end..</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">XmlRpcClientConfigImpl config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlRpcClientConfigImpl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
config.<span style="color: #006633;">setServerURL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://xmlrpc.url&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
XmlRpcClient client <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlRpcClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
client.<span style="color: #006633;">setTypeFactory</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> XmlRpcTypeNil<span style="color: #009900;">&#40;</span>client<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// yes it's this easy!</span>
client.<span style="color: #006633;">setConfig</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// client.execute(...)</span></pre></div></div>

<p>And on the server end&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">XmlRpcServer xmlRpcServer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">webServer</span>.<span style="color: #006633;">getXmlRpcServer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// or however it is setup</span>
xmlRpcServer.<span style="color: #006633;">setTypeFactory</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> XmlRpcTypeNil<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">xmlRpcServer</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Conclusion</h3>
<p>This is such a simple trick, but it took me a while to work out how to work the apache xml-rpc API to make it do this. The benefit is also quite significant, with this implementation alone, we now can enable NULL data to be transported transparently between xml-rpc services implemented in Python, Java, .NET and other implementation that supports &lt;nil /&gt; for Null.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/07/apache-xml-rpc-handle-null-nil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classic ASP: cross domain json-rpc proxy controller</title>
		<link>http://www.zugiart.com/2011/07/classic-asp-cross-domain-json-rpc-proxy-controller/</link>
		<comments>http://www.zugiart.com/2011/07/classic-asp-cross-domain-json-rpc-proxy-controller/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 01:26:37 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json-rpc]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1676</guid>
		<description><![CDATA[A controller written in classic ASP / VBScript to proxy json-rpc request to a remote service point.]]></description>
			<content:encoded><![CDATA[<p>Through some sheer bad luck, I am now working on restructuring a system written in classic ASP. There&#8217;s a json-rpc service point on a separate domain that the app could consume, and I wanted it to consume it rather than reinventing the functionality again on the system. As much as I hate VBscript, ASP and IIS, I went googling and figure out a way forward.</p>
<p>Basically, it&#8217;s difficult to integrate JSON-RPC into a classic ASP system. However, it is very easy to integrate it into jQuery. Problem is, the service existed on an external domain, so what I needed is a proxy asp controller that will forward json-rpc request &amp; response back and forth between the local client and the external json-rpc point.</p>
<p><a href="http://www.zugiart.com/main/wp-content/uploads/2011/07/proxy-json-rpc.png"><img class="aligncenter size-full wp-image-1678" title="proxy-json-rpc" src="http://www.zugiart.com/main/wp-content/uploads/2011/07/proxy-json-rpc.png" alt="" width="605" height="143" /></a></p>
<p>One word of warning though: I haven&#8217;t tested this code extensively so use it at your own risk. &#8211; anyway here&#8217;s the controller script:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;%</span><span style="color: #006600; font-weight: bold;">@</span> LANGUAGE<span style="color: #006600; font-weight: bold;">=</span>VBScript <span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;%</span>
<span style="color: #008000;">'# ==========================================================================================================</span>
<span style="color: #008000;">'#</span>
<span style="color: #008000;">'# JSON-RPC Proxy ASP [classic asp]</span>
<span style="color: #008000;">'#</span>
<span style="color: #008000;">'# This asp page/component will forward the json-rpc request to an existing json-rpc service </span>
<span style="color: #008000;">'# and transparently forward the result back to the caller via the HTTP response. </span>
<span style="color: #008000;">'# </span>
<span style="color: #008000;">'# @author Zen Sugiarto</span>
<span style="color: #008000;">'# ==========================================================================================================</span>
&nbsp;
<span style="color: #008000;">'# configuration</span>
<span style="color: #008000;">'# -------------</span>
&nbsp;
<span style="color: #008000;">'# This URl points to the json-rpc service point. </span>
<span style="color: #008000;">'# if your system uses a different configuration mechanism, please adjust it accordingly</span>
<span style="color: #008000;">'#</span>
<span style="color: #990099; font-weight: bold;">Dim</span> servicePointUrl
servicePointUrl <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;http://url-to-json-rpc/point&quot;</span>
&nbsp;
<span style="color: #008000;">'# main body of execution</span>
<span style="color: #008000;">'# ----------------------</span>
&nbsp;
<span style="color: #008000;">'# this function allows for msg to be logged into a log file so we can trace / analyze the traffic.</span>
<span style="color: #0000ff; font-weight: bold;">Sub</span> logInfo <span style="color: #006600; font-weight:bold;">&#40;</span>message<span style="color: #006600; font-weight:bold;">&#41;</span>
	logFile <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">MapPath</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;event.log&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Const</span> ForWriting   <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">2</span>
    <span style="color: #990099; font-weight: bold;">Const</span> ForAppending <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">8</span>
    <span style="color: #990099; font-weight: bold;">Set</span> fs <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">If</span> fs.<span style="color: #330066;">FileExists</span><span style="color: #006600; font-weight:bold;">&#40;</span>logFile<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #990099; font-weight: bold;">Then</span>
        <span style="color: #990099; font-weight: bold;">Set</span> logFile <span style="color: #006600; font-weight: bold;">=</span> fs.<span style="color: #330066;">OpenTextFile</span><span style="color: #006600; font-weight:bold;">&#40;</span>logFile, ForAppending<span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Else</span>
        <span style="color: #990099; font-weight: bold;">Set</span> logFile <span style="color: #006600; font-weight: bold;">=</span> fs.<span style="color: #9900cc;">CreateTextFile</span><span style="color: #006600; font-weight:bold;">&#40;</span>logFile, <span style="color: #0000ff; font-weight: bold;">True</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>    
    logFile.<span style="color: #9900cc;">WriteLine</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #330066;">Now</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> vbTab <span style="color: #006600; font-weight: bold;">&amp;</span> message<span style="color: #006600; font-weight:bold;">&#41;</span>
    logFile.<span style="color: #330066;">Close</span>
    <span style="color: #990099; font-weight: bold;">Set</span> logFile <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> fs <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">nothing</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span>
&nbsp;
<span style="color: #008000;">' we read all of the POST data, json-rpc supports get, but this component only does POST for now.</span>
<span style="color: #008000;">' the safe array read from .BinaryRead is then converted into string, which is then sent into the </span>
<span style="color: #008000;">' forwarding HTTP request object to the bus.</span>
<span style="color: #990099; font-weight: bold;">dim</span> safeArray, <span style="color: #330066;">totalBytes</span>
<span style="color: #330066;">totalBytes</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">TotalBytes</span>
safeArray<span style="color: #006600; font-weight: bold;">=</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">BinaryRead</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #330066;">totalBytes</span><span style="color: #006600; font-weight:bold;">&#41;</span>
jsonBody <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;&quot;</span>
<span style="color: #990099; font-weight: bold;">For</span> n <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">To</span> LenB<span style="color: #006600; font-weight:bold;">&#40;</span>safeArray<span style="color: #006600; font-weight:bold;">&#41;</span>
  jsonBody <span style="color: #006600; font-weight: bold;">=</span> jsonBody <span style="color: #006600; font-weight: bold;">&amp;</span> Chr<span style="color: #006600; font-weight:bold;">&#40;</span>AscB<span style="color: #006600; font-weight:bold;">&#40;</span>MidB<span style="color: #006600; font-weight:bold;">&#40;</span>safeArray,n,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">Next</span>
&nbsp;
<span style="color: #008000;">' create the HTTP request object to be forwarded into the service bus, </span>
<span style="color: #008000;">' inject the json body in.</span>
<span style="color: #990099; font-weight: bold;">Dim</span> httpreq
<span style="color: #990099; font-weight: bold;">Set</span> httpreq <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;MSXML2.XMLHTTP&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
httpreq.<span style="color: #330066;">open</span> <span style="color: #cc0000;">&quot;POST&quot;</span>,servicePointUrl, <span style="color: #0000ff; font-weight: bold;">False</span>
httpreq.<span style="color: #9900cc;">setRequestHeader</span> <span style="color: #cc0000;">&quot;Content-Type&quot;</span>,<span style="color: #cc0000;">&quot;application/json-rpc&quot;</span>
<span style="color: #008000;">'httpreq.setRequestHeader &quot;Cookie&quot;,Request.Cookies</span>
&nbsp;
<span style="color: #008000;">' Send out the request</span>
<span style="color: #990099; font-weight: bold;">On</span> <span style="color: #990099; font-weight: bold;">Error</span> <span style="color: #990099; font-weight: bold;">Resume</span> <span style="color: #990099; font-weight: bold;">Next</span>
httpreq.<span style="color: #330066;">send</span> jsonBody
logInfo<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;REQUEST={ queryString=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;, cookies=&quot;</span><span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">Cookies</span> <span style="color: #006600; font-weight: bold;">&amp;</span><span style="color: #cc0000;">&quot;, totalBytes=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">TotalBytes</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;, jsonBody=&quot;</span><span style="color: #006600; font-weight: bold;">&amp;</span>jsonBody<span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color: #008000;">' TODO: implement error handling</span>
&nbsp;
<span style="color: #008000;">' get response text, set mime type to application/json-rpc and write the bus response to the response stream</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">ContentType</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;application/json-rpc&quot;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span><span style="color: #006600; font-weight:bold;">&#40;</span>httpreq.<span style="color: #9900cc;">responseText</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></div></div>

<p>And now I can skip the whole shitty ASP architecture altogether and just go straight to web2.0 style programming. The controller will also log and output the request into a file called event.log. I haven&#8217;t finished writing a proper log rotator and whatnot with it. Just comment out the logInfo part if you&#8217;re not using it. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/07/classic-asp-cross-domain-json-rpc-proxy-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install/backsync between source and installation directory</title>
		<link>http://www.zugiart.com/2011/05/install-backsync-from-source-an-installation-directory/</link>
		<comments>http://www.zugiart.com/2011/05/install-backsync-from-source-an-installation-directory/#comments</comments>
		<pubDate>Wed, 18 May 2011 05:49:55 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[notes]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1660</guid>
		<description><![CDATA[Have this script in my collection since few years back, I thought I should share it. #@ #@ ======================================================================================= #@ SYNCINSTALL.SH #@ Zen Sugiarto 25-03-2009 #@ ======================================================================================= #@ This is a simple script to assist in syncing SOURCE DIR TARGET INSTALL DIR: #@ #@ SYNC PUSH - pushes source file INTO installation dir #@ SYNC [...]]]></description>
			<content:encoded><![CDATA[<p>Have this script in my collection since few years back, I thought I should share it.</p>
<pre lang="bash" class='code'>
#@
#@ =======================================================================================
#@ SYNCINSTALL.SH
#@ Zen Sugiarto 25-03-2009
#@ =======================================================================================
#@ This is a simple script to assist in syncing SOURCE DIR <-> TARGET INSTALL DIR:
#@
#@ SYNC PUSH - pushes source file INTO installation dir
#@ SYNC PULL - pulls update from target installation dir back INTO the source dir.
#@

# override specific logging logic here
function log()
{
	echo "[`date +'%Y%m%d %H:%M:%S'`] $1"
}

#@
#@ cmd: push
#@ this is used to install files from the source directory to the installation dir
#@ assuming that both of them would have the same structure. New files will be added,
#@ and backup automatically done on the files in the installation dir.
#@ push preserves permission of the target file.
function cmd_push() #$1=srcDir #$2=installDir
{
	_srcDir=$1
	_installDir=$2
	log "installing from:$_srcDir -> to:$_installDir"
	if [ ! -d $_srcDir ]; then log "$_srcDir does not exist! "; return 1; fi
	if [ ! -d $_installDir ]; then log "$_installDir does not exist!"; return 1; fi
	rsync -avz --backup --suffix=.backup --exclude=".svn" --perms "$_srcDir/" "$_installDir"
}

#@
#@ cmd: pull
#@ when syncing back, a different logic applies. This is used mostly in cases
#@ where hot changes to a file is done on the installation directory and it needs
#@ to be synced back to the working directory. In this case, we only want to sync
#@ files IF it existed on the source directory.
#@ push preserves permission of the source files
function cmd_pull() #$1=srcDir #$2=installDir
{
	_srcDir=$1
	_installDir=$2
	log "backsync to:$_srcDir <- from:$_installDir"
	if [ ! -d $_srcDir ]; then log "$_srcDir does not exist! "; return 1; fi
	if [ ! -d $_installDir ]; then log "$_installDir does not exist!"; return 1; fi
	if [ -e .hitlist.txt ]; then rm .hitlist.txt; fi

	pushd "$_srcDir" &#038;> /dev/null
	for f in $(find . | grep -v .svn ); do
		fname="${f:0}";
		# construct hitlist based on files in src dir
		if [ -e "$fname" ] &#038;&#038; [ ! -d "$fname" ]; then echo "$fname" >> .hitlist.txt; fi
	done
	rsync -avz --update --files-from=$PWD/.hitlist.txt --perms $_installDir .
	rm .hitlist.txt
	popd &#038;> /dev/null
}

#@
#@ cmd: usage
#@ print short msg on how to use the script
function cmd_usage()
{
	echo " "
	echo "[USAGE]"
	echo "    $0 <cmd>
<params...>"
	echo
	echo "[EXAMPLE]"
	echo "    $0 push /path/to/srcDir /path/to/installDir"
	echo
	echo "[COMMANDS]"
	cat $0 | grep "function cmd_" | grep -v "grep" | cut -d'_' -f2
	echo
}

#@
#@ cmd: help
#@ print help messages
function cmd_help()
{
	cat $0 | grep "#@" | grep -v "cat \$0 \| grep #@" | cut -d'@' -f2-100
}

# ======================================================================================= // MAIN BLOCK

if [ "$1" == "" ]; then echo "not enough arguments"; cmd_usage; exit 1; fi
cmd_$1 $2 $3 $4
if [ $? == 127 ]; then
	echo "no such command: $1";
	cmd_usage
fi
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/05/install-backsync-from-source-an-installation-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>N900 in Japan via bmobile. At last.</title>
		<link>http://www.zugiart.com/2011/05/n900-in-japan-via-bmobile/</link>
		<comments>http://www.zugiart.com/2011/05/n900-in-japan-via-bmobile/#comments</comments>
		<pubDate>Thu, 12 May 2011 15:16:13 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[bmobile]]></category>
		<category><![CDATA[japan]]></category>
		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/2011/05/n900-in-japan-via-bmobile-hello-japan/</guid>
		<description><![CDATA[This is posted from my n900 via bmobile / docomo FOMA network. Yes, this is the very same n900 that I bought in Australia. No softbank bullshit. Deal &#38; pricing data-only: no sms or phone calls. which sucks. but at least i can do skype IM, browse facebook, upload photo to facebook, sync my calendar [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.zugiart.com/main/wp-content/uploads/2011/05/20110512_003.jpg" alt="" /></p>
<p>This is posted from my n900 via bmobile / docomo FOMA network. Yes, this is the very same n900 that I bought in Australia. No softbank bullshit. <img src='http://www.zugiart.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Deal &amp; pricing</h3>
<ul>
<li><strong>data-only</strong>:<span style="font-weight: normal;"> no sms or phone calls. which sucks. but at least i can do skype IM, browse facebook, upload photo to facebook, sync my calendar and so on. It&#8217;s not bad in that regard. The speed is capped at 300kbps up&amp;down and you can&#8217;t do streaming. This mans </span>you can&#8217;t do skype call<span style="font-weight: normal;"> either.<br />
</span><br />
<span style="font-weight: normal;"> </span></li>
<li><strong>pricing</strong>: <span style="font-weight: normal;"><a href="http://www.bmobile.ne.jp/sim/charge_plan.html">http://www.bmobile.ne.jp/sim/charge_plan.html </a><a href="http://www.bmobile.ne.jp/sim/charge_plan.html"></a>
<p></span></li>
<li><strong>purchase</strong><span style="font-weight: normal;">: </span><span style="font-weight: normal;">Note that for the 1 month prepaid SIM, you need to order online from <a href="http://www.bmobile.ne.jp/sim/note.html" target="_blank">here</a>. The 6-monthly ones, you can get from BIC CAMERA (see below)
<p></span></li>
<li><strong>continuation</strong>: <span style="font-weight: normal;">I don&#8217;t really know how to &#8216;extend&#8217; it, I would imagine since this is a </span>data only<span style="font-weight: normal;"> sim, just buying another one won&#8217;t be a biggie.</span></li>
</ul>
<h3>How to get the 6-month B-Mobile SIM from BIC CAMERA</h3>
<p>Bic Camera is a mega electronic store &#8211; their sign looked like <a href="http://bit.ly/jkTpQM" target="_blank">this</a>, they are easy to find.</p>
<p>Just rock in there and say you want B-mobile Sim card. They don&#8217;t ask for any gaijin card or anything like that.</p>
<p>You can ask <strong>&#8220;BI-MOBAIRU SIIMU CAADO ARUKA ?&#8221; &#8211; </strong>Or if you want to be less adventurous, simply go to <a href="http://www.bmobile.ne.jp/sim_t/index.html">this page </a>and print it out, then bring it to the shop.</p>
<p>They will give you this booklet, with a bunch of information in japanese and within it is a card (within the card is the SIM card). Take the card out, turn it around, behind you should see 2 set of number. The first one is the number to call, the 2nd one, is your number.</p>
<p>Call the first number, choose <strong>english</strong>, follow the prompt, and <strong>activate</strong> the SIM card. You&#8217;ll need the 2nd number, which is your mobile number to activate it. Activation takes about 10-15 minute.</p>
<p>Then, pop in your SIM card into the trusty n900.</p>
<h3>&#8220;SIM Card Registration Failed&#8221;</h3>
<p>Unfortunately it won&#8217;t work just yet. But fear not &#8211; if you see this msg,  open the XTerminal, elevate to root (sudo gainroot) and then type in the following cmd (credit to <a href="http://twitter.com/#!/tesuri">@tesuri</a> for figuring this out ):</p>
<blockquote><p>dbus-send –system –type=method_call –print-reply –dest=com.nokia.phone.net “/com/nokia/csd/gprs” org.freedesktop.DBus.Properties.Set string:com.nokia.csd.GPRS string:AttachMode variant:string:WhenAvaiable</p></blockquote>
<h3>Then, let&#8217;s set the APN</h3>
<p>For quick reference, here it is. But check with the latest one here in case it changes: <a href="http://www.bmobile.ne.jp/sim/setting.html">http://www.bmobile.ne.jp/sim/setting.html</a></p>
<blockquote><p>APN: dm.jplat.net<br />
Username: bmobile@u300<br />
Password: bmobile</p></blockquote>
<h3>Done!</h3>
<p>Once done, reboot the phone. And you should be in <img src='http://www.zugiart.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Good luck and have fun.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 947px; width: 1px; height: 1px; overflow: hidden;">
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;"><span style="color: #666666; font-family: 'Hiragino Kaku Gothic Pro', HiraKakuPro-W3, Verdana, Futura, Arial, メイリオ, 'ＭＳ Ｐゴシック', Osaka, sans-serif; font-size: 16px; line-height: 25px; text-align: left;"> </span></span></p>
<table class="table_device" style="border-collapse: collapse; width: 900px;">
<tbody>
<tr>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">APN:</span></span></td>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">dm.jplat.net</span></span><br />
<span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">(Diemu. Jepierueti. Enuiti)</span></span></td>
</tr>
<tr>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">Username:</span></span></td>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">bmobile @ u300</span></span><br />
<span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">(Biemuobiaierui @ Yusanzerozero)</span></span></td>
</tr>
<tr>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">Password:</span></span></td>
<td style="vertical-align: top; font-size: 12px; padding: 5px; margin: 0px; border: 1px solid #dddddd;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">bmobile</span></span><br />
<span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;"><span style="background-color: transparent; font-size: 12px; outline-width: 0px; vertical-align: baseline; display: inline; padding: 0px; margin: 0px;">(Biemuobiaierui)</span></span></td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/05/n900-in-japan-via-bmobile/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hello Japan</title>
		<link>http://www.zugiart.com/2011/05/hello-japan/</link>
		<comments>http://www.zugiart.com/2011/05/hello-japan/#comments</comments>
		<pubDate>Mon, 09 May 2011 14:08:03 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[japan]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1642</guid>
		<description><![CDATA[I have finally arrived in Japan, the land of the rising sun. Even though last Friday was my first day at work, today was my first day doing real work. So what&#8217;s it like to live a Japanese life? many people ask me such questions, how do I feel, is it nice over there, etc. [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally arrived in Japan, the land of the rising sun. Even though last Friday was my first day at work, today was my first day doing <em>real</em> work.</p>
<p>So what&#8217;s it like to live a Japanese life? many people ask me such questions, how do I feel, is it nice over there, etc. To be honest, I don&#8217;t know. Strange as it may seems, my circumstance is not that much different than when I was in Australia, I work with a bunch of Australian blokes, still working as full time geek (which I thoroughly enjoy), only that I am now in a different geographical location.</p>
<p>I guess that is what happen when you have studied enough Buddhism, things doesn&#8217;t shake you in a majorly dramatic way. Japan is a country. My apartment is a place to live. It is not insignificant, but it is not very special either. Suffice to say that given my circumstance, I am fortunate enough to say that my few days in here have been very comfortable indeed.</p>
<p>How long will I be here for, I don&#8217;t know. But this experience, just the act of going through the negotiation, the interviews, the preparations, have made me grew in ways I couldn&#8217;t imagine.</p>
<p>Let&#8217;s see where this wave will take me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/05/hello-japan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The pattern in the fabric</title>
		<link>http://www.zugiart.com/2011/04/the-pattern-in-the-fabric/</link>
		<comments>http://www.zugiart.com/2011/04/the-pattern-in-the-fabric/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 12:27:31 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[japan]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/2011/04/the-pattern-in-the-fabric/</guid>
		<description><![CDATA[Just got a phone call from Japan, my visa is approved. They are sending the certificate of eligibility (COE) over. Im going to need to come over to the jap embassy with the thing before I can have the visa physically labelled in my passport (?). But things are starting to gel nicely together. The [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.zugiart.com/main/wp-content/uploads/2011/04/20110415_002.jpg" alt="" /></p>
<p>Just got a phone call from Japan, my visa is approved. They are sending the certificate of eligibility (COE) over. Im going to need to come over to the jap embassy with the thing before I can have the visa physically labelled in my passport (?).</p>
<p>But things are starting to gel nicely together. The situation in japan is cooling down (just!), I have successfully completed my work with my previous employer, have just managed to sell my piano, still trying to sell the car, and my replacement tenant is ready to move in.</p>
<p>I haven&#8217;t been this excited in ages. There are still many things to be done and resolved, but its all coming together. Back then, I was too close to see the pattern in the fabric. But now, stepping back, it all starting to make sense.</p>
<p>I&#8217;m glad I didn&#8217;t gave up back then and persisted. I hope this will all work for the best.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/04/the-pattern-in-the-fabric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good bye, piano.</title>
		<link>http://www.zugiart.com/2011/04/good-bye-piano/</link>
		<comments>http://www.zugiart.com/2011/04/good-bye-piano/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 08:43:32 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[determination]]></category>
		<category><![CDATA[piano]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1621</guid>
		<description><![CDATA[I&#8217;ve been trying to sell my Yamaha CVP-201 for years now. And everytime, I&#8217;ve been putting it off again and again. But this time round, I managed to do it. Truly urgency is the best motivator. Da vinci said the following wise lines: I have been impressed with the urgency of doing. Knowing is not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to sell my Yamaha CVP-201 for years now. And everytime, I&#8217;ve been putting it off again and again. But this time round, I managed to do it. Truly urgency is the best motivator. Da vinci said the following wise lines:</p>
<blockquote><p>I have been impressed with the urgency of doing. Knowing is not enough; we must apply. Being willing is not enough; we must do.</p></blockquote>
<p>And indeed it is &#8211; there is something magical in the way we commit, the way we <em>determine</em> to do something no matter what that allows things to unfold in the most naturally serendipitous way.</p>
<p>Take for example this piano, I&#8217;ve been trying to sell it for years and I just can&#8217;t find anyone who wants to buy it. People are too picky, they can not appreciate the value of the piano and everyone thinks that it is way overpriced, that it should be priced below the range and so on. But I was sure that this is a decent price for it, and also I am not happy to sell a music instrument to someone who does not appreciate the true value of it. To me, music instruments are more than just furniture, it is a means by which music can be conveyed, and music is magic.</p>
<p>So this guy rang me yesterday, asking about the piano. He came around at 3pm today, and he drove all the way from Geelong to Murrumbeena, just to inspect the piano. He is trying to buy one for his son, and he has been considering a Clavinova for almost 3 years and haven&#8217;t found a suitable piano. In Gumtree, my piano is like on page 26. I don&#8217;t know what compels this man to click on my ad &#8211; which leads him to our encounter.</p>
<p>He is such a nice guy, and he definitely knows the value of the CVP-201, I ended up selling it to him lower than my target price &#8211; but I am more than happy to do it. I even showed him how to open up the piano and replace the keys and stuff. I knew then that the piano have been waiting for this person, as much as this person have been waiting for this piano and I am merely an agent for the transaction. But all that didn&#8217;t happen until this sense of urgency arise from within. It just didn&#8217;t click until this determination becomes crystal clear, that &#8220;I <em>want to sell this piano to a good owner and there must be someone out there who want this piano&#8221;</em></p>
<p><em></em>I suppose it is all summed up nicely by this line in <em>Faust</em> &#8211; <em>possibly</em> by Goethe:</p>
<div id="abw">
<div id="abm">
<div id="abc">
<div id="articlebody">
<blockquote><p>Until one is committed, there is hesitancy, the chance to draw back. Concerning all acts of initiative (and creation), there is one elementary truth, the ignorance of which kills countless ideas and splendid plans: that the moment one definitely commits oneself, then Providence moves too.</p>
<p>All sorts of things occur to help one that would never otherwise have occurred. A whole stream of events issues from the decision, raising in one&#8217;s favor all manner of unforeseen incidents and meetings and material assistance, which no man could have dreamed would have come his way. Whatever you can do, or dream you can do, begin it. Boldness has genius, power, and magic in it. Begin it now.</p></blockquote>
</div>
</div>
</div>
</div>
<p>Such is life, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/04/good-bye-piano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transition</title>
		<link>http://www.zugiart.com/2011/04/transition/</link>
		<comments>http://www.zugiart.com/2011/04/transition/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 15:37:14 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=1614</guid>
		<description><![CDATA[I have finally left the company that I have worked for in the last 5 years. 5 years! it is odd how we experience things. Perhaps Eckhart Tolle was right, that we think of time as being linear, but we never did experience it in that fashion. Looking back, there were many beautiful moments I [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally left the company that I have worked for in the last 5 years. 5 years! it is odd how we experience things. Perhaps Eckhart Tolle was right, that we think of time as being linear, but we never did experience it in that fashion.</p>
<p>Looking back, there were many beautiful moments I had and surely enough it&#8217;s not about the company, but the people within it. I&#8217;m glad that I have not left the place with regret. If anything, I&#8217;m quite proud of what I&#8217;ve done &#8211; not necessarily in terms of the work I&#8217;ve left behind &#8211; but rather by the fact that I&#8217;ve always given everything I&#8217;ve got at whatever I do, and it couldn&#8217;t have been better. Whatever the outcome is, I&#8217;m happy with it.</p>
<p>It feels like it was just a moment ago that I drive all the way from Southbank to Clayton and parked outside the GOC at 9.30am to start my first day working as a full-time employee of an IT company. There I was yesterday consuming obscene amount of alcohol throughout my farewell parties (all the way up to 11) with my work mates celebrating good times &#8211; And here I am now preparing for my next journey.</p>
<p>Eckhart was right, we never do experience time linearly. Things are never as they seem.</p>
<p>I am in transition at the moment from one job to the next. But what is not in transition? everything is ever-changing anyway, safe for the change itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2011/04/transition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

