<?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>Sébastien Barbieri's blog &#187; freelance</title>
	<atom:link href="http://blog.sbw.be/category/freelance/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sbw.be</link>
	<description>My life, my work, my projects</description>
	<lastBuildDate>Sat, 24 Dec 2011 00:12:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Continuous Integration phpunit code coverage use a bit less than 2 Gigs !!!</title>
		<link>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/</link>
		<comments>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 18:28:08 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[je bosse là]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=450</guid>
		<description><![CDATA[2 gigs !!! gasp&#8230; I had several: Generating code coverage report, this may take a moment.PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 21503527 bytes) in /usr/share/php/PHPUnit/Util/Report/Node/File.php on line 406 And here is how it started: At work we are using phpunit to test our framework, we flew from SimpleTest [...]]]></description>
			<content:encoded><![CDATA[<p><strong>2 gigs !!!</strong> <em>gasp</em>&#8230; </p>
<p>I had several:</p>
<p><strong>Generating code coverage report, this may take a moment.PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 21503527 bytes) in /usr/share/php/PHPUnit/Util/Report/Node/File.php on line 406<br />
</strong></p>
<p>And here is how it started:</p>
<p>At work we are using <a href="http://www.phpunit.de/">phpunit</a> to test our framework, we flew from <a href="http://www.simpletest.org/">SimpleTest</a> as there was no real integration with our tools and no real followup of the the product.</p>
<p>So to automate the test, as there is no &#8220;build&#8221; in php (interpreted vs compiled remember?) we ran it after each commit &#8230;</p>
<p>Until it tooks 30 minutes to run throught the whole set of tests&#8230;</p>
<p><span id="more-450"></span><br />
Then we decided to run it locally before comitting&#8230; until it tooks up to 2 hours to run tests (yes we have slow laptops I know, at least 4 times slower than the servers).</p>
<p>Actually we use phpunit for recipe test, including database change, third parties, providers&#8230; everything from A to Z&#8230; and that needs a lot of time and CPU power&#8230;</p>
<p>So we solved the problem by running test in a cronjob, hourly on the integration server.</p>
<p>This was done running phpunit in command line</p>
<p><code lang="bash"><br />
&gt; phpunit --include-path ../code/ MyTestSuite.php<br />
</code></p>
<p>Of course as we had several tests suites and we had to put them all in one bigger testsuite&#8230; but that was not easy so we moved to the Phpunit config file, added code coverage reporting and send a mail everytime sometimes goes wrong</p>
<p><strong>PhpunitConfig.xml</strong></p>
<p><code lang="xml"></p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;phpunit
         colors=&quot;true&quot;
         &gt;
         &lt;testsuites&gt;
         	&lt;testsuite name=&quot;RTBF_Service&quot;&gt;
         		&lt;file&gt;RTBF/Service/Rating/Adapter/AbstractPhpunittest.php&lt;/file&gt;
         		&lt;file&gt;RTBF/Service/Rating/Adapter/MediaPhpunittest.php&lt;/file&gt;
         	&lt;--! ... --&gt;
         	&lt;/testsuite&gt;
         	&lt;testsuite name=&quot;RTBF&quot;&gt;
         		&lt;file&gt;RTBF/AclPhpunittest.php&lt;/file&gt;
         	&lt;/testsuite&gt;
         	&lt;testsuite name=&quot;RTBF_Utility&quot;&gt;
         		&lt;file&gt;RTBF/Utility/AjaxConnectorPhpunittest.php&lt;/file&gt;
	         	&lt;--! ... --&gt;
         	&lt;/testsuite&gt;
         	&lt;--! ... --&gt;
	&lt;/testsuites&gt;
	&lt;listeners&gt;
  		&lt;listener class=&quot;SimpleTestListener&quot; file=&quot;PhpunitTestListener.php&quot;&gt;
  		&lt;/listener&gt;
  	&lt;/listeners&gt;
  	&lt;!--
	&lt;logging&gt;
		&lt;log type=&quot;coverage-html&quot; target=&quot;/reporting/phpunit/library/&quot; charset=&quot;UTF-8&quot; /&gt;
	&lt;/logging&gt;
	--&gt;
	&lt;php&gt;
		&lt;ini name=&quot;memory_limit&quot; value=&quot;2047M&quot; /&gt;
	&lt;/php&gt;
	&lt;filter&gt;
	  &lt;blacklist&gt;
	    &lt;directory suffix=&quot;.php&quot;&gt;library/code/Zend&lt;/directory&gt;
	  &lt;/blacklist&gt;
	&lt;/filter&gt;
&lt;/phpunit&gt;
</pre>
<p></code></p>
<p><strong>PhpunitTestListener.php</strong></p>
<p><code lang="php"></p>
<pre class="brush: php; title: ;">
class SimpleTestListener implements PHPUnit_Framework_TestListener
{
	private $emailContent=array(self::Error=&gt;&quot;&quot;,self::Failure=&gt;&quot;&quot;,self::Incomplete=&gt;&quot;&quot;,self::Skipped=&gt;&quot;&quot;);
	private $assertions=0;
	private $itemCount=array(self::Error=&gt;0,self::Failure=&gt;0,self::Incomplete=&gt;0,self::Skipped=&gt;0);
	private $totalItems=0;

	const Error=&quot;Error&quot;;
	const Failure=&quot;Failure&quot;;
	const Incomplete=&quot;Incomplete&quot;;
	const Skipped=&quot;Skipped&quot;;

	private function addEmailContent($severity,$test,$e){
		$result = $test-&gt;getResult();
		$traces = $e-&gt;getTrace();
		$continue=true;
		$tracingMessage=&quot;&quot;;
		for($i=1;$i&lt;count($traces)&amp;&amp;$continue;$i++){
			if(isset($traces[$i]['file'])){
				$tracingMessage.=$traces[$i]['file'].&quot;:(&quot;.$traces[$i]['line'].&quot;)\n\t&quot;;
			}else{
				$continue=false;
			}
		}
		$this-&gt;itemCount[$severity]++;
		$this-&gt;emailContent[$severity].=$this-&gt;itemCount[$severity].&quot;)\t&quot;.get_class($test).'::'.$test-&gt;getName(TRUE).&quot;\n\t&quot;.str_replace(&quot;\n&quot;,&quot;\n\t&quot;,PHPUnit_Framework_TestFailure::exceptionToString($e)).&quot;&quot;.$tracingMessage.&quot;\n\n&quot;;
		$this-&gt;totalItems++;
	}

	public function addError(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Error,$test,$e);
	}

	public function addFailure(PHPUnit_Framework_Test $test,PHPUnit_Framework_AssertionFailedError $e,$time){
		$this-&gt;addEmailContent(self::Failure,$test,$e);
	}

	public function addIncompleteTest(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Incomplete,$test,$e);
	}

	public function addSkippedTest(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Skipped,$test,$e);
	}

	public function startTest(PHPUnit_Framework_Test $test){
	}

	public function endTest(PHPUnit_Framework_Test $test, $time){
	}

	public function startTestSuite(PHPUnit_Framework_TestSuite $suite){
	}

	public function endTestSuite(PHPUnit_Framework_TestSuite $suite){
	}

	public function __destruct(){
		if($this-&gt;totalItems&gt;0){
			// HIDDEN but concat everything from $this-&gt;emailContent nicely and send the mail
			//print(&quot;\n\nMail sent: &quot;.$text.&quot;\n&quot;);
		}
	}
}
</pre>
<p></code></p>
<p>That&#8217;s it for the big picture&#8230;</p>
<p>And as you can see there are several point in the XML that are quite important:</p>
<p><strong>memory limit 2047MB</strong>that&#8217;s huge&#8230; but this is the price to pay to have a fully working code-coverage HTML report. As we are using <a href="http://www.hardened-php.net/suhosin/">suhosin</a> we had to change the memory limit in suhosin too&#8230; and yes when the limit is 2048 MB don&#8217;t try to set the memory to 2048 MB it really means this is a limit you have to be under that limit (here 2047 MB).</p>
<p><strong>2 Gigs!!!</strong> I know this is huge but believe me I went through several tries and 128 MB was not enought, nor 256 MB, nor 512 MB, not even 1 GB &#8230; I didn&#8217;t try to see where is my limit &#8230; I put 2 gigs and then it worked&#8230; we have about 30% of lines covered so I think that if we shift to 100% we will have to give more memory&#8230; I&#8217;m pretty sure, there is something leaking somewhere&#8230; but according to phpunit.de site&#8230; I have the answer remains: <a href="https://github.com/sebastianbergmann/php-code-coverage/issues/closed/#issue/26">Give more memory</a></p>
<p><strong>/etc/php5/conf.d/suhosin.ini</strong><br />
<code></p>
<p>...<br />
suhosin.memory_limit = 2048M<br />
...</p>
<p></code></p>
<p><strong>logging</strong> is commented out because logging needs xdebug and while we stay with ZendServer CE we do not have xdebug&#8230; (see my previous post for more info). </p>
<p>But the server which is not running Zend Server CE does!</p>
<p>So I commented out the line in the config to let developers run the unit test and pasted it as command line argument on the server&#8217;s cronjob.</p>
<p><code lang="bash"></p>
<pre class="brush: bash; title: ;">
phpunit --include-path ../code/ --coverage-html /reporting/phpunit/library/ --configuration PhpunitConfig.xml
</pre>
<p></code></p>
<p><strong>the listener</strong> This is a simple easy listener. It&#8217;s always useful to have one sample so I pasted here above, feel free to copy, enhance&#8230; The only &#8216;hack&#8217; we use it to call the send email on listener destruction, so the email will be sent at the end. But there is a drawback&#8230; if there is a php error somewhere, nothing is sent. And as nothing is sent when everythign goes well&#8230; we dont know if everythings goes well or if there is a real bug&#8230;<br />
This problem will be addressed later. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>installing xdebug on ubuntu with Zend Server CE (not solved yet)</title>
		<link>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/</link>
		<comments>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 10:16:09 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xdebug]]></category>
		<category><![CDATA[zend server ce]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=439</guid>
		<description><![CDATA[You need to sudo user@laptop:~$ sudo bash 1st be sre to have the pecl, pear available as root in command line root@laptop:~# PATH=$PATH:/usr/local/zend/bin trying to install root@laptop:~# pecl install xdebug downloading xdebug-2.1.0.tgz ... Starting to download xdebug-2.1.0.tgz (301,354 bytes) .....................................................done: 301,354 bytes 66 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend [...]]]></description>
			<content:encoded><![CDATA[<p>You need to sudo</p>
<p><code>user@laptop:~$ sudo bash</code></p>
<p>1st be sre to have the pecl,  pear available as root in command line</p>
<p><code>root@laptop:~# PATH=$PATH:/usr/local/zend/bin</code></p>
<p>trying to install</p>
<p><code>root@laptop:~# pecl install xdebug<br />
downloading xdebug-2.1.0.tgz ...<br />
Starting to download xdebug-2.1.0.tgz (301,354 bytes)<br />
.....................................................done: 301,354 bytes<br />
66 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
Cannot find autoconf. Please check your autoconf installation and the<br />
$PHP_AUTOCONF environment variable. Then, rerun this script.</p>
<p>ERROR: `phpize' failed<br />
</code><br />
Argl it seems to be failing&#8230;</p>
<p>looks like autoconf is missing</p>
<p><code>root@laptop:~# autoconf<br />
The program 'autoconf' can be found in the following packages:<br />
 * autoconf<br />
 * autoconf2.13<br />
Try: apt-get install &lt;selected package&gt;<br />
</code></p>
<p>ok let&#8217;s add it:</p>
<p><code><br />
root@laptop:~# apt-get install autoconf<br />
</code></p>
<p>and now let&#8217;s try again</p>
<p><code><br />
root@laptop:~# pecl install xdebug<br />
downloading xdebug-2.1.0.tgz ...<br />
Starting to download xdebug-2.1.0.tgz (301,354 bytes)<br />
.............................................................done: 301,354 bytes<br />
66 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
configure.in:3: warning: prefer named diversions<br />
configure.in:3: warning: prefer named diversions<br />
building in /var/tmp/pear-build-root/xdebug-2.1.0<br />
running: /tmp/pear/temp/xdebug/configure<br />
checking for grep that handles long lines and -e... /bin/grep<br />
checking for egrep... /bin/grep -E<br />
checking for a sed that does not truncate output... /bin/sed<br />
checking for cc... cc<br />
...<br />
Build process completed successfully<br />
Installing '/usr/local/zend/lib/php_extensions/xdebug.so'<br />
install ok: channel://pecl.php.net/xdebug-2.1.0<br />
configuration option "php_ini" is not set to php.ini location<br />
You should add "extension=xdebug.so" to php.ini<br />
</code></p>
<p>Great!</p>
<p>Don&#8217;t forget to add the librairy in the php.ini</p>
<p>create the xdebug.ini in the ext.d directory and the symlink in the conf.d directory</p>
<p><code><br />
root@laptop:/usr/local/zend/etc/ext.d# more xdebug.ini<br />
zend_extension=/usr/local/zend/lib/php_extensions/xdebug.so<br />
; You may put any extension-specific directives here</p>
<p>root@laptop:/usr/local/zend/etc/conf.d# ln -s ../ext.d/xdebug.ini xdebug.ini<br />
</code></p>
<p>Now let&#8217;s try PHP:</p>
<p><code>scips@laptop:~$ php<br />
Segmentation fault<br />
</code></p>
<p>Looks like I need to investigate deeper&#8230;</p>
<p>Ok problem solved:</p>
<blockquote><p><strong>Instructions</strong></p>
<p><em><strong>Warning: You seem to be using Zend Server, which is known to cause issues with Xdebug. It might work, but you&#8217;re on your own.</strong></em></p>
<p>Download xdebug-2.1.0.tgz<br />
Unpack the downloaded file with tar -xvzf xdebug-2.1.0.tgz<br />
Run: cd xdebug-2.1.0<br />
Run: phpize</p>
<p>As part of its output it should show:</p>
<p>Configuring for:<br />
&#8230;<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.</p>
<p>Run: ./configure<br />
Run: make<br />
Run: cp modules/xdebug.so /usr/local/zend/lib/php_extensions<br />
Open /usr/local/zend/etc/conf.d/debugger.ini and put a ; in front of the line that says zend_extension_manager.dir.debugger= so that it says ;zend_extension_manager.dir.debugger=<br />
Edit /usr/local/zend/etc/php.ini and add at the begining of the file the line<br />
zend_extension = /usr/local/zend/lib/php_extensions/xdebug.so
</p></blockquote>
<p>I did just paste in has requested my php -i output on <a href="http://xdebug.org/find-binary.php">http://xdebug.org/find-binary.php</a> then compiled and everything ran fine.</p>
<p>The problem is that you have to use one or the other not the both at the same time&#8230; still not a real option for me. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion backup &amp; restore</title>
		<link>http://blog.sbw.be/2010/10/07/subversion-backup-restore/</link>
		<comments>http://blog.sbw.be/2010/10/07/subversion-backup-restore/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 20:39:02 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=435</guid>
		<description><![CDATA[Get it first of all you need the best script ever made to backup subversion: the one provided with! Get it here: http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in This script needs to be modified replace: # Path to svnlook utility svnlook = r"@SVN_BINDIR@/svnlook" # Path to svnadmin utility svnadmin = r"@SVN_BINDIR@/svnadmin" with: # Path to svnlook utility svnlook = r"/usr/bin/svnlook" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Get it</strong></p>
<p>first of all you need the best script ever made to backup subversion: the one provided with!</p>
<p>Get it here: <a href="http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in">http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in</a></p>
<p>This script needs to be modified</p>
<p>replace:</p>
<p><code lang="python"><br />
# Path to svnlook utility<br />
svnlook = r"@SVN_BINDIR@/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"@SVN_BINDIR@/svnadmin"<br />
</code></p>
<p>with:</p>
<p><code lang="python"><br />
# Path to svnlook utility<br />
svnlook = r"/usr/bin/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"/usr/bin/svnadmin"<br />
</code></p>
<p>or your appropriate svnlook and svnadmin path</p>
<p>Then you need to check that your user can modify files</p>
<p>once it&#8217;s verified let&#8217;s create a repository to store backup &#8216;/backup&#8217; for instance and create your directory structure there</p>
<p><strong>Test it</strong></p>
<p>test the whole stuff<br />
<code><br />
./hot-backup.py --archive-type=bz2 --num-backups=45 /svn/TEST_REPO/ /backup/subversion/test_repo/<br />
</code></p>
<p>you should get something like TEST_REPO-2.tar.bz2 (here minus 2 means revision n°2)</p>
<p><strong>Schedule it</strong></p>
<p>If you want to run it daily, put it in a cron such as a daily job</p>
<p>As I have multiple repositories here is my script</p>
<p><code lang="bash"><br />
#!/bin/bash<br />
NUMBACKUP=15<br />
for i in `ls /svn/`<br />
do<br />
        mkdir -p /backup/svn/$i<br />
        ./hot-backup.py --archive-type=bz2 --num-backups=$NUMBACKUP /svn/$i /backup/svn/$i<br />
done<br />
</code></p>
<p><strong>Restore it</strong></p>
<p>Ok that&#8217;s nice, you got a backup, but unless you can restore it, it&#8217;s useless!</p>
<p>So here is how to restore it:</p>
<ol>
<li>tar -xjvf /backup/svn/TEST/test-2.tar.bz2</li>
<li>cp -R /backup/svn/TEST/TEST-2/ /svn/TEST/</li>
</ol>
<p>and&#8230; that&#8217;s it</p>
<p>of course at the end of your backup script I recommend to move everything to another computer, because you will probably need it when disk crashes ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/10/07/subversion-backup-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That&#8217;s it I&#8217;m in</title>
		<link>http://blog.sbw.be/2010/04/28/thats-it-im-in/</link>
		<comments>http://blog.sbw.be/2010/04/28/thats-it-im-in/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 15:34:22 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[csm]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=405</guid>
		<description><![CDATA[I&#8217;m officially Certified Scrum Master: http://www.scrumalliance.org/profiles/88649-sebastien-barbieri]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m officially Certified Scrum Master: <a href="http://bit.ly/9wG5pM">http://www.scrumalliance.org/profiles/88649-sebastien-barbieri</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/04/28/thats-it-im-in/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#web #continuous #integration: #Autodeploy on #commit</title>
		<link>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/</link>
		<comments>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 20:13:13 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=341</guid>
		<description><![CDATA[Option 1 In 4 steps svn commit to the repository the pre-commit hook will check the code with svnlook and will validate the commit message (based on regexp such has bug# &#8230;, text minimal size&#8230;) the post-commit hook will try to connect to the ITT (Integration Team Testing) if you have the good acronym, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Option 1</strong></p>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 1011px"><a href="http://blog.sbw.be/wp-content/uploads/2009/12/PostCommitAutoDeploy.png"><img src="http://blog.sbw.be/wp-content/uploads/2009/12/PostCommitAutoDeploy.png" alt="post commit auto deploy" title="PostCommitAutoDeploy" width="1001" height="449" class="size-full wp-image-342" /></a><p class="wp-caption-text">post commit auto deploy</p></div>
<p>In 4 steps</p>
<ol>
<li><strong>svn commit</strong> to the repository</li>
<li>the <strong>pre-commit hook</strong> will check the code with <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.tk.svnlook">svnlook</a> and will validate the commit message (based on regexp such has bug# &#8230;, text minimal size&#8230;)</li>
<li>the <strong>post-commit hook</strong> will try to connect to the ITT (Integration Team Testing) <em>if you have the good acronym, I&#8217;ll update</em></li>
<li>once connected a script should be launched (and forgot &#038;;) This script should:
<ul>
<li><strong>Do a svn checkout locally so the code could be tested (in /var/www &#8230;)</strong>. <em>This method has several drawback:  instability of the site while exporting, destruction of ITT generated file (if any)&#8230;</em></li>
<li>Do a<strong> svn checkout in a temporary directory</strong> (/export/&lt;projectname&gt;) and then use <strong>rsync</strong> to do a fast compare and copy changes only without deleting the existing, excluding the .svn folders</li>
<li>Do a<strong> svn export in a temporary directory</strong> (/tmp/&lt;projectname&gt;) and then use the same <strong>rsync</strong> than above but this time you don&#8217;t have to exclude the .svn</li>
</ul>
<p>The fastest is the second one (svn checkout -> /export/&lt;projectname&gt; + rsync &#8211; .svn folders)
 </li>
</ol>
<p><strong>Option 2</strong></p>
<p>There is another <strong>alternative</strong> if you have space and sufficient right on your <strong>svn repository</strong>: the svn export/svn checkout is done locally and you use rsync to <strong>deploy</strong> the site on the ITT server.</p>
<p><strong>Option 3</strong></p>
<p>There is a third <strong>alternative</strong> if you have one more server (a synchro server) that will be used to store the svn export (at least the last one and maybe 2-3 version before) and that will take care of the rsync between one of its local checkout/export and the ITT server.</p>
<p><strong>Conclusion</strong></p>
<p>The last option has the big advantage of being a intermediate repository that can deploy any revision to any server &#8230; but that&#8217;s another paper.</p>
<p>I used the 3 options, and the first one (the simplest/cheapest) is very easy to maintain and to set up, so it&#8217;s a must have for team < 15 &#8230; bigger team may think about the other options but will have to put additional resources to design the whole deployment system.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bru-GTUG #1 Date Poll</title>
		<link>http://blog.sbw.be/2009/11/24/bru-gtug-1-date-poll/</link>
		<comments>http://blog.sbw.be/2009/11/24/bru-gtug-1-date-poll/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 07:37:44 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[bru-gtug]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hackaton]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=334</guid>
		<description><![CDATA[Feel free to participate in the Bru-GTUG #1]]></description>
			<content:encoded><![CDATA[<p>Feel free to participate in the Bru-GTUG #1</p>
<p><iframe width="300" height="250" frameborder="0" src="http://www.doodle.com/summary.html?pollId=6939wknuzkwkwweq"> </iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/11/24/bru-gtug-1-date-poll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox Ubiquity php search handy command</title>
		<link>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/</link>
		<comments>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:22:35 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=301</guid>
		<description><![CDATA[Just created a Firfow Ubiquity php search command based on 2 other work: http://download.sbw.be/projects/ubiquity/php-search.html]]></description>
			<content:encoded><![CDATA[<p>Just created a Firfow Ubiquity php search command based on 2 other work: <a href="http://download.sbw.be/projects/ubiquity/php-search.html">http://download.sbw.be/projects/ubiquity/php-search.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really impress by Google Wave error handling + reporting</title>
		<link>http://blog.sbw.be/2009/07/20/really-impress-by-google-wave-error-handling-reporting/</link>
		<comments>http://blog.sbw.be/2009/07/20/really-impress-by-google-wave-error-handling-reporting/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 08:36:18 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=286</guid>
		<description><![CDATA[While muting a wave and moving it to the trash folder :-) I can&#8217;t wait to wave :P]]></description>
			<content:encoded><![CDATA[<div id="attachment_287" class="wp-caption alignnone" style="width: 1034px"><img src="http://blog.sbw.be/wp-content/uploads/2009/07/google_wave_error_handling-1024x216.png" alt="Dr. Wave ready to listen" title="google_wave_error_handling" width="800" height="169" class="size-large wp-image-287" /><p class="wp-caption-text">Dr. Wave ready to listen</p></div>
<p>While muting a wave and moving it to the trash folder :-)</p>
<p>I can&#8217;t wait to wave :P</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/07/20/really-impress-by-google-wave-error-handling-reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The last day of epoch (32) &#8211; toute une époque :-)</title>
		<link>http://blog.sbw.be/2009/06/13/the-last-day-of-epoch-32-toute-une-epoque/</link>
		<comments>http://blog.sbw.be/2009/06/13/the-last-day-of-epoch-32-toute-une-epoque/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 11:30:08 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[8th chakra]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[Questions existentielles]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[epoch]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=261</guid>
		<description><![CDATA[Is Tue, 19 Jan 2038 04:14:07 +0100. The next second, we will be back on Fri, 13 Dec 1901 20:55:13 +0009. And unfortunately, I will not be retired at that time&#8230; I&#8217;m pretty sure that it will be like in the 80s with every developer thinking that his code will last only few months (years)&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Is <strong>Tue, 19 Jan 2038 04:14:07 +0100</strong>.<br />
The next second, we will be back on <strong>Fri, 13 Dec 1901 20:55:13 +0009</strong>.</p>
<p>And unfortunately, I will not be retired at that time&#8230; I&#8217;m pretty sure that it will be like in the 80s with every developer thinking that his code will last only few months (years)&#8230; when it will actually last much longer.</p>
<p>Most of the liunuix (linux and unix) systems use timestamp stored as an unisgned integer 32 bit starting Thu, 01 Jan 1970 01:00:00 +0100.</p>
<p>The idea was to be able to measure time for a &#8220;long&#8221; period of time, from now (in the 70s) and in the past.<br />
So they decided to use half of the 2^32 for the past (prior to 1/1/1970) and the other half for the future.</p>
<p>So be it&#8230;</p>
<p>Now we are about 40 years later, and we still use the same representation. We already had a party for the <a href="http://code.sbw.be/php/timestamp.php?timestamp=1234567890">unix timestamp 1234567890</a> (which is quite stupid because it&#8217;s in base 10).</p>
<p>And now javascript, Java, PHP and C &#8230; use the unix timestamp&#8230; which means ajax, web 2.0, comet &#8230; which means: most of the online banking system, internet sites and all the smalls scripts that in few line check your credential and your billing to allow you to connect to the Internet&#8230; All the logging system, all the monitoring systems&#8230; well everything that you don&#8217;t see, just under the internet sea you surf on.</p>
<p>So what will be the next party thema?</p>
<ul>
<li>the end of the internet as we knew it</li>
<li>the end of the unix system</li>
<li>the 0&#215;80000000 seconds since epoch?</li>
</ul>
<p>Anyway, because of the ongoing ecological breakdown, the human kind will probably collapse before&#8230; so after the <a href="http://en.wikipedia.org/wiki/Y2K38">Y2K38</a> bug, the world will just be their kingdom. The kingdom of bugs.</p>
<p>Unless we spend time (which is running) in each of our application to think about that right now (and if we spend just about the same amount of time solving the earth ecology problem it will not be useless).</p>
<p><script language="javascript" type="text/javascript">
today  = new Date();
todayEpoch  = today.getTime();
targetEpoch = 2147483647000;</p>
<p>daysLeft = Math.floor(((targetEpoch - todayEpoch) / (60*60*24)) / 1000);
document.write("You still have: "+daysLeft+" days ");
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/06/13/the-last-day-of-epoch-32-toute-une-epoque/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quechup is selling (let steal) e-mail adresses: honey pot #1 triggered</title>
		<link>http://blog.sbw.be/2009/04/03/quechup-is-selling-let-steal-e-mail-adresses-honey-pot-1-triggered/</link>
		<comments>http://blog.sbw.be/2009/04/03/quechup-is-selling-let-steal-e-mail-adresses-honey-pot-1-triggered/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 07:41:24 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[email marketing]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/2009/04/03/quechup-is-selling-let-steal-e-mail-adresses-honey-pot-1-triggered/</guid>
		<description><![CDATA[My subscription to quechup was used for spam mail such has: Cindy Foster &#8211; CindyFoster1533@live.com to quechupxxx@xxx.sbw.be H! I find your post interesting. I am pretty chick. I am moving to your area from russia I am looking for a good man to show me around and may be more ;) Could you please kindly [...]]]></description>
			<content:encoded><![CDATA[<p>My subscription to <a href="http://www.quechup.com/">quechup</a> was used for spam mail such has:</p>
<blockquote><p>Cindy Foster &#8211; CindyFoster1533@live.com<br />
 to quechupxxx@xxx.sbw.be</p>
<p>H! I find your post interesting. I am pretty chick. I am moving to your area from russia<br />
I am looking for a good man to show me around and may be more ;)<br />
Could you please kindly reply to me at jclapptakomapark@gmail.com<br />
I will send you some of my pictures back in reply.<br />
Could you reply to my email account I am supplying in the body of this email as I am writing from my work email which i don&#8217;t use for personal correspondence</p>
<p>Windows Live™: Keep your life in sync. Check it out.
</p></blockquote>
<p>&#8211;> Don&#8217;t use quechup</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/04/03/quechup-is-selling-let-steal-e-mail-adresses-honey-pot-1-triggered/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

