<?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>Chmouel&#039;s Blog &#187; Programming</title>
	<atom:link href="http://blog.chmouel.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chmouel.com</link>
	<description>Random and probably boring stuff.</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:28:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Rackspace CloudDNS python binding</title>
		<link>http://blog.chmouel.com/2011/07/17/rackspace-clouddns-python-binding/</link>
		<comments>http://blog.chmouel.com/2011/07/17/rackspace-clouddns-python-binding/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 07:32:09 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=457</guid>
		<description><![CDATA[I have released a python binding to Rackspace CloudDNS here which allow you to create/update/delete domains and records. It&#8217;s available on github https://github.com/rackspace/python-clouddns/ The binding is pretty simple and have unfortunately no documentation (or even tests) but you can figure &#8230; <a href="http://blog.chmouel.com/2011/07/17/rackspace-clouddns-python-binding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have released a python binding to <a href="http://www.rackspace.com/cloud/cloud_hosting_products/dns/" title="DNSaas" target="_blank">Rackspace CloudDNS</a> here which allow you to create/update/delete domains and records. It&#8217;s available on github</p>
<p><a href="https://github.com/rackspace/python-clouddns/" target="_blank">https://github.com/rackspace/python-clouddns/</a></p>
<p>The binding is pretty simple and have unfortunately no documentation (or even tests) but you can figure out most of it from here :</p>
<p><a href="https://github.com/rackspace/python-clouddns/blob/master/tests/t.py" target="_blank">https://github.com/rackspace/python-clouddns/blob/master/tests/t.py</a></p>
<p>I will be very welcoming pull request that add a bit of documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2011/07/17/rackspace-clouddns-python-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing python-cloudfiles from pypi</title>
		<link>http://blog.chmouel.com/2011/02/16/installing-python-cloudfiles-from-pypi/</link>
		<comments>http://blog.chmouel.com/2011/02/16/installing-python-cloudfiles-from-pypi/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 05:41:33 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=399</guid>
		<description><![CDATA[I have just uploaded python-cloudfiles to pypi available here This make things easy to add as a dependence of your project like you can have something like this in your setup.py : requirements = ['python-cloudfiles'] and it will automatically download &#8230; <a href="http://blog.chmouel.com/2011/02/16/installing-python-cloudfiles-from-pypi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have just uploaded <a href="https://github.com/rackspace/python-cloudfiles">python-cloudfiles</a> to pypi available <a href="http://pypi.python.org/pypi/python-cloudfiles/">here </a></p>
<p>This make things easy to add as a dependence of  your project like  you can have something like this in your setup.py  :</p>
<p><code>requirements = ['python-cloudfiles']</code></p>
<p>and it  will automatically download it as part of the dependence with easy_install or pip. </p>
<p>cool kids on latest debian/ubuntu can do stuff like this (from<a href="http://packages.debian.org/sid/python-stdeb"> python-stdeb</a> package) :</p>
<p><code>pypi-install python-cloudfiles</code></p>
<p>which would automatically download the tarball from pypi and install it as a packages (like the way it should be for prod machine!)</p>
<p>If you have a virtualenv environment you can easily do a (needs <a href="http://packages.debian.org/sid/python-pip">python-pip</a> package) :</p>
<p><code>pip -E /usr/local/myvirtualenvroot install python-cloudfiles<br />
</code></p>
<p>and magic would be done to get you on latest python-cloudfiles.</p>
<p>As a bonus side you can browse online the python-cloudfiles library :</p>
<p><a href="http://packages.python.org/cloudfiles/">http://packages.python.org/python-cloudfiles/</a></p>
<p><strong><br />
[Update] This has been renamed back to python-cloudfiles please update your setup.py or scripts.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2011/02/16/installing-python-cloudfiles-from-pypi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get latest lyrics of a scrobbled LastFM song</title>
		<link>http://blog.chmouel.com/2010/10/09/get-latest-lyrics-of-a-scrobbled-lastfm-song/</link>
		<comments>http://blog.chmouel.com/2010/10/09/get-latest-lyrics-of-a-scrobbled-lastfm-song/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 07:56:05 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=331</guid>
		<description><![CDATA[All my music players (Spotify, XBMC, Rythmbox etc&#8230;) are scrobbling over lastfm but not all of them display song lyrics properly so I came up with a quick Google AppEngine app that grab the latest or current song scrobbled over &#8230; <a href="http://blog.chmouel.com/2010/10/09/get-latest-lyrics-of-a-scrobbled-lastfm-song/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>All my music players (Spotify, XBMC, Rythmbox etc&#8230;) are <a href="http://www.last.fm/help/faq?category=Scrobbling">scrobbling</a> over <a href="http://www.last.fm">lastfm</a> but not all of them display song lyrics properly so I came up with a quick Google AppEngine app that grab the latest or current song scrobbled over  last.fm and display its lyrics. No fancy HTML or javascript just the lyrics displayed for your enjoyment.</p>
<p>This is available here :</p>
<p><a href="http://getlastlastfmlyrics.appspot.com/">http://getlastlastfmlyrics.appspot.com/</a></p>
<p>for the scripter around you can just get (via curl or other) :</p>
<p>http://getlastlastfmlyrics.appspot.com/?u=username</p>
<p>and it will automatically display it for that username.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2010/10/09/get-latest-lyrics-of-a-scrobbled-lastfm-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python decorator to argument checking</title>
		<link>http://blog.chmouel.com/2010/07/29/python-decorator-to-argument-checking/</link>
		<comments>http://blog.chmouel.com/2010/07/29/python-decorator-to-argument-checking/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 19:03:57 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=319</guid>
		<description><![CDATA[I am sure there is billions or more people who already done that but I needed this quickly for my project and was not feeling googling around :]]></description>
			<content:encoded><![CDATA[<p>I am sure there is billions or more people who already done that but I needed this quickly for my project and was not feeling googling around :</p>
<p><script src="http://gist.github.com/498939.js?file=ArgumentCheckDecorator.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2010/07/29/python-decorator-to-argument-checking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>connecting to self signed SSL certificate from Java on Debian/Ubuntu</title>
		<link>http://blog.chmouel.com/2010/06/03/connecting-to-self-signed-ssl-certificate-from-java-on-debian-ubuntu/</link>
		<comments>http://blog.chmouel.com/2010/06/03/connecting-to-self-signed-ssl-certificate-from-java-on-debian-ubuntu/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 10:50:43 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=301</guid>
		<description><![CDATA[You want to connect to self signed SSL certificate from Java using the standard HttpsURLConnection and you are getting this error, because the self signed certificate is obviously not recognized by Java : SEVERE: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: &#8230; <a href="http://blog.chmouel.com/2010/06/03/connecting-to-self-signed-ssl-certificate-from-java-on-debian-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You want to connect to self signed SSL certificate from Java using the standard <a href="http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/HttpsURLConnection.html">HttpsURLConnection</a> and you are getting this error, because the self signed certificate is obviously not recognized by Java :</p>
<pre>
SEVERE: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1639)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:215)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:209)
</pre>
<p>it seems that there is a lot of &#8216;solutions&#8217; (read hack) or workaround around the web which is resumed well on <a href="http://stackoverflow.com/questions/875467/java-client-certificates-over-https-ssl">this</a> stack overflow article. </p>
<p>There is actually a very easy (and secure) way on Debian based systems. </p>
<p>- Go to your https url with Firefox<br />
- Right Click to &#8216;View Page Info&#8217;<br />
- In &#8216;Security&#8217; tab you will see a button saying &#8216;View Certificate&#8217;<br />
- Click now on the &#8216;Details&#8217; tab<br />
- Finally click on the &#8216;Export&#8217; button which offer you to save the PEM certifcate of the website somewhere on your filesystem.</p>
<p>Call it my.self.signed.domain.name.pem or whatever my.self.signed.domain.name should be and put the file in /etc/ssl/certs now you just have to run the command :</p>
<pre>
sudo update-ca-certificates
</pre>
<p>and it should add your certificate to the java keystore, you can check it with the command (Enter for Password) :</p>
<pre>
keytool -list -v -keystore /etc/ssl/certs/java/cacerts
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2010/06/03/connecting-to-self-signed-ssl-certificate-from-java-on-debian-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Jython with the vCloud API</title>
		<link>http://blog.chmouel.com/2010/05/17/using-jython-with-the-vcloud-api/</link>
		<comments>http://blog.chmouel.com/2010/05/17/using-jython-with-the-vcloud-api/#comments</comments>
		<pubDate>Mon, 17 May 2010 20:33:47 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=290</guid>
		<description><![CDATA[Lately I had to do a lot of works with the VMware VCloud product and since the python API did not seem available and I did not have the courage to use the PHP API I had to do most &#8230; <a href="http://blog.chmouel.com/2010/05/17/using-jython-with-the-vcloud-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lately I had to do a lot of works with the <a title="Vcloud vCloud API" href="http://communities.vmware.com/community/developer/forums/vcloudapi" target="_blank">VMware VCloud</a> product and since the python API did not seem available and I did not have the courage to use the PHP API I had to do most of the API works with Java. I never did any Java before and while I have found Eclipse+Java development surprisingly pleasant and easy to use/learn my favourite are still Emacs+Python.</p>
<p>I have then started to look over Jython to see if I can interact easily with Java via Python and this was actually pretty easy, it took me less than 10mn to convert a Login/Listing-VAPPS script in Jython.</p>
<p>The script is attached at the end of this post (or on github gist <a href="http://gist.github.com/404193">here</a>). Don&#8217;t forget to adjust the classpath variable mine are defined like that :</p>
<blockquote><p>
commons-codec-1.3.jar<br />
commons-httpclient-3.1.jar<br />
commons-logging-1.1.1.jar<br />
rest-api-schemas-1.0.0.jar<br />
vcloud-java-sdk-0.9.jar<br />
vCloudJavaSDK-samples.jar
</p></blockquote>
<div>Most of them are the ones shipped with the official Java API</div>
<p />
<div>Here is the script  the __main__ should get you the logic and a start how to use it :</div>

<div class="wp_codebox"><table><tr id="p2902"><td class="code" id="p290code2"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/jython</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> org.<span style="color: black;">apache</span>.<span style="color: black;">commons</span>.<span style="color: black;">httpclient</span>.<span style="color: black;">protocol</span> <span style="color: #ff7700;font-weight:bold;">import</span> Protocol
<span style="color: #ff7700;font-weight:bold;">from</span> com.<span style="color: black;">vmware</span>.<span style="color: black;">vcloud</span>.<span style="color: black;">sdk</span>  <span style="color: #ff7700;font-weight:bold;">import</span> VcloudClient, Organization, Vdc
<span style="color: #ff7700;font-weight:bold;">from</span> com.<span style="color: black;">vmware</span>.<span style="color: black;">vcloud</span>.<span style="color: black;">sdk</span>.<span style="color: black;">samples</span> <span style="color: #ff7700;font-weight:bold;">import</span> FakeSSLSocketFactory
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> VcloudLogin<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;
    VcloudLogin: Login to vcloud class
    &quot;&quot;&quot;</span>
    vcloudClient = <span style="color: #008000;">None</span>
    api_version = <span style="color: #008000;">None</span>
    vcloud_url = <span style="color: #008000;">None</span>
&nbsp;
    <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>, vcloud_url, api_version<span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># This is needed if you have a self certified certificate</span>
        <span style="color: #808080; font-style: italic;"># remove it if you have a proper SSL certs.</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">setup_fake_ssl</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">vcloud_url</span> = vcloud_url
        <span style="color: #008000;">self</span>.<span style="color: black;">api_version</span> = api_version
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> setup_fake_ssl<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        https = Protocol<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;https&quot;</span>, FakeSSLSocketFactory<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">443</span><span style="color: black;">&#41;</span>
        Protocol.<span style="color: black;">registerProtocol</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;https&quot;</span>, https<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> login<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, username, password<span style="color: black;">&#41;</span>:
        versions = VcloudClient.<span style="color: black;">getSupportedVersions</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">vcloud_url</span> + <span style="color: #483d8b;">&quot;/api/versions&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">vcloudClient</span> = VcloudClient<span style="color: black;">&#40;</span>versions.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">api_version</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">vcloudClient</span>.<span style="color: black;">login</span><span style="color: black;">&#40;</span>username, password<span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    URL=<span style="color: #483d8b;">&quot;https://URL&quot;</span>
    API_VERSION=<span style="color: #483d8b;">&quot;0.9&quot;</span>
    USERNAME=<span style="color: #483d8b;">&quot;user@organization&quot;</span>
    PASSWORD=<span style="color: #483d8b;">&quot;password&quot;</span>
&nbsp;
    vcl = VcloudLogin<span style="color: black;">&#40;</span>URL, API_VERSION<span style="color: black;">&#41;</span>
    organizations_list = vcl.<span style="color: black;">login</span><span style="color: black;">&#40;</span>USERNAME, PASSWORD<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> org <span style="color: #ff7700;font-weight:bold;">in</span> organizations_list.<span style="color: black;">values</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">for</span> vdcLink <span style="color: #ff7700;font-weight:bold;">in</span> \
                Organization.<span style="color: black;">getOrganizationByReference</span><span style="color: black;">&#40;</span>vcl.<span style="color: black;">vcloudClient</span>, org<span style="color: black;">&#41;</span>.<span style="color: black;">getVdcLinks</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            vdc = Vdc.<span style="color: black;">getVdc</span><span style="color: black;">&#40;</span>vcl.<span style="color: black;">vcloudClient</span>, vdcLink<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;VDC Href: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>vdcLink.<span style="color: black;">getHref</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">for</span> vapps <span style="color: #ff7700;font-weight:bold;">in</span> vdc.<span style="color: black;">getVappRefs</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Name: %s URL: %s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>vapps.<span style="color: black;">getName</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, vapps.<span style="color: black;">getHref</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2010/05/17/using-jython-with-the-vcloud-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessing to Rackspace Cloud Files via servicenet (update)</title>
		<link>http://blog.chmouel.com/2009/10/20/accessing-to-rackspace-cloud-files-via-servicenet-update/</link>
		<comments>http://blog.chmouel.com/2009/10/20/accessing-to-rackspace-cloud-files-via-servicenet-update/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 18:47:49 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=236</guid>
		<description><![CDATA[Last week I have posted an article explaining how to connect to Rackspace Cloud Files via Rackspace ServiceNET but I actually got it wrong as pointed by my great colleague exlt so I had to take it down until figured &#8230; <a href="http://blog.chmouel.com/2009/10/20/accessing-to-rackspace-cloud-files-via-servicenet-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week I have posted  an article explaining how to connect to Rackspace Cloud Files via Rackspace ServiceNET but I actually got it wrong as pointed by my great  colleague <a href="http://12.am/">exlt</a> so I had to take it down until figured out how to fix it.</p>
<p>I have add that feature properly to the PHP and Python API in version 1.5.0 to add a &#8216;servicenet&#8217; argument to the connection and updated the blog post here :</p>
<p><a href="http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/">http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/<br />
</a><br />
It should give you all the information for the howto use that feature.</p>
<p>I have released as well a minor update in 1.5.1 to allow you to define the environment variable RACKSPACE_SERVICENET to force the use of the Rackspace ServiceNET this allow you to don&#8217;t have to modify the tools and have a clean code  between prod and testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2009/10/20/accessing-to-rackspace-cloud-files-via-servicenet-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to connect to Rackspace Cloud Files via ServiceNET</title>
		<link>http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/</link>
		<comments>http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 00:47:27 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=228</guid>
		<description><![CDATA[If you are a Rackspace customer and you are are planning to use Rackspace Cloud Files via it&#8217;s internal network (ServiceNet) so you don&#8217;t get billed for the bandwidth going over Cloud Files this is how you can do. The first thing is &#8230; <a href="http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: #ffffff;">If you are a Rackspace customer and you are are planning to use Rackspace Cloud Files via it&#8217;s internal network (ServiceNet) so you don&#8217;t get billed for the bandwidth going over Cloud Files this is how you can do.</span></p>
<p>The first thing is to make sure with your support team if your servers are connected to ServiceNet and if you have that connection then there is a small change to do in your code.</p>
<p>The second thing is to use the just released 1.5.0 version on GitHUB for PHP :</p>
<p><a href="http://github.com/rackspace/php-cloudfiles/tree/1.5.0">http://github.com/rackspace/php-cloudfiles/tree/1.5.0</a></p>
<p>and for python :</p>
<p><a href="http://github.com/rackspace/python-cloudfiles/tree/1.5.0">http://github.com/rackspace/python-cloudfiles/tree/1.5.0</a></p>
<p>(you need to click on the download link at the top to download the tarball of the release).</p>
<p>Afer this is just a matter to set the argument servicenet=True, for example in PHP :</p>

<div class="wp_codebox"><table><tr id="p2285"><td class="code" id="p228code5"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$user</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'username'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$api_key</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'theapi_key'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CF_Authentication<span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$api_key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">authenticate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CF_Connection<span style="color: #009900;">&#40;</span><span style="color: #000088;">$auth</span><span style="color: #339933;">,</span> <span style="color: #000088;">$servicenet</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>In Python you can do like this :</p>

<div class="wp_codebox"><table><tr id="p2286"><td class="code" id="p228code6"><pre class="python" style="font-family:monospace;">username=<span style="color: #483d8b;">'username'</span>
api_key=<span style="color: #483d8b;">'api_key'</span>
&nbsp;
cnx = cloudfiles.<span style="color: black;">get_connection</span><span style="color: black;">&#40;</span>username, api_key, servicenet=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2009/10/14/how-to-connect-to-rackspace-cloud-files-via-servicenet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rackspace Cloud Files helper scripts</title>
		<link>http://blog.chmouel.com/2009/09/24/rackspace-cloud-files-helper-scripts/</link>
		<comments>http://blog.chmouel.com/2009/09/24/rackspace-cloud-files-helper-scripts/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:10:18 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=225</guid>
		<description><![CDATA[Since working a lot with Rackspace Cloud Files I have put some quick scripts using the python-cloudfiles API to do some ls rm and cp of containers or objects.. It&#8217;s really a collection of quickly written stuff put in the &#8230; <a href="http://blog.chmouel.com/2009/09/24/rackspace-cloud-files-helper-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Since working a lot with <a href="http://www.rackspacecloud.com/cloud_hosting_products/files">Rackspace Cloud Files</a> I have put some quick<br />
scripts using the <a href="http://github.com/rackspace/python-cloudfiles">python-cloudfiles</a> API to do some ls rm and cp of containers or objects..</p>
<p>It&#8217;s really a collection of quickly written stuff put in the same file<br />
but at least if not useful for you it would give you an idea how the<br />
python-cloudfiles works. It is all available here :</p>
<p><a href="http://github.com/chmouel/cloud-files-helper">http://github.com/chmouel/cloud-files-helper</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2009/09/24/rackspace-cloud-files-helper-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload to Rackspace Cloud files from GNOME nautilus</title>
		<link>http://blog.chmouel.com/2009/09/02/upload-to-rackspace-cloud-files-from-gnome-nautilus/</link>
		<comments>http://blog.chmouel.com/2009/09/02/upload-to-rackspace-cloud-files-from-gnome-nautilus/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 16:49:30 +0000</pubDate>
		<dc:creator>chmouel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rackspace]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://blog.chmouel.com/?p=172</guid>
		<description><![CDATA[After seeing this script http://overhrd.com/?p=106 which allow to upload files with the file manager (finder) of MacosX to Rackspace Cloud Files, I have made a nautilus script that doe the same for us Gnome/Unix users. Available here : http://github.com/chmouel/nautilus-rackspace-cloud-file/tree/master]]></description>
			<content:encoded><![CDATA[<p>After seeing this script <a href="http://overhrd.com/?p=106">http://overhrd.com/?p=106</a> which allow to upload files with the file manager (finder) of  MacosX to Rackspace Cloud Files, I have made a nautilus script that doe the same for us Gnome/Unix users.</p>
<p>Available here :</p>
<p><a href="http://github.com/chmouel/nautilus-rackspace-cloud-file/tree/master">http://github.com/chmouel/nautilus-rackspace-cloud-file/tree/master</a></p>
<p style="text-align: center;">
<p><img class="aligncenter size-medium wp-image-190" title="Screensho uploading to Rackspace Cloud File form Nautilus" src="http://blog.chmouel.com/wp-content/uploads/2009/09/Screenshot1-300x262.png" alt="Screensho uploading to Rackspace Cloud File form Nautilus" width="300" height="262" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chmouel.com/2009/09/02/upload-to-rackspace-cloud-files-from-gnome-nautilus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

