<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://devplant.net/wp-atom.php">
	<title type="text">devPlant</title>
	<subtitle type="text">Plant for developers or developement plant</subtitle>

	<updated>2011-10-31T09:24:46Z</updated>

	<link rel="alternate" type="text/html" href="http://devplant.net" />
	<id>http://devplant.net/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.1.2">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/devplant" /><feedburner:info uri="devplant" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[ZendCon 2011 Slides]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/j_76PzOD2OA/" />
		<id>http://devplant.net/?p=262</id>
		<updated>2011-10-31T09:24:46Z</updated>
		<published>2011-10-22T07:38:32Z</published>
		<category scheme="http://devplant.net" term="ZendCon" /><category scheme="http://devplant.net" term="conference" /><category scheme="http://devplant.net" term="php" /><category scheme="http://devplant.net" term="slides" /><category scheme="http://devplant.net" term="zendcon" /><category scheme="http://devplant.net" term="zendcon 2011" />		<summary type="html"><![CDATA[Here are slides from ZendCon 2011 sessions. I&#8217;ll update the list as soon as I find missing slides or they are posted. I&#8217;ll try to add UnCon sessions too. Monday, October 17th PHP Extensions, Why and What? Derick Rethans Creating and Using Streams, Filters and Sockets Elizabeth Marie Smith Doctrine 2 Juozas Kaziukenas PHP Components [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2011/10/22/zendcon-2011-slides/"><![CDATA[<p>Here are slides from ZendCon 2011 sessions. I&#8217;ll update the list as soon as I find missing slides or they are posted. I&#8217;ll try to add UnCon sessions too.</p>
<h2>Monday, October 17th</h2>
<ul>
<li><a href="http://derickrethans.nl/talks/phpexts-zendcon11.pdf">PHP Extensions, Why and What?</a><br />
<em>Derick Rethans</em><a href="http://twitter.com/derickr"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://elizabethmariesmith.com/slides/zendcon2011/Writing%20and%20Using%20PHP%20Streams%20and%20Sockets%20-%20Zendcon%202011.pdf">Creating and Using Streams, Filters and Sockets</a><br />
<em>Elizabeth Marie Smith</em><a href="http://twitter.com/auroraeosrose"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Doctrine 2<br />
<em>Juozas Kaziukenas</em><a href="http://twitter.com/juokaz"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>PHP Components From Idea To Maturity<br />
<em>Stuart Herbert</em><a href="http://twitter.com/stuherbert"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Zend PHP 5.3 Certification Boot Camp<br />
<em>Christian Wenz</em><a href="http://twitter.com/chwenz"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/bradley.holt/zendcon-2011-learning-couchdb">Learning CouchDB</a><br />
<em>Bradley Holt</em><a href="http://twitter.com/BradleyHolt"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Design Patterns in Action<br />
<em>Stefan Priebsch</em><a href="http://twitter.com/spriebsch"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Beware of the Dark Side, Luke!<br />
<em>Arne Blankerts</em><a href="http://twitter.com/arneblankerts"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
</ul>
<h2>Tuesday, October 18th</h2>
<ul>
<li><a href="http://spoutserver.com/talks/websockets.html">HTML5 WebSockets</a><br />
<em>Scott Mattocks</em><a href="http://twitter.com/scottmattocks"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/pmjones88/benchmarking-applications-and-frameworks-9759357">Benchmarking Applications and Frameworks</a><br />
<em>Paul Jones</em></li>
<li><a href="http://www.slideshare.net/aseiden/php-batch-jobs-on-ibm-i">PHP Batch Jobs on IBM i</a><br />
<em>Alan Seiden</em><a href="http://twitter.com/alanseiden"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/skoop/git-for-subversion-users-zendcon-2011">Git for Subversion users</a><br />
<em>Stefan Koopmanschap</em><a href="http://twitter.com/skoop"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Development in the 24th and a Half Century<br />
<em>Kevin Schroeder</em><a href="http://twitter.com/kpschrade"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Cloud Based Application Performance Testing<br />
<em>Moris Chen</em></li>
<li><a href="http://derickrethans.nl/talks/xdebug-zendcon11.pdf">Xdebug</a><br />
<em>Derick Rethans</em><a href="http://twitter.com/derickr"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>PHP and IBM i Frequent Questions, FastCGI, DB2, etc.<br />
<em>Tony Cairns</em></li>
<li>Overview of Zend Framework 2<br />
<em>Matthew Weier O´Phinney</em><a href="http://twitter.com/weierophinney"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/jimbojsb/scaling-php-applications-with-redis">Scaling PHP Applications with Redis</a><br />
<em>Josh Butts</em><a href="http://twitter.com/jimbojsb"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/billkarwin/sql-injection-myths-and-fallacies">SQL Injection Myths and Fallacies</a><br />
<em>Bill Karwin</em><a href="http://twitter.com/billkarwin"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>The Future of PHP on IBM i<br />
<em>Tim Rowe</em></li>
<li><a href="http://derickrethans.nl/talks/profiling-zendcon11.pdf">Profiling PHP Applications</a><br />
<em>Derick Rethans</em><a href="http://twitter.com/derickr"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/spriebsch/change-is-inevitable-except-from-a-vending-machine">Change is Inevitable (Except from a Vending Machine)</a><br />
<em>Stefan Priebsch</em><a href="http://twitter.com/spriebsch"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://emsmith.net/slides/zendcon2011/Event%20and%20Signal%20Driven%20Programming%20Techniques.pdf">Event and Signal Driven Programming Techniques</a><br />
<em>Elizabeth Marie Smith</em><a href="http://twitter.com/auroraeosrose"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Open Source PHP Toolkit for IBM i<br />
<em>Mike Pavlak, Tony Cairns</em></li>
<li><a href="http://www.slideshare.net/skoop/a-practical-look-at-symfony2">A Practical Look At Symfony2</a><br />
<em>Stefan Koopmanschap</em><a href="http://twitter.com/skoop"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/ralphschindler/zend-code-in-zf-20">Skynet in ZF 2.0</a><br />
<em>Ralph Schindler</em><a href="http://twitter.com/ralphschindler"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://ilia.ws/files/zendcon_2011_under_the_hood.pdf">Under the Hood</a><br />
<em>Ilia Alshanetsky</em><a href="http://twitter.com/iliaa"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Zend Studio Tips and Tricks<br />
<em>Roy Ganor</em></li>
<li><a href="http://www.slideshare.net/aseiden/db2-and-php-best-practices-on-ibm-i">DB2 and PHP Best Practices on IBM i</a><br />
<em>Alan Seiden</em></li>
<li>Manage Cloud Infrastructures Using Zend Framework<br />
<em>Enrico Zimuel</em><a href="http://twitter.com/ezimuel"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Deployment Without the Chaos<br />
<em>Eric Ritchie</em></li>
</ul>
<h2>Wednesday, October 19th</h2>
<ul>
<li>Scaling in the Cloud<br />
<em>Kent Mitchell, Uri Budnik</em></li>
<li>Introduction to Adobe Flash Builder for PHP<br />
<em>Roy Ganor</em></li>
<li>MySQL &#8212; Whats New<br />
<em>Dave Stokes</em></li>
<li><a href="http://www.slideshare.net/Wombert/largescale-data-processing-with-hadoop-and-php-zendcon-2011-20111019">Large-Scale Data Processing with Hadoop and PHP</a><br />
<em>David Zuelke</em><a href="http://twitter.com/dzuelke"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/ralphschindler/zend-di-in-zf-20">Dependency Injection; Containers and Frameworks In PHP</a><br />
<em>Ralph Schindler</em><a href="http://twitter.com/ralphschindler"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Extending Open Source Solutions for Large Scale Federal Applications<br />
<em>Rakesh Kumar</em></li>
<li><a href="http://www.slideshare.net/jcarouth/the-contextual-experience-of-the-mobile-web">The Contextual Experience of the Mobile Web</a><br />
<em>Jeff Carouth</em><a href="http://twitter.com/jcarouth"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/mwillbanks/soa-with-zend-framework">SOA with Zend Framework</a><br />
<em>Mike Willbanks</em><a href="http://twitter.com/mwillbanks"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/afilina/zendcon-2011introtoflex">Intro to Flex</a><br />
<em>Anna Filina</em><a href="http://twitter.com/afilina"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Triggered: Zend Framework 2&#8242;s EventManager<br />
<em>Matthew Weier O´Phinney</em><a href="http://twitter.com/weierophinney"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Couchbase Mobile, The database that talks sync.<br />
<em>Matt Ingenthron</em><a href="http://twitter.com/ingenthr"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/SamHennessy/adding-dependency-injection-to-legacy-applications">Adding Dependency Injection To Legacy Applications</a><br />
<em>Sam Hennessy</em></li>
<li><a href="http://www.slideshare.net/mkherlakian/big-serveriswatchingyou">Big Server is Watching You</a> <br />
<em>Maurice Kherlakian</em></li>
<li><a href="http://shawnstratton.info/slides/zendcon/">Optimizing Zend Framework for use on High Traffic Volume Web Sites</a><br />
<em>Shawn Stratton</em><a href="http://twitter.com/mfacenet"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></a></li>
<li>Character Sets Suck<br />
<em>Ligaya Turmelle, Raymond DeRoo</em></li>
<li><a href="http://shawnstratton.info/slides/zendcon/"></a><a href="http://emsmith.net/slides/zendcon2011/Using%20SPL%20Tools%20in%20Your%20Code.pdf">Using SPL Tools in Your Code.</a><br />
<em>Elizabeth Marie Smith</em><a href="http://twitter.com/auroraeosrose"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>API Security<br />
<em>Rob Richards</em></li>
<li>Injecting Domain Expertise into Varchars<br />
<em>Jeff Kibler</em></li>
<li><a href="http://www.slideshare.net/eljefe/jquery-mobile-for-fun-and-profit">jQuery Mobile: For Fun and Profit</a><br />
<em>Daniel Cousineau</em></li>
<li>Cryptography in PHP: Use Cases<br />
<em>Enrico Zimuel</em><a href="http://twitter.com/ezimuel"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Getting to know Zend Studio 9<br />
<em>Gadi Goldbarg</em></li>
<li>&#8220;Cloudify&#8221; Your Application<br />
<em>Maurice Kherlakian</em></li>
<li><a href="http://www.slideshare.net/sebastian_bergmann/php-testers-toolbox-zend-con-2011">PHP Testing Tools</a><br />
<em>Sebastian Bergmann</em><a href="http://twitter.com/s_bergmann"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Performing Security Audits<br />
<em>Arne Blankerts</em><a href="http://twitter.com/arneblankerts"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>PHP &amp; MongoDB<br />
<em>Steve Francia</em></li>
</ul>
<h2>Thursday, October 20th</h2>
<ul>
<li>Care and feeding of a MySQL Database<br />
<em>Dave Stokes</em></li>
<li>Optimizing Application Performance<br />
<em>Kevin Schroeder</em><a href="http://twitter.com/kpscharde"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/jaytaph/puppet-for-dummies-zendcon-2011-edition">Puppet for Dummies</a><br />
<em>Joshua Thijssen</em><a href="http://twitter.com/JayTaph"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Introducing Assetic: Asset Management for PHP 5.3<br />
<em>Kris Wallsmith</em><a href="http://twitter.com/kriswallsmith"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Unit Testing Zend Framework Apps<br />
<em>Michelangelo van Dam</em><a href="http://twitter.com/DragonBe"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Mobile Development with Adobe AIR, Flash Builder, and Flex<br />
<em>Mihai Corlan</em></li>
<li><a href="http://www.slideshare.net/afilina/javascript-tools-and-framework-faves-zendcon-2011">Javascript Tools and Frameworks Faves</a><br />
<em>Anna Filina</em><a href="http://twitter.com/afilina"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Taming the Cloud<br />
<em>Rob Richards</em></li>
<li>Implementing The Open/Closed Principle<br />
<em>Sam Hennessy</em></li>
<li><a href="http://www.slideshare.net/becoded/powering-your-website-with-realtime-data">Powering Your Website with Realtime Data</a><br />
<em>Bert Van Hauwaert</em><a href="http://twitter.com/tbotwit"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li>Using GitHub<br />
<em>Scott Chacon</em></li>
<li><a href="http://www.slideshare.net/Wombert/designing-http-interfaces-and-restful-web-services-zendcon-2011-20111020">Designing HTTP Interfaces and RESTful Web Services</a><br />
<em>David Zuelke</em><a href="http://twitter.com/dzuelke"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/mwillbanks/mobile-push-notifications">Mobile: Push for Sync and Notifications</a><br />
<em>Mike Willbanks</em><a href="http://twitter.com/mwillbanks"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/billkarwin/mysql-55-guide-to-innodb-status">MySQL 5.5 InnoDB Tuning</a><br />
<em>Bill Karwin</em><a href="http://twitter.com/billkarwin"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
</ul>
<h2>UnCon</h2>
<ul>
<li><a href="http://www.slideshare.net/jaytaph/15-protips-for-mysql-users-pfz">12/15 Pro Tips for MySQL Users</a><br />
<em>	Joshua Thijssen</em></li>
<li><a href="http://www.slideshare.net/wimg/making-dynamic-sites-scale-like-static-sites">Making dynamic sites scale like static sites</a><br />
<em>Wim Godden</em></li>
<li><a href="http://www.slideshare.net/bradley.holt/zendcon-2011-uncon-domain-driven-design">Domain-Driven Design: A Collaboration Between Domain Experts and Software Practitioners</a><br />
<em>Bradley Holt</em></li>
<li><a href="http://www.slideshare.net/wimg/creating-fast-dynamic-acls-in-zend-framework">Creating Fast, dynamic ACL&#8217;s in Zend Framework</a><br />
<em>Wim Godden</em></li>
<li><a href="http://evan.pro/zf2-modules-talk.html">Introducing Modules in Zend Framework 2.0</a><br />
<em>	Evan Coury</em>, <em>Ben Scholzen</em>, <em>Ralph Schindler</em></li>
<li><a href="http://ilia.ws/files/zend_uncon_optimization_2011.pdf">Optimization tricks &#038; mistakes to avoid</a><br />
<em>	Ilia Alshanetsky</em> <a href="http://twitter.com/iliaa"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
<li><a href="http://www.slideshare.net/jkeppens/zendcon-2011-php-in-the-dark">PHP in the Dark</a><br />
<em>Jeroen Keppens</em><a href="http://twitter.com/jkeppens"><img src="/wp-content/themes/unsleepable/images/cues/icon_twitter.png"></a></li>
</ul>
<p><b>Last updated: 31 Oct</b></p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2011/10/22/zendcon-2011-slides/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2011/10/22/zendcon-2011-slides/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://devplant.net/2011/10/22/zendcon-2011-slides/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[VMWare] Device uses a controller that is not supported]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/I_k3w2a16ls/" />
		<id>http://devplant.net/?p=254</id>
		<updated>2011-07-19T09:16:22Z</updated>
		<published>2011-07-19T08:59:30Z</published>
		<category scheme="http://devplant.net" term="Software" /><category scheme="http://devplant.net" term="ova" /><category scheme="http://devplant.net" term="virtual appliance" /><category scheme="http://devplant.net" term="virtual hardware" /><category scheme="http://devplant.net" term="vmware" /><category scheme="http://devplant.net" term="vmx" />		<summary type="html"><![CDATA[Today I tried to deploy a Virtual Appliance from Bitnami on my ESXi server using ovftool: But each time I had an error: Device &#8216;VirtualDisk&#8217; uses a controller that is not supported. This is a general limitation of the virtual machine&#8217;s virtual hardware version on the selected host. What was funny, it was perfectly fine [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2011/07/19/vmware-device-uses-a-controller-that-is-not-supported/"><![CDATA[<p>Today I tried to deploy a Virtual Appliance from Bitnami on my ESXi server using ovftool:</p>
<pre class="brush: plain; title: ; notranslate">
ovftool.exe bitnami-xxx.vmx vi://192.168.0.100
</pre>
<p>But each time I had an error:</p>
<blockquote><p>
Device &#8216;VirtualDisk&#8217; uses a controller that is not supported. This is a general limitation of the virtual machine&#8217;s virtual hardware version on the selected host.
</p></blockquote>
<p>What was funny, it was perfectly fine if I converted the virtual machine to OVA format and started it using&#8230; VirtualBox.</p>
<p>I googled a bit and found out that some people had that similar problems and what they did was to upgrade virtual hardware from version 4 to 7. It wasn&#8217;t a solution for me because I already had version 7 &#8211; so maybe the problem was that I had &#8220;too new&#8221; virtual hardware? I opened <tt>bitnami-xxx.vmx</tt> file with a text editor and there I had:</p>
<pre class="brush: plain; title: ; notranslate">
virtualHW.version = &quot;4&quot;
</pre>
<p>I changed it to &#8220;7&#8243; and voila &#8211; it worked!</p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2011/07/19/vmware-device-uses-a-controller-that-is-not-supported/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2011/07/19/vmware-device-uses-a-controller-that-is-not-supported/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://devplant.net/2011/07/19/vmware-device-uses-a-controller-that-is-not-supported/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[python] libxml2 xpath on child node]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/sb8P1CJeVLo/" />
		<id>http://devplant.net/?p=247</id>
		<updated>2011-06-14T10:24:30Z</updated>
		<published>2011-06-14T10:24:30Z</published>
		<category scheme="http://devplant.net" term="Programming" /><category scheme="http://devplant.net" term="libxml2" /><category scheme="http://devplant.net" term="python" /><category scheme="http://devplant.net" term="xml" /><category scheme="http://devplant.net" term="xpath" />		<summary type="html"><![CDATA[Let&#8217;s say you have XML like: And now you&#8217;d like to get pairs order_id-client_name. And you&#8217;d like to make it in an elegant way, using xPath, not using DOM navigation, or worse, SAX parser. Getting all &#8220;client&#8221; nodes is easy: But now, how to run an xPath query on every node you found to get [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2011/06/14/python-libxml2-xpath-on-child-node/"><![CDATA[<p>Let&#8217;s say you have XML like:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;clients&gt;
   &lt;client&gt;
     &lt;name&gt;foo&lt;/name&gt;
     &lt;address&gt;...&lt;/address&gt;
     &lt;email&gt;...&lt;/email&gt;
     &lt;orders&gt;
       &lt;order&gt;
          &lt;id&gt;id1&lt;/id&gt;
          &lt;items&gt;...&lt;/items&gt;
       &lt;/order&gt;
       &lt;order&gt;
          &lt;id&gt;id2&lt;/id&gt;
          &lt;items&gt;...&lt;/items&gt;
       &lt;/order&gt;
   &lt;/client&gt;
   &lt;client&gt;
   ...
   &lt;/client&gt;
&lt;/clients&gt;
</pre>
<p>And now you&#8217;d like to get pairs order_id-client_name. And you&#8217;d like to make it in an elegant way, using xPath, not using DOM navigation, or worse, SAX parser. Getting all &#8220;client&#8221; nodes is easy:</p>
<pre class="brush: python; title: ; notranslate">
import libxml2

doc = libxml2.parseFile('clients.xml')
ctxt = doc.xpathNewContext()
clients = ctxt.xpathEval('/clients/client')

# clean up nicely
doc.freeDoc()
ctxt.xpathFreeContext()
</pre>
<p>But now, how to run an xPath query on every node you found to get client name and orders? You have to tell the context object to change the scope of context, so the next query would be relative to the node you chose:</p>
<pre class="brush: python; title: ; notranslate">
for client in clients:
    ctxt.setContextNode(client)
    client_name = ctxt.xpathEval('name')[0].getContent()

    orders = ctxt.xpathEval('orders/order')
    for order in orders:
        ctxt.setContextNode(order)
        orderId = ctxt.xpathEval('id')[0].getContent()
        print orderId+&quot; &quot;+client_name
</pre>
<p>And that&#8217;s it. I&#8217;m writing it because documentation for libxml2&#8242;s python bindings is scarce, and it took me a while to get to know about setContextNode method.</p>
<p>Complete script:</p>
<pre class="brush: python; title: ; notranslate">
import libxml2

doc = libxml2.parseFile('clients.xml')
ctxt = doc.xpathNewContext()
clients = ctxt.xpathEval('//client')

for client in clients:
    ctxt.setContextNode(client)
    client_name = ctxt.xpathEval('name')[0].getContent()

    orders = ctxt.xpathEval('orders/order')
    for order in orders:
        ctxt.setContextNode(order)
        orderId = ctxt.xpathEval('id')[0].getContent()
        print orderId+&quot; &quot;+client_name

# clean up nicely
doc.freeDoc()
ctxt.xpathFreeContext()
</pre>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2011/06/14/python-libxml2-xpath-on-child-node/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2011/06/14/python-libxml2-xpath-on-child-node/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://devplant.net/2011/06/14/python-libxml2-xpath-on-child-node/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[Zend PHP Certification]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/cOx5YfR4Ovw/" />
		<id>http://devplant.net/?p=194</id>
		<updated>2010-12-23T20:39:21Z</updated>
		<published>2010-12-23T20:39:21Z</published>
		<category scheme="http://devplant.net" term="Programming" /><category scheme="http://devplant.net" term="certificate" /><category scheme="http://devplant.net" term="exam" /><category scheme="http://devplant.net" term="examination" /><category scheme="http://devplant.net" term="php" /><category scheme="http://devplant.net" term="zce" /><category scheme="http://devplant.net" term="zend" />		<summary type="html"><![CDATA[For some time I&#8217;ve been thinking about passing the Zend PHP exam, and having possibility to attend to Zend PHP 5.3 Certification tutorial session during the recent PHP/Zend Conference 2010 was the thing that pushed me to finally do it. I enrolled for the conference too late to get a free voucher for the examination, [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/12/23/zend-php-certification/"><![CDATA[<p>For some time I&#8217;ve been thinking about passing the Zend PHP exam, and having possibility to attend to Zend PHP 5.3 Certification tutorial session during the recent PHP/Zend Conference 2010 was the thing that pushed me to finally do it. I enrolled for the conference too late to get a free voucher for the examination, so I bought it myself after coming back home, and on Dec 13th I finally got the ZCE title (yay for me!).</p>
<h1>What does it test?</h1>
<p>At the ZendCon it was said that the PHP 5.3 update of the exam was a huge leap forward in the meaning of quality and thoroughness of testing. Before this version, to pass the exam it was necessary to more or less memorize the manual — function names, arguments and return values. As I didn&#8217;t pass any previous version I can&#8217;t comment this statement, but I know that on my set of questions I didn&#8217;t have many questions that could be labeled as &#8220;manual questions&#8221; — I remember one &#8220;what is the output of the following code&#8221; question that was somehow related to the knowledge of function arguments, but it was enough to know the capabilities of the function rather than &#8220;is it &#8216;f($haystack, $needle)&#8217; or &#8216;f($needle, $haystack)&#8217;&#8221;, and other about a name of a configuration option, but a very popular and important one.</p>
<p>I found the exam very interesting, as the questions were not only about &#8220;dry&#8221; PHP code, but also about broadly defined web-related technologies. Databases, web security, web services, HTTP protocol, etc. Zend&#8217;s training department strongly stated that the exam is not only about knowing the function names, but about assessing if the person has all what it takes to be a good programmer. And I might confirm that — without proper experience in the web development field it is very difficult to pass the exam. I mean, you can memorize all the definitions of what XSS, CSRF, SQL join et al. is, but the questions are not about definitions, but about a proper understanding of concepts, like &#8220;would X solve the problem of CSRF&#8221;.</p>
<h1>Is it difficult?</h1>
<p>It depends. Even if you work with PHP applications on a daily basis, it&#8217;s still necessary to check preparation guides. Why? For instance, I&#8217;ve been using PHP since PHP3, but I didn&#8217;t need to use web services at all. And from study guides and the tutorial I mentioned before I knew that even if web services is not the most important part of the examination, I need to know at least something about all the parts of the test.</p>
<p>Most of the questions are simply &#8220;either you know the answer or you don&#8217;t&#8221;, and that way you can call the test easy. There are also some analytical questions, where you have to force yourself to do some thinking — but if you know how PHP works, it&#8217;s only a matter of time to get the proper answer.</p>
<p>The test consists of 70 questions, for which you have 90 minutes &#8211; it&#8217;s a more than a minute for a question. It&#8217;s not much, but as I&#8217;ve said before, for most of the questions either you know the answer or you don&#8217;t. That way you can go through the easy questions while marking the other for review (the examination software allows that), not wasting time on things you can&#8217;t answer from the top of your head.</p>
<p>Watch out for trick questions. It&#8217;s especially important on &#8220;what does this code print&#8221; — one single character can totally change the meaning of the code. If everything seem obvious, usually it&#8217;s not. Look at return values, variable scope, function calls etc.</p>
<p>My strategy for this test was:</p>
<ul>
<li>First pass: easy questions, test questions (generally those which took me just a few seconds)</li>
<li>Second pass: difficult, analytical questions</li>
<li>Third pass: questions I didn&#8217;t know the answer for, but with the possibility of proper extrapolation/guessing (questions without any possibility of me answering other way than guessing fell into the first category).</li>
</ul>
<p>With this method it took me about one hour to fill all the answers.</p>
<h1>How to prepare</h1>
<p>Zend offers courses preparing for the exam, but in my opinion it&#8217;s an overkill. If you only need to refresh and organize your knowledge, $1000 for the course (well, minus $195 for the included exam voucher) is a bit too much. If you need more training (e.g. you don&#8217;t have enough experience with PHP), this course wouldn&#8217;t help, as it is not designed to teach you PHP.</p>
<p>Everything you need to know about PHP to pass the exam can be found in the manual, which is great, but it contains knowledge organized in a way that is not very helpful while studying for the exam. After buying voucher for the examination you should receive PDF version of Zend Certification Study Guide, which can help you to plan your learning. Generally, I&#8217;d advise to read the whole basics section of the manual — variables, data types, control structures, <strong>OOP</strong>, new features of PHP 5.3 (LSB, namespaces), and to skim through index of some elementary functions (string, array) to know what is possible with PHP. Check the list of topics covered by the exam (to be found on Zend page) and make sure that you know at least basics of each entry.</p>
<p>One more word about the Study Guide provided by Zend &#8211; it&#8217;s poor. It&#8217;s poor mainly because it&#8217;s not finished and at some places you can find placeholders instead of some real information. It&#8217;s nice to get anything (especially if there are sample questions — and it&#8217;s very important to read them as they give you some outlook how the test looks like), but after a year that has passed since the test has been updated I&#8217;d expect something better.</p>
<h1>What to focus on?</h1>
<p>According to the rules of Zend Certification I can&#8217;t leak out any questions, but I can give some suggestions. Aside from the obvious, I&#8217;d recommend to review especially:</p>
<ul>
<li>references</li>
<li>streams, contexts etc.</li>
<li>XML processing</li>
<li>OOP&#8217;s features like inheritance, static methods, LSB</li>
<li>PDO</li>
</ul>
<p>SQL-related questions are quite easy, so if you know how to do select, insert and how inner join works, you&#8217;re good.</p>
<h1>Any benefits?</h1>
<p>A value of the certificate itself is debatable. It&#8217;s hard to tell if a potential employer will take that paper into consideration or not. Still I think it wouldn&#8217;t do any harm. It&#8217;s a proof that you meet a certain level of PHP (and web development in general) skills. Exactly like an English language certificate is to be verified on the first interview, your PHP skills will be verified sooner or later, but if you don&#8217;t have a proper entries in the résumé, you might not even be invited to the interview.</p>
<p>Few days ago there was a discussion about that on Twitter, and one of the guys said that having ZCE title means that you are not creative and you are wasting your time which could be spent on open source projects otherwise. I think its a very radical opinion. Having ZCE doesn&#8217;t exclude being involved in OSS projects. Also OSS projects are long term involvement that can&#8217;t be compared to one evening spent on a short recap. My opinion is — don&#8217;t put all your eggs in one basket. You can&#8217;t rely on the certificate solely, just like you can&#8217;t rely on open source projects. Working on public projects can be beneficiary to your skills (but — looking at some of the high-profile projects — it doesn&#8217;t have to), and is a nice point on your CV, but just like with anything, employer might don&#8217;t give a crap about OSS (and saying &#8220;those companies that don&#8217;t take open-source into consideration are evil&#8221; is childish, recruitment procedures in big companies might be far away from the nearest person that knows anything about computers).</p>
<p>Preparation for the exam can be a value itself. It&#8217;s a motivation to look into subjects one didn&#8217;t need  before (for me it was PDO &#8211; I was using abstraction layers, so I didn&#8217;t need  that), and make a review of features and changes one possibly didn&#8217;t know  about.</p>
<p>I decided to get the certification because I wanted to have some written proof of my skills, as even a list of prior projects does not say anything about the quality of those projects.</p>
<h1>Should I re-test if I have PHP4/PHP5 cert?</h1>
<p>Well, it&#8217;s up to you. If the certificate is for your better self esteem &#8211; go ahead. If it&#8217;s for improving your position on the market, it&#8217;s like with the value of the certificate in general — employer might value you better if you have the newest version of the document, but he doesn&#8217;t have to; he might don&#8217;t know the difference between PHP5 and PHP5.3 ;)</p>
<h1>Conclusion</h1>
<p>In my opinion, if you have some time and two hundred bucks to spare &#8211; go ahead :)</p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/12/23/zend-php-certification/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/12/23/zend-php-certification/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://devplant.net/2010/12/23/zend-php-certification/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[redmine] &#8220;Email delivery is not configured&#8221; error]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/7W730ouWAes/" />
		<id>http://devplant.net/?p=169</id>
		<updated>2010-09-11T10:36:24Z</updated>
		<published>2010-09-11T10:35:18Z</published>
		<category scheme="http://devplant.net" term="Applications" /><category scheme="http://devplant.net" term="Linux" /><category scheme="http://devplant.net" term="debian" /><category scheme="http://devplant.net" term="email" /><category scheme="http://devplant.net" term="error" /><category scheme="http://devplant.net" term="redmine" />		<summary type="html"><![CDATA[If you get this error on Redmine&#8216;s email notification configuration page: Email delivery is not configured, and notifications are disabled. Configure your SMTP server in config/email.yml and restart the application to enable them. you did configure config/email.yml file, and you did restart the application, and this message is still showing in the administration panel, you [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/09/11/redmine-email-delivery-is-not-configured-error/"><![CDATA[<p>If you get this error on <a href="http://www.redmine.org/">Redmine</a>&#8216;s email notification configuration page:</p>
<blockquote><p>Email delivery is not configured, and notifications are disabled. Configure your SMTP server in config/email.yml and restart the application to enable them.</p></blockquote>
<p>you did configure <code>config/email.yml</code> file, and you did restart the application, and this message is still showing in the administration panel, you can try placing the email.yml file in other directory. For me, it helped when I placed it in <code>/etc/redmine/default/</code>, where Debian keeps YAML configuration files for Redmine installation instances. If you run multiple instances on one host, you may have to change <code>default</code> subdirectory name to the instance name.<br />
I&#8217;m writing this post because while the solution is trivial, I&#8217;ve noticed that many questions about this error on Redmine&#8217;s forum remains unanswered.</p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/09/11/redmine-email-delivery-is-not-configured-error/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/09/11/redmine-email-delivery-is-not-configured-error/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://devplant.net/2010/09/11/redmine-email-delivery-is-not-configured-error/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[Linux] PHP not working in userdir (public_html)]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/qL8ModDPpvE/" />
		<id>http://devplant.net/?p=149</id>
		<updated>2010-05-04T10:06:59Z</updated>
		<published>2010-05-04T10:06:59Z</published>
		<category scheme="http://devplant.net" term="Apache" /><category scheme="http://devplant.net" term="Linux" /><category scheme="http://devplant.net" term="debian" /><category scheme="http://devplant.net" term="php" />		<summary type="html"><![CDATA[Today I wanted to give my users possibility to test their PHP scripts, but without all the fuss with creating virtual hosts for each one of them. My first and obvious choice was userdir &#8211; user creates public_html directory in his home dir, puts there files, and those files are accessible via http://servername/~username/ URL. To [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/05/04/linux-php-not-working-in-userdir-public_html/"><![CDATA[<p>Today I wanted to give my users possibility to test their PHP scripts, but without all the fuss with creating virtual hosts for each one of them. My first and obvious choice was userdir &#8211; user creates public_html directory in his home dir, puts there files, and those files are accessible via http://servername/~username/ URL. To enable this behavior you only have to enable userdir module (a2enmod userdir), and remember to set correct permissions to the userdir (chmod +x $HOME) and public_html (chmod 755 $HOME/public_html). I did this, and everything was working fine, except PHP scripts &#8211; browser wanted to download them instead of displaying proper processed content. It appeared that apache in Debian has by default PHP disabled for userdirs. To enable scripting in this dirctory, open file <tt>/etc/apache2/mods-enabled/php5.conf</tt>, find that piece of code:</p>
<pre class="brush: plain; title: ; notranslate">
    &lt;IfModule mod_userdir.c&gt;
        &lt;Directory /home/*/public_html&gt;
            php_admin_value engine Off
        &lt;/Directory&gt;
    &lt;/IfModule&gt;
</pre>
<p>and disable it, either by deleting or by commenting it out (precede each line with # sign). You can also change <tt>php_admin_value engine</tt> setting to On, but if you do that, you will be unable to turn off PHP engine in .htaccess files.</p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/05/04/linux-php-not-working-in-userdir-public_html/#comments" thr:count="31" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/05/04/linux-php-not-working-in-userdir-public_html/feed/atom/" thr:count="31" />
		<thr:total>31</thr:total>
	<feedburner:origLink>http://devplant.net/2010/05/04/linux-php-not-working-in-userdir-public_html/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[linux] Upgrading Debian Lenny to Testing halts on udev package]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/UYv1Bl_48Ho/" />
		<id>http://devplant.net/?p=134</id>
		<updated>2010-03-26T11:34:45Z</updated>
		<published>2010-03-26T11:34:45Z</published>
		<category scheme="http://devplant.net" term="Linux" /><category scheme="http://devplant.net" term="debian" /><category scheme="http://devplant.net" term="lenny" /><category scheme="http://devplant.net" term="squeeze" /><category scheme="http://devplant.net" term="stable" /><category scheme="http://devplant.net" term="testing" /><category scheme="http://devplant.net" term="upgrade" /><category scheme="http://devplant.net" term="virtualbox" />		<summary type="html"><![CDATA[Few days ago I wanted to create VirtualBox image of Debian Squeeze (current testing release). I already had Debian Lenny (stable) image, so the whole process seemed relatively easy &#8211; dist-upgrade Lenny, switch to &#8220;testing&#8221; apt sources, then dist-upgrade. It appeared easy, but in fact there were some bumps on the road. Dist-upgrade broke on [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/03/26/linux-upgrading-debian-lenny-to-testing-halts-on-udev-package/"><![CDATA[<p>Few days ago I wanted to create VirtualBox image of Debian Squeeze (current testing release). I already had Debian Lenny (stable) image, so the whole process seemed relatively easy &#8211; dist-upgrade Lenny, switch to &#8220;testing&#8221; apt sources, then dist-upgrade. It appeared easy, but in fact there were some bumps on the road. Dist-upgrade broke on &#8220;udev&#8221; package. From what I&#8217;ve understood, udev didn&#8217;t want to be upgraded while working with old kernel, and kernel wouldn&#8217;t be upgraded because of some unmet dependencies. At first it seemed that the upgrade upgrade process broke down the dependency system and the easiest way was to install the system from scratch. But udev package has an &#8220;emergency rope&#8221;. When you pull it, you promise udev that before the next reboot you will upgrade kernel &#8211; and udev will believe you and install. To use that rope, create an empty file /etc/udev/kernel-upgrade and then manually install the udev package, which already resides in /var/cache/apt/archives directory. After this you can continue dist-upgrade, using -f switch. So the whole set of commands to upgrade the distribution is:</p>
<pre class="brush: plain; title: ; notranslate">
apt-get update
apt-get dist-upgrade
cat &gt; /etc/apt/sources.list &lt;&lt; ENDF
deb http://ftp.us.debian.org/debian/ testing main
deb-src http://ftp.us.debian.org/debian/ testing main

deb http://security.debian.org/ testing/updates main contrib
deb-src http://security.debian.org/ testing/updates main contrib
ENDF

apt-get update
apt-get dist-upgrade
touch /etc/udev/kernel-upgrade
dpkg -i  /var/cache/apt/archives/udev_151-3_i386.deb
apt-get dist-upgrade -f
</pre>
<p>After that upgrade should finish. But be warned &#8211; after switching from lenny to squeeze I&#8217;ve experienced some problems like kernel not booting (I run previous version and regenerated initrd &#8211; it, or something else, helped), problems with VirtualBox guest additions (had to install kernel sources for guest additions to build themselves, then reinstalled virtualbox-ose-dkms package, and then reinstalled guest additions from the CD image attached to VirtualBox).</p>
<p>Upgraded system needs a few touches, but that&#8217;s not unusual. Don&#8217;t worry about &#8220;udevd : SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device&#8221; and similar messages while booting &#8211; it will be silenced in future versions of some packages. You can fix it if you want by replacing SYSFS with ATTR in /etc/udev/rules.d/* files, but other similar warnings will appear. You can also run <tt>upgrade-from-grub-legacy</tt> script, if you chose to chainload new grub from the old one during the upgrade. There is also significant amount of files in /var/cache/apt/archives, which can be safely deleted after successful upgrade (in my case it was 2.5GB of data).</p>
<p>Phew, now everything works and I have a proper VirtualBox image of Debian Squeeze.</p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/03/26/linux-upgrading-debian-lenny-to-testing-halts-on-udev-package/#comments" thr:count="17" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/03/26/linux-upgrading-debian-lenny-to-testing-halts-on-udev-package/feed/atom/" thr:count="17" />
		<thr:total>17</thr:total>
	<feedburner:origLink>http://devplant.net/2010/03/26/linux-upgrading-debian-lenny-to-testing-halts-on-udev-package/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[linux] Efficiently copy whole directory trees]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/jHL7qTETaIc/" />
		<id>http://devplant.net/?p=104</id>
		<updated>2010-03-05T07:29:17Z</updated>
		<published>2010-03-04T09:35:54Z</published>
		<category scheme="http://devplant.net" term="Linux" /><category scheme="http://devplant.net" term="backup" /><category scheme="http://devplant.net" term="copy" /><category scheme="http://devplant.net" term="tar" />		<summary type="html"><![CDATA[Recently I&#8217;ve upgraded my A/V storage disk from 1TB to 2TB (size of modern HDDs are amazing&#8230;), and I had to transfer data from one disk to another in some way. Easiest was of course to simply use cp to copy the whole directory structure. But as USB interface is slow enough, I wanted to [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/03/04/linux-efficiently-copy-whole-directory-trees/"><![CDATA[<p>Recently I&#8217;ve upgraded my A/V storage disk from 1TB to 2TB (size of modern HDDs are amazing&#8230;), and I had to transfer data from one disk to another in some way. Easiest was of course to simply use <tt>cp</tt> to copy the whole directory structure. But as USB interface is slow enough, I wanted to employ any possible method to speed things up.</p>
<p>From the old times as a sysadmin I&#8217;ve remembered that copying, doesn&#8217;t matter local or over the network, was faster if data was copied in chunks &#8211; that was true especially when having a lot of small files.</p>
<p>So, to kill two birds with one stone, I employed&#8230; <strong>tar</strong>. Yeah, it&#8217;s a very versatile tool &#8211; in some time I&#8217;ll describe how to use it as a part of a network encrypted backup solution. But here, I used only two instances of tar. You have to remember that if you specify absolute path to the directory you want to transfer, tar will record all elements of the path, only stripping &#8220;/&#8221; from the beginning. So there are two ways: either record whole path and strip it when &#8220;decompressing&#8221;, or not to include it at all.</p>
<p>Lets assume that we&#8217;re copying data from /media/external0 to /media/external1.</p>
<p>First option:</p>
<pre class="brush: plain; title: ; notranslate">
cd /media/external1
tar cf - /media/external0 | tar x -f - --strip-components=2
</pre>
<p>Second option:</p>
<pre class="brush: plain; title: ; notranslate">
cd /media/external0
tar cf - * | tar x -C /media/external1 -f -
</pre>
<p>The first tar command &#8220;compresses&#8221; the data (either from given directory or from the current one), sends it to the standard output, which goes into the second tar&#8217;s input, which decompresses it into the target directory.</p>
<p>To see the progress, you can put cpipe application in the middle like that:</p>
<pre class="brush: plain; title: ; notranslate">
tar cf - /media/external0 | cpipe -vt | tar x -f - --strip-components=2
</pre>
<p>One note on an improved performance using this method. I didn&#8217;t do any benchmarks, but it shouldn&#8217;t be worse than a standard <tt>cp</tt>. <tt>tar</tt> will be better if the OS is not using any smart pre-buffering. Also I&#8217;ve decided to write this entry as an introduction to a future one about over-the-net backup using <tt>tar</tt></p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/03/04/linux-efficiently-copy-whole-directory-trees/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/03/04/linux-efficiently-copy-whole-directory-trees/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://devplant.net/2010/03/04/linux-efficiently-copy-whole-directory-trees/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[Android] Disable screen timeout when charging]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/HKV_5dazX7w/" />
		<id>http://devplant.net/?p=109</id>
		<updated>2010-03-02T19:34:08Z</updated>
		<published>2010-03-02T19:34:08Z</published>
		<category scheme="http://devplant.net" term="Android" /><category scheme="http://devplant.net" term="screen" /><category scheme="http://devplant.net" term="timeout" />		<summary type="html"><![CDATA[If you ever wondered if it&#8217;s possible to keep screen from blanking/locking while the device is plugged into a charger, the answer is yes, it is possible, without any additional apps. Only the setting for this is strangely placed. To enable this feature, go into Menu → Settings → Applications → Development and tick &#8220;Stay [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2010/03/02/android-disable-screen-timeout-when-charging/"><![CDATA[<p>If you ever wondered if it&#8217;s possible to keep screen from blanking/locking while the device is plugged into a charger, the answer is yes, it is possible, without any additional apps. Only the setting for this is strangely placed. To enable this feature, go into Menu → Settings → Applications → Development and tick &#8220;Stay Awake&#8221;. That&#8217;s it.</p>
<p><a href="http://devplant.net/wp-content/uploads/2010/03/android-full.png" rel="lightbox"><img src="http://devplant.net/wp-content/uploads/2010/03/android-thumb.png" alt="" title="Screenshots" width="485" height="183" class="aligncenter size-full wp-image-113" /></a></p>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2010/03/02/android-disable-screen-timeout-when-charging/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2010/03/02/android-disable-screen-timeout-when-charging/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://devplant.net/2010/03/02/android-disable-screen-timeout-when-charging/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>leafnode</name>
						<uri>http://devplant.net/</uri>
					</author>
		<title type="html"><![CDATA[[PowerShell snippet] Resolving hostname]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devplant/~3/YZhM2yj698w/" />
		<id>http://devplant.net/?p=75</id>
		<updated>2009-11-30T12:45:08Z</updated>
		<published>2009-11-30T12:45:08Z</published>
		<category scheme="http://devplant.net" term="Programming" /><category scheme="http://devplant.net" term="Software" /><category scheme="http://devplant.net" term="dns" /><category scheme="http://devplant.net" term="powershell" /><category scheme="http://devplant.net" term="resolve" /><category scheme="http://devplant.net" term="snippets" />		<summary type="html"><![CDATA[Recently I&#8217;ve started to embrace PowerShell&#8217;s great possibilities, and as a result of that, I&#8217;ll post some of my &#8220;toys&#8221;. On Unix-like operating system I&#8217;m using host command to resolve hostnames into IP&#8217;s and the other way. On Windows, there&#8217;s a nslookup tool, which works just like the Unix equivalent, but to get accustomed to [...]]]></summary>
		<content type="html" xml:base="http://devplant.net/2009/11/30/powershell-snippet-resolving-hostname/"><![CDATA[<p><em>Recently I&#8217;ve started to embrace PowerShell&#8217;s great possibilities, and as a result of that, I&#8217;ll post some of my &#8220;toys&#8221;.</em></p>
<p>On Unix-like operating system I&#8217;m using <tt>host</tt> command to resolve hostnames into IP&#8217;s and the other way. On Windows, there&#8217;s a <tt>nslookup</tt> tool, which works just like the Unix equivalent, but to get accustomed to PowerShell, I&#8217;ve decided to write a function, which uses internal command to do NS lookups.</p>
<p>Generally, to resolve a hostname you can use this one-liner:</p>
<pre class="brush: powershell; title: ; notranslate">
[System.Net.Dns]::GetHostAddresses(&quot;devplant.net&quot;)
</pre>
<p>You can shorten it by declaring a short function.</p>
<pre class="brush: powershell; title: ; notranslate">
function resolve( [string] $in ){
   [System.Net.Dns]::GetHostAddresses($in)
}
</pre>
<p>(Defining functions remember not to collide with pre-existing variable names)</p>
<p>But this is only one-way command &#8211; to resolve IP address into a hostname, you have to use other command:</p>
<pre class="brush: powershell; title: ; notranslate">
[System.Net.Dns]::GetHostbyAddress(&quot;72.21.210.250&quot;)
</pre>
<p>To combine both functionalities, you can extend our function, using regular expression to do a naive recognition of IP addresses.</p>
<pre class="brush: powershell; title: ; notranslate">
function resolve( [string] $in ){
	if ($in -match &quot;(\d{1,3}\.){3}(\d{1,3})&quot;) {
		[System.Net.Dns]::GetHostbyAddress($in)
	} else {
		[System.Net.Dns]::GetHostAddresses($in)
	}
}
</pre>
<p>Now here&#8217;s how you can use it:</p>
<pre class="brush: plain; title: ; notranslate">
PS C:\Users\leafnode&gt; resolve devplant.net

IPAddressToString : 91.192.224.142
Address           : 2397093979
AddressFamily     : InterNetwork
ScopeId           :
IsIPv6Multicast   : False
IsIPv6LinkLocal   : False
IsIPv6SiteLocal   : False

PS C:\Users\leafnode&gt; resolve 72.21.210.250

HostName                Aliases           AddressList
--------                -------           -----------
210-250.amazon.com      {}                {72.21.210.250}

PS C:\Users\leafnode&gt;
</pre>
]]></content>
		<link rel="replies" type="text/html" href="http://devplant.net/2009/11/30/powershell-snippet-resolving-hostname/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://devplant.net/2009/11/30/powershell-snippet-resolving-hostname/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://devplant.net/2009/11/30/powershell-snippet-resolving-hostname/</feedburner:origLink></entry>
	</feed>

