<?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>Philippe Dellaert</title>
	<atom:link href="http://dellaert.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://dellaert.org</link>
	<description></description>
	<lastBuildDate>Thu, 08 Mar 2012 10:48:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta name="generator" content="deStyle 0.9.3" />
		<item>
		<title>Upgrading Redmine from 0.9.x to 1.3.x</title>
		<link>http://dellaert.org/2012/03/06/upgrading-redmine-from-0-9-x-to-1-3-x/</link>
		<comments>http://dellaert.org/2012/03/06/upgrading-redmine-from-0-9-x-to-1-3-x/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 22:05:00 +0000</pubDate>
		<dc:creator>straks</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dellaert.org/?p=254</guid>
		<description><![CDATA[Today i was asked by a client to upgrade his Redmine setup from version 0.9.3 to the latest stable version. As his server is running Ubuntu 10.04 LTS and he installed Redmine using the Ubuntu repositories, this wasn&#8217;t the easiest or smoothest task i&#8217;ve ever done. I suspected that upgrading from 0.9.3 directly to 1.3-stable [...]]]></description>
			<content:encoded><![CDATA[<p>Today i was asked by <a href="http://www.kapernikov.com/" target="_blank">a client</a> to upgrade his <a title="Redmine" href="http://redmine.org">Redmine</a> setup from version 0.9.3 to the latest stable version. As his server is running Ubuntu 10.04 LTS and he installed Redmine using the Ubuntu repositories, this wasn&#8217;t the easiest or smoothest task i&#8217;ve ever done.</p>
<p>I suspected that upgrading from 0.9.3 directly to 1.3-stable would be a nightmare, so i was planning on upgrading to 1.0-stable, then to 1.1-stable, then 1.2-stable and finally 1.3-stable.</p>
<p>All looked well, and i started taking backups. Of course, the whole Redmine installation was setup using the Ubuntu repositories, so clearly, all of the ruby, rails, rake and rubygems packages were from Ubuntu 10.04. Which would cause a bit of a problem, as i needed newer versions of certain packages. So i ran the following commands (after taking backups of course.) to remove redmine and all it&#8217;s dependencies and reinstall whatever is necessary to run rubygems, rake and libapache2-mod-passenger.</p>
<pre class="crayon-plain-tag"><code>aptitude remove redmine
aptitude install rubygems rake libapache2-mod-passenger</code></pre>
<p>This made sure i had a basic setup. After that i used svn to get all the versions</p>
<pre class="crayon-plain-tag"><code>svn co http://redmine.rubyforge.org/svn/branches/1.0-stable redmine-1.0
svn co http://redmine.rubyforge.org/svn/branches/1.1-stable redmine-1.1
svn co http://redmine.rubyforge.org/svn/branches/1.2-stable redmine-1.2
svn co http://redmine.rubyforge.org/svn/branches/1.3-stable redmine-1.3</code></pre>
<p>This gave me the opportunity to just go into the appropriate directory, follow the guide on <a title="Redmine upgrade" href="http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade">Redmine.org on how to upgrade</a> and do that for each major release. On occasion rake would throw me an exception stating i needed a gem installed or a newer version installed, but overall that wasn&#8217;t a real problem. Just make sure you run</p>
<pre class="crayon-plain-tag"><code>gem install -v=&lt;correct version&gt; &lt;gemname&gt;</code></pre>
<p>This all went good until i got to the point of upgrading to 1.3. Apparently version 1.3 needs a later release off rubygems. Whenever i tried running rake to do the db migration, i ended up getting the following error:</p>
<pre class="crayon-plain-tag"><code>rake aborted!
super: no superclass method `requirement' for &lt;rails::gemdependency:0x7f9e87ea7a18&gt;;</code></pre>
<p>This is a little problematic as the Ubuntu 10.04 LTS repository does not allow for a newer version to be installed from it. My solution was to just get the package from a newer distribution using a backport available thanks to a <a title="Mackenzie Morgan Ubuntu PPA" href="https://launchpad.net/~maco.m/+archive/ruby" target="_blank">Ubuntu PPA from Mackenzie Morgan</a> (Thanks!):</p>
<pre class="crayon-plain-tag"><code>add-apt-repository ppa:maco.m/ruby
aptitude update
aptitude install rubygems</code></pre>
<p>This installs a version which can be used by Redmine 1.3-stable. After that, everything looked great, i could log in, i checked the configuration and it worked!</p>
<p>Or i thought&#8230; Whenever i opened the issues list of the project, i would get a Server error (500), the log reflected this:</p><pre class="crayon-plain-tag"><code>ActionView::TemplateError (undefined method `-' for nil:NilClass) on line #28 of app/views/issues/_list.html.erb:
25:     
26:     &lt; % previous_group = group %&gt;
27:   &lt; % end %&gt;
28:   &lt;tr id=&quot;issue-&lt;%= issue.id %&gt;&quot; class=&quot;hascontextmenu &lt; %= cycle('odd', 'even') %&gt; &lt; %= issue.css_classes %&gt; &lt; %= level &gt; 0 ? &quot;idnt idnt-#{level}&quot; : nil %&gt;&quot;&gt;
29:     &lt;td class=&quot;checkbox hide-when-print&quot;&gt;&lt; %= check_box_tag(&quot;ids[]&quot;, issue.id, false, :id =&gt; nil) %&gt;&lt;/td&gt;
30:     &lt;td class=&quot;id&quot;&gt;&lt; %= link_to issue.id, :controller =&gt; 'issues', :action =&gt; 'show', :id =&gt; issue %&gt;&lt;/td&gt;
31:         &lt; % query.columns.each do |column| %&gt;&lt; %= content_tag 'td', column_content(column, issue), :class =&gt; column.css_classes %&gt;&lt; % end %&gt;</code></pre><p><p><p><p><p>
<p>Googling the error returned me to a <a href="http://www.redmine.org/issues/5907" target="_blank">bug report</a> from version 1.0, which presented me with a simple solution, i just had to run a simple query on the database:</p>
<pre class="crayon-plain-tag"><code>update issues set parent_id = NULL, root_id = id, lft = 1, rgt = 2;</code></pre><p></tr>
<p></rails::gemdependency:0x7f9e87ea7a18></gemname></correct></p>

				<!-- Social Sharing Toolkit v2.0.4 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
				<div class="mr_social_sharing_wrapper"><span class="mr_social_sharing_top"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fdellaert.org%2F2012%2F03%2F06%2Fupgrading-redmine-from-0-9-x-to-1-3-x%2F&amp;layout=standard&amp;show_faces=false&amp;width=51px&amp;height=24px" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:51px; height:24px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing_top"><a href="http://twitter.com/share?url=http%3A%2F%2Fdellaert.org%2F2012%2F03%2F06%2Fupgrading-redmine-from-0-9-x-to-1-3-x%2F&amp;text=Upgrading+Redmine+from+0.9.x+to+1.3.x" target="_blank" class="mr_social_sharing_popup_link"><img src="http://dellaert.org/wp-content/plugins/social-sharing-toolkit/images/buttons/twitter.png" alt="Share on Twitter" title="Share on Twitter"/></a></span><span class="mr_social_sharing_top"><g:plusone size="medium" count="false" href="http://dellaert.org/2012/03/06/upgrading-redmine-from-0-9-x-to-1-3-x/"></g:plusone></span><span class="mr_social_sharing_top"><script type="IN/Share" data-url="http://dellaert.org/2012/03/06/upgrading-redmine-from-0-9-x-to-1-3-x/"></script></span></div>]]></content:encoded>
			<wfw:commentRss>http://dellaert.org/2012/03/06/upgrading-redmine-from-0-9-x-to-1-3-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.10 boot problem</title>
		<link>http://dellaert.org/2011/12/18/ubuntu-11-10-boot-problem/</link>
		<comments>http://dellaert.org/2011/12/18/ubuntu-11-10-boot-problem/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 16:43:14 +0000</pubDate>
		<dc:creator>straks</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[boot problem]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dellaert.org/?p=239</guid>
		<description><![CDATA[Today i had a network issue on my system, so i tried rebooting my Ubuntu 11.10 server which acts like a router, firewall, DHCP and DNS server for my network. Turns out there was a rather big problem with Ubuntu 11.10 if you upgraded from a previous version. It seems that in Ubuntu 11.10 the [...]]]></description>
			<content:encoded><![CDATA[<p>Today i had a network issue on my system, so i tried rebooting my Ubuntu 11.10 server which acts like a router, firewall, DHCP and DNS server for my network. Turns out there was a rather big problem with Ubuntu 11.10 if you upgraded from a previous version.</p>
<p>It seems that in Ubuntu 11.10 the directory containing running processes information and lock files has changed, or well, it has for certain programs. This results in a system where certain daemons/programs expect to find sockets in /var/run, while they are present in /run, or vice versa.</p>
<p>This might result in a boot problem looking like this:</p>
<p><a href="http://dellaert.org/wp-content/uploads/2011/12/Ubuntu_11.10_boot-issue.png"><img class="alignnone size-medium wp-image-240" title="Ubuntu_11.10_boot-issue" src="http://dellaert.org/wp-content/uploads/2011/12/Ubuntu_11.10_boot-issue-300x73.png" alt="" width="300" height="73" /></a></p>
<p>The first lines are not so important, what is important are the last two. It says:</p>
<pre class="crayon-plain-tag"><code>unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket : connection refused
Waiting for network configuration...</code></pre>
<p>After that last one, you might get that it waits for another 60 seconds for network configuration, but it will get stuck in boot after that.</p>
<p>Luckily i had my 3G enabled phone close, so i could do some searching, which gave me a link to a <a href="https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/811441" target="_blank">bug report</a> and a forum post with a <a href="http://ubuntuforums.org/showpost.php?p=11340883&amp;postcount=3" target="_blank">fix</a>. In short, few simple steps can help you out here:</p>
<ol>
<li>reboot into recovery mode</li>
<li>start a root shell</li>
<li>mount the filesystem as read/write:<br />
<pre class="crayon-plain-tag"><code>mount -o remount,rw /</code></pre></li>
<li>move everything from /var/run into /run:<br />
<pre class="crayon-plain-tag"><code>mv /var/run/* /run/</code></pre></li>
<li>move /var/lock into /run:<br />
<pre class="crayon-plain-tag"><code>mv /var/lock /run/</code></pre></li>
<li>create symlinks from /var/run to /run and /var/run/lock to /var/lock:<br />
<pre class="crayon-plain-tag"><code>ln -s /run /var/run
ln -s /run/lock /var/lock</code></pre></li>
<li>reboot</li>
</ol>
<p>Worked like charm here. Hope this helps.</p>

				<!-- Social Sharing Toolkit v2.0.4 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
				<div class="mr_social_sharing_wrapper"><span class="mr_social_sharing_top"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F18%2Fubuntu-11-10-boot-problem%2F&amp;layout=standard&amp;show_faces=false&amp;width=51px&amp;height=24px" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:51px; height:24px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing_top"><a href="http://twitter.com/share?url=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F18%2Fubuntu-11-10-boot-problem%2F&amp;text=Ubuntu+11.10+boot+problem" target="_blank" class="mr_social_sharing_popup_link"><img src="http://dellaert.org/wp-content/plugins/social-sharing-toolkit/images/buttons/twitter.png" alt="Share on Twitter" title="Share on Twitter"/></a></span><span class="mr_social_sharing_top"><g:plusone size="medium" count="false" href="http://dellaert.org/2011/12/18/ubuntu-11-10-boot-problem/"></g:plusone></span><span class="mr_social_sharing_top"><script type="IN/Share" data-url="http://dellaert.org/2011/12/18/ubuntu-11-10-boot-problem/"></script></span></div>]]></content:encoded>
			<wfw:commentRss>http://dellaert.org/2011/12/18/ubuntu-11-10-boot-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving my VMware vCenter 4.1 and VMware Update Manager database</title>
		<link>http://dellaert.org/2011/12/12/moving-my-vmware-vcenter-4-1-and-vmware-update-manager-database/</link>
		<comments>http://dellaert.org/2011/12/12/moving-my-vmware-vcenter-4-1-and-vmware-update-manager-database/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 19:58:35 +0000</pubDate>
		<dc:creator>straks</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://dellaert.org/?p=228</guid>
		<description><![CDATA[I have already explained that i have a local vSphere setup running as a test environment. Of course i use vCenter for that, not much use to have a cluster running and not using vCenter ;). As this setup is a small environment, i chose to use the MSSQL Server 2005 Express which is bundled [...]]]></description>
			<content:encoded><![CDATA[<p>I have already explained that i have a local vSphere setup running as a test environment. Of course i use vCenter for that, not much use to have a cluster running and not using vCenter ;).</p>
<p>As this setup is a small environment, i chose to use the MSSQL Server 2005 Express which is bundled with the vCenter 4.1 U1 installer. But with the release of vSphere 5, vCenter no longer supports MSSQL Server 2005 Express.</p>
<p>The solution? Install MSSQL Server 2008 R2 which i have a license for because of my Microsoft Action Pack Subscription and move the database of vCenter 4.1 and Update Manager to this new DB server.</p>
<p>So in one of my Windows Server 2008 Enterprise VM&#8217;s i installed the SQL server and set it up to contain the databases for VMware Update Manager and VMware vCenter.</p>
<h3>First up: Update manager!</h3>
<p>Moving the database to the new server was rather easy. Steps i took:</p>
<ol>
<li>Allowed mixed authentication</li>
<li>created a user with sysadmin rights, just for the ease of it</li>
<li>Made a database called VIM_UMDB</li>
<li>Set the compatibility to 90 (MSSQL 2005)</li>
<li>Stopped Update Manager</li>
<li>Took a backup of it&#8217;s database</li>
<li>Restored it to the VIM_UMDB on the new server (overwrite everything)</li>
</ol>
<p>After this step something went wrong, it took a while before i figured out the problem was with the Database connector. It seems so logical now, but it took me a while to figure it out. So a little guide after you moved the DB:</p>
<ol>
<li>Install the MSSQL 2008 R2 Native Client, this also installs a 32bit driver. You can download it from <a href="http://www.microsoft.com/download/en/details.aspx?id=16978" target="_blank">here</a> (search for Native Client)</li>
<li>Open odbcad32.exe (C:\Windows\SysWOW64\odbcad32.exe) , <span style="text-decoration: underline;">not</span> the regular ODBC configruation. This is where i went wrong, you need to open the 32 bit version to add a 32 bit connector.</li>
<li>Add a new connector with the SQL Server Native Client 10.0 driver and name it something you can remember</li>
</ol>
<p>Now the only thing we need is to change the configuration of the Update Manager so it knows to use the new database connector.</p>
<ol>
<li>Just open C:\Program Files (x86)\VMware\Infrastructure\Update Manager\vci-integrity.xml</li>
<li>Find the &lt;database&gt; tag</li>
<li>In the &lt;dbtype&gt; tag, fill in: SQL Server Native Client 10.0</li>
<li>In the &lt;dsn&gt; tag, fill in the name of the DB connector you created.</li>
<li>Save the file</li>
<li>Restart the Update Manager</li>
</ol>
<p>To be sure, connect to your vCenter server with the client, and see if you get an error about the Update Manager. If not, check if you can scan a host or something. If everything works, great, you successfully moved your Update Manager database!</p>
<h3>Next: vCenter Database</h3>
<p>This should be a bit easier cause VMware has a <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=7960893" target="_blank">Knowledge Base article</a> about it (and <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1028601" target="_blank">another one</a>). And my experience with the Update Manager database did help. Basically the first 10 steps (1-7 and 1-3) are the same, except you just create a normal DSN (so don&#8217;t use the 32 bit odbcad32.exe). Next steps:</p>
<ol>
<li>Uninstall vCenter&#8230; Yes, indeed, uninstall it.</li>
<li>Reboot your vCenter server</li>
<li>Reinstall vCenter</li>
<li>During the install select the newly created database connection.</li>
<li>Don&#8217;t forget to recreate the statistics rollup job in SQL server (<a href="http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&amp;externalId=1004382">KB Article</a>)</li>
</ol>
<div>After you reinstalled vCenter, you will have to reconnect the Update Manager to it. You can do this by using the VMwareUpdateManagerUtility in the C:\Program Files (x86)\VMware\Infrastructure\Update Manager folder.</div>

				<!-- Social Sharing Toolkit v2.0.4 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
				<div class="mr_social_sharing_wrapper"><span class="mr_social_sharing_top"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F12%2Fmoving-my-vmware-vcenter-4-1-and-vmware-update-manager-database%2F&amp;layout=standard&amp;show_faces=false&amp;width=51px&amp;height=24px" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:51px; height:24px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing_top"><a href="http://twitter.com/share?url=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F12%2Fmoving-my-vmware-vcenter-4-1-and-vmware-update-manager-database%2F&amp;text=Moving+my+VMware+vCenter+4.1+and+VMware+Update+Manager+database" target="_blank" class="mr_social_sharing_popup_link"><img src="http://dellaert.org/wp-content/plugins/social-sharing-toolkit/images/buttons/twitter.png" alt="Share on Twitter" title="Share on Twitter"/></a></span><span class="mr_social_sharing_top"><g:plusone size="medium" count="false" href="http://dellaert.org/2011/12/12/moving-my-vmware-vcenter-4-1-and-vmware-update-manager-database/"></g:plusone></span><span class="mr_social_sharing_top"><script type="IN/Share" data-url="http://dellaert.org/2011/12/12/moving-my-vmware-vcenter-4-1-and-vmware-update-manager-database/"></script></span></div>]]></content:encoded>
			<wfw:commentRss>http://dellaert.org/2011/12/12/moving-my-vmware-vcenter-4-1-and-vmware-update-manager-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3.2 DateTime diff() issue</title>
		<link>http://dellaert.org/2011/12/04/php-5-3-2-datetime-diff-issue/</link>
		<comments>http://dellaert.org/2011/12/04/php-5-3-2-datetime-diff-issue/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 12:52:39 +0000</pubDate>
		<dc:creator>straks</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://dellaert.org/?p=85</guid>
		<description><![CDATA[It seems that PHP 5.3.2 ( 5.3.2-1ubuntu4.10 ) has a small issue when using the DateTime diff() method. Got this code:&#60; ?php $mode = 'D'; $back = 1; $start = new \DateTime(); $start-&#62;setTime(0, 0); $start-&#62;sub(new \DateInterval('P'.$back.$mode)); $end = new \DateTime(); $end-&#62;setTime(0, 0); if( $back &#62; 0 ) { $end-&#62;sub(new \DateInterval('P'.($back-1).$mode)); } else { $end-&#62;add(new \DateInterval('P1'.$mode)); } echo [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that PHP 5.3.2 ( 5.3.2-1ubuntu4.10 ) has a small issue when using the <a href="http://www.php.net/manual/en/datetime.diff.php" target="_blank">DateTime diff() method</a>.</p>
<p>Got this code:</p><pre class="crayon-plain-tag"><code>&lt; ?php
$mode = 'D';
$back = 1;
$start = new \DateTime();
$start-&gt;setTime(0, 0);
$start-&gt;sub(new \DateInterval('P'.$back.$mode));
$end = new \DateTime();
$end-&gt;setTime(0, 0);
if( $back &gt; 0 ) {
	$end-&gt;sub(new \DateInterval('P'.($back-1).$mode));
} else {
	$end-&gt;add(new \DateInterval('P1'.$mode));
}

echo $start-&gt;format('Y-m-d H:i:s') . &quot;\n&quot;;
echo $end-&gt;format('Y-m-d H:i:s') . &quot;\n&quot;;
$dt = $start-&gt;diff($end);
echo $start-&gt;format('Y-m-d H:i:s') . &quot;\n&quot;;
echo $end-&gt;format('Y-m-d H:i:s') . &quot;\n&quot;;
$differenceDays = $dt-&gt;format('%a');
echo $differenceDays.&quot;\n&quot;;
?&gt;</code></pre>
<p>This code results in:</p><pre class="crayon-plain-tag"><code>2011-12-03 00:00:00
2011-12-04 00:00:00
2011-12-02 00:00:00
2011-12-04 00:00:00
2</code></pre><p>It seems the diff statement changes the starting date to a date before. This is kind of an issue, i need that difference in a project between days, weeks, months and even years. And the issue get&#8217;s worse if you use weeks (the difference becomes 14 days instead of 7) in the interval or months (61 instead of 30 or 31). So i decided to use a quickfix to calculate the difference, cause this was not working&#8230;</p>
<p>The workaround needed to change depending on the mode variable (day, week, month or year). For day and week it could just be 1 and 7 days, but the amount of days in a month and years changes per month and per year (leap years). So i came up with:</p>
<pre class="crayon-plain-tag"><code>&lt; ?php
switch($mode) {
	case &quot;day&quot;:
		$differenceDays = 1;
		break;
	case &quot;week&quot;:
		$differenceDays = 7;
		break;
	case &quot;month&quot;:
		$differenceDays = date('t',$start-&gt;getTimestamp());
		break;
	case &quot;year&quot;:
		$differenceDays = 365;
		if( date('L',mktime(0,0,0,1,1,$start-&gt;format('Y'))) == 1 ) {
			$differenceDays++;
		}
	break;
}
?&gt;</code></pre>
<p>I decided to use the mktime function, because the getTimestamp() gave some issues concerning timezones (i think ;))</p>
<h3> Update</h3>
<p><a href="http://www.linkedin.com/in/dries" target="_blank">Dries Verachtert</a> pointed me to a <a href="http://www.php.net/manual/en/datetime.sub.php#101175" target="_blank">comment</a> on the page of the <a href="http://www.php.net/manual/en/datetime.sub.php" target="_blank">DateTime sub method</a>. The short of it:</p>
<blockquote><p>If you use diff() after sub(), the effects of the sub() will be repeated on the date object.<br />
It doesn&#8217;t matter if the object is the one diffed or doing the diffing (i.e. which object you call diff() from).<br />
Note that using add() instead of sub() does NOT have the same effect.<br />
This is particularly undesirable &#8212; in this example you make a datetime, use sub() to make it a relative time in the past, and then date-&gt;diff() to confirm the difference. But the diff() inadvertendly makes the difference 2x.</p></blockquote>
<p>Strange issue, but i can tell you it&#8217;s fixed in 5.3.3, as i have running that on an internal test server, and the code does a perfect job on that.</p>

				<!-- Social Sharing Toolkit v2.0.4 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
				<div class="mr_social_sharing_wrapper"><span class="mr_social_sharing_top"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F04%2Fphp-5-3-2-datetime-diff-issue%2F&amp;layout=standard&amp;show_faces=false&amp;width=51px&amp;height=24px" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:51px; height:24px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing_top"><a href="http://twitter.com/share?url=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F04%2Fphp-5-3-2-datetime-diff-issue%2F&amp;text=PHP+5.3.2+DateTime+diff%28%29+issue" target="_blank" class="mr_social_sharing_popup_link"><img src="http://dellaert.org/wp-content/plugins/social-sharing-toolkit/images/buttons/twitter.png" alt="Share on Twitter" title="Share on Twitter"/></a></span><span class="mr_social_sharing_top"><g:plusone size="medium" count="false" href="http://dellaert.org/2011/12/04/php-5-3-2-datetime-diff-issue/"></g:plusone></span><span class="mr_social_sharing_top"><script type="IN/Share" data-url="http://dellaert.org/2011/12/04/php-5-3-2-datetime-diff-issue/"></script></span></div>]]></content:encoded>
			<wfw:commentRss>http://dellaert.org/2011/12/04/php-5-3-2-datetime-diff-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a new VPS</title>
		<link>http://dellaert.org/2011/12/03/setting-up-a-new-vps/</link>
		<comments>http://dellaert.org/2011/12/03/setting-up-a-new-vps/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 14:43:12 +0000</pubDate>
		<dc:creator>straks</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://dellaert.org/?p=38</guid>
		<description><![CDATA[Today i decided to get a new VPS from Shift to the cloud, a new project from Stone Internet Services (@stoneis). Stone IS has been a choice for webhosting and domain registration for me and my clients for years, and i have always been happy with their service. In the past i have always counted on ULYSSIS for my [...]]]></description>
			<content:encoded><![CDATA[<p>Today i decided to get a new VPS from <a title="shift to the cloud" href="http://www.shifttothecloud.com/en" target="_blank">Shift to the cloud</a>, a new project from <a title="Stone Internet Services" href="http://www.stone-is.com" target="_blank">Stone Internet Services</a> (<a href="http://twitter.com/stoneis">@stoneis</a>). Stone IS has been a choice for webhosting and domain registration for me and my clients for years, and i have always been happy with their service.</p>
<p>In the past i have always counted on <a title="ULYSSIS" href="http://ulyssis.org" target="_blank">ULYSSIS</a> for my personal hosting, as i have been vice-president of this organisation and have a free account because of that. But lately, i realized that, although their service is incredible for an organization of volunteers, it is not as open and free as having an own server at your disposal.</p>
<p>Ordering the server was rather easy, i only had an issue with the payment system, but i hope it was just a fluke and not something others experience. At least the service desk helped me out pretty quick. I opened an issue last night and it was fixed by the time i woke up this morning, on a Saturday.</p>
<p>After i got the base VM (Ubuntu 10.04 LTS) running i started to configure it by installing some base packages like apache, openssl, php5, suphp, &#8230; After a while i noticed it didn&#8217;t have the promised IPv6 address, so i opened another support ticket, and it took them about 15 minutes to fix it. If that&#8217;s an indication of response time for the Best Effort SLA, i am impressed.</p>
<p>When the IPv6 address was enabled, i did get into trouble with Apache. Everytime i wanted to start it, it crashed with the following error:</p><pre class="crayon-plain-tag"><code>[Sat Dec 03 12:48:52 2011] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)</code></pre><p>
Whenever i disabled SSL, it worked fine. After a few google searches, i came to the conclusion that the automatically generated SSL certificates became invalid with the change of network interfaces/addresses. I fixed that quickly by creating a new certificate, and my own Certificate Authority . If you need some info on how to do that, you can find a <a title="Your own CA and Self-signed certificate" href="http://www.tc.umn.edu/~brams006/selfsign.html" target="_blank">good tutorial on the website of Paul Bramscher</a>.</p>
<p>And now that this blog is moved to the server, we&#8217;ll see how it goes. Next step will be to move my <a title="Symfony2" href="http://symfony.com/" target="_blank">Symfony2</a> project from my development environment (VM on a personal vSphere setup on two local servers) to this server, so i can more easily access it from anywhere.</p>
<p>Other plans include setting up a monitoring system (Nagios) to monitor my internal network and some servers and environments of my smaller clients (who do not have the resources to implement it locally). This kind of monitoring system is already running on my local vSphere farm, but that means it uses my personal internet connection, which is just a commercial connection (once or twice a month it goes down in the middle of the night for 10-15 minutes).</p>

				<!-- Social Sharing Toolkit v2.0.4 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
				<div class="mr_social_sharing_wrapper"><span class="mr_social_sharing_top"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F03%2Fsetting-up-a-new-vps%2F&amp;layout=standard&amp;show_faces=false&amp;width=51px&amp;height=24px" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:51px; height:24px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing_top"><a href="http://twitter.com/share?url=http%3A%2F%2Fdellaert.org%2F2011%2F12%2F03%2Fsetting-up-a-new-vps%2F&amp;text=Setting+up+a+new+VPS" target="_blank" class="mr_social_sharing_popup_link"><img src="http://dellaert.org/wp-content/plugins/social-sharing-toolkit/images/buttons/twitter.png" alt="Share on Twitter" title="Share on Twitter"/></a></span><span class="mr_social_sharing_top"><g:plusone size="medium" count="false" href="http://dellaert.org/2011/12/03/setting-up-a-new-vps/"></g:plusone></span><span class="mr_social_sharing_top"><script type="IN/Share" data-url="http://dellaert.org/2011/12/03/setting-up-a-new-vps/"></script></span></div>]]></content:encoded>
			<wfw:commentRss>http://dellaert.org/2011/12/03/setting-up-a-new-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

