<?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>LAMP with ·dotmanila &#187; BSD/Mac OSX</title>
	<atom:link href="http://dotmanila.com/blog/category/bsdmac-osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotmanila.com/blog</link>
	<description>Linux Security, Apache Tuning, MySQL Optimization and PHP Programming</description>
	<lastBuildDate>Sun, 01 Aug 2010 01:54:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>mk-parallel-restore Outputs BLOB Data</title>
		<link>http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/</link>
		<comments>http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 01:54:55 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[maatkit]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=142</guid>
		<description><![CDATA[Recently I was playing around with the Maatkit tools specifically mk-parallel-dump and mk-parallel-restore for refreshing development database copies with production copies. A problem arises when BLOB data is being displayed on the console and transforming my shell prompt into gibberish and missing the results of the restore. Breaking the restore as soon as the BLOB [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was playing around with the Maatkit tools specifically mk-parallel-dump and mk-parallel-restore for refreshing development database copies with production copies. A problem arises when BLOB data is being displayed on the console and transforming my shell prompt into gibberish and missing the results of the restore. Breaking the restore as soon as the BLOB starts output, it was revealed that I was getting the "Got a packet bigger then 'max_allowed_packet' bytes" error. After setting this variable to a reasonable value the restore went smoothly.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;n=mk-parallel-restore+Outputs+BLOB+Data&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;title=mk-parallel-restore+Outputs+BLOB+Data" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;t=mk-parallel-restore+Outputs+BLOB+Data" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=mk-parallel-restore+Outputs+BLOB+Data&amp;body=Link: http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%20I%20was%20playing%20around%20with%20the%20Maatkit%20tools%20specifically%20mk-parallel-dump%20and%20mk-parallel-restore%20for%20refreshing%20development%20database%20copies%20with%20production%20copies.%20A%20problem%20arises%20when%20BLOB%20data%20is%20being%20displayed%20on%20the%20console%20and%20transforming%20my%20shell%20prompt%20into%20gibberish%20and%20missing%20" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;title=mk-parallel-restore+Outputs+BLOB+Data" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;title=mk-parallel-restore+Outputs+BLOB+Data&amp;summary=Recently%20I%20was%20playing%20around%20with%20the%20Maatkit%20tools%20specifically%20mk-parallel-dump%20and%20mk-parallel-restore%20for%20refreshing%20development%20database%20copies%20with%20production%20copies.%20A%20problem%20arises%20when%20BLOB%20data%20is%20being%20displayed%20on%20the%20console%20and%20transforming%20my%20shell%20prompt%20into%20gibberish%20and%20missing%20&amp;source=LAMP with ·dotmanila" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/&amp;title=mk-parallel-restore+Outputs+BLOB+Data" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=mk-parallel-restore+Outputs+BLOB+Data+-+http://b2l.me/ad48t5&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2010/08/mk-parallel-restore-outputs-blob-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Default DATETIME Value &#8211; A Quick Rant</title>
		<link>http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/</link>
		<comments>http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 16:39:22 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[default datetime value]]></category>
		<category><![CDATA[now()]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=106</guid>
		<description><![CDATA[I was reviewing a year old code which I am adding a feature to. It so happened I came to a familiar issue about having two timestamp/datetime columns, one which should have the CURRENT_DATE / NOW() as default value and the other with an 'ON UPDATE CURENT_TIMESTAMP'. Examine the simple structure below: CREATE TABLE `stories` [...]]]></description>
			<content:encoded><![CDATA[<p>I was reviewing a year old code which I am adding a feature to. It so happened I came to a familiar issue about having two timestamp/datetime columns, one which should have the CURRENT_DATE / NOW() as default value and the other with an 'ON UPDATE CURENT_TIMESTAMP'. Examine the simple structure below:<br />
<code><br />
CREATE TABLE `stories` (<br />
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,<br />
`title` VARCHAR( 255 ) NOT NULL ,<br />
`text` TEXT NOT NULL ,<br />
`creationdate` DATETIME NOT NULL ,<br />
`lastupdate` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP<br />
) ENGINE = MYISAM</code></p>
<p>When you want to store stories, you would also want to record when it was originally created as well track the last time it was updated. The problem here is that adding a `DEFAULT NOW()` clause will not work for the `CREATE TABLE` query above as it is not supported. So when your insert a new story you will have to explicitly add a `NOW()` function for the `creationdate` row so it will reflect the current date as creation date. This should've been a simple schema functionality, turns out after more than a year MySQL seems to ignore for some reason.</p>
<p>Go on have yourself a read here http://bugs.mysql.com/bug.php?id=27645</p>
<p>How about you, how many times have you have to work around this from your application code?</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;n=MySQL+Default+DATETIME+Value+-+A+Quick+Rant&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;title=MySQL+Default+DATETIME+Value+-+A+Quick+Rant" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;t=MySQL+Default+DATETIME+Value+-+A+Quick+Rant" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=MySQL+Default+DATETIME+Value+-+A+Quick+Rant&amp;body=Link: http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20was%20reviewing%20a%20year%20old%20code%20which%20I%20am%20adding%20a%20feature%20to.%20It%20so%20happened%20I%20came%20to%20a%20familiar%20issue%20about%20having%20two%20timestamp%2Fdatetime%20columns%2C%20one%20which%20should%20have%20the%20CURRENT_DATE%20%2F%20NOW%28%29%20as%20default%20value%20and%20the%20other%20with%20an%20%27ON%20UPDATE%20CURENT_TIMESTAMP%27.%20Examine%20the%20simple%20structure%20belo" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;title=MySQL+Default+DATETIME+Value+-+A+Quick+Rant" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;title=MySQL+Default+DATETIME+Value+-+A+Quick+Rant&amp;summary=I%20was%20reviewing%20a%20year%20old%20code%20which%20I%20am%20adding%20a%20feature%20to.%20It%20so%20happened%20I%20came%20to%20a%20familiar%20issue%20about%20having%20two%20timestamp%2Fdatetime%20columns%2C%20one%20which%20should%20have%20the%20CURRENT_DATE%20%2F%20NOW%28%29%20as%20default%20value%20and%20the%20other%20with%20an%20%27ON%20UPDATE%20CURENT_TIMESTAMP%27.%20Examine%20the%20simple%20structure%20belo&amp;source=LAMP with ·dotmanila" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/&amp;title=MySQL+Default+DATETIME+Value+-+A+Quick+Rant" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=MySQL+Default+DATETIME+Value+-+A+Quick+Rant+-+http://b2l.me/adk2nj&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2009/11/mysql-default-datetime-value-a-quick-rant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD NFS Server and CentOS NFS Client</title>
		<link>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/</link>
		<comments>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 11:24:42 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[nfs client]]></category>
		<category><![CDATA[nfs server]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=30</guid>
		<description><![CDATA[We were recently migrating a busy site from an aging FreeBSD 5.4 and we cannot disrupt operations while switching platforms from FreeBSD to CentOS. So part of the plan was to share via NFS media files from the old FreeBSD server to the new CentOS.]]></description>
			<content:encoded><![CDATA[<p>We were recently migrating a busy site from an aging FreeBSD 5.4 and we cannot disrupt operations while switching platforms from FreeBSD to CentOS. So part of the plan was to share via NFS media files from the old FreeBSD server to the new CentOS.</p>
<p>Here are the steps that I had to do:</p>
<ol>
<li>Modify <code>/etc/exports</code> file to include directories you want shared. Ours look something like this:
<pre>
/usr/home/web01/images /usr/home/web01/swf    192.168.0.4
</pre>
<p>Notice the two consecutive directories. From the man pages, when mounting two directories from the same mountpoint or filesystem it will go the same line on the exports file or you'll get errors like:</p>
<pre>
Dec  8 10:20:42 web01 mountd[5900]: can't change attributes for /usr/home/web01/swf    192.168.0.4
Dec  8 10:20:42 web01 mountd[5900]: bad exports list line /usr/home/web01/swf    192.168.0.4
</pre>
</li>
<li>
Restart service on the server. First stop, nfsd.</p>
<pre>/etc/rc.d/nfsd stop</pre>
<p>You have to make sure that mountd is stopped as well.</p>
<pre>/etc/rc.d/mountd forcestop</pre>
<p>Then kill rpcbind, I do this by finding the PID for rpcbind and killing it manually.</p>
<pre>ps aux|grep rpcbind</pre>
<p>It should return something like:</p>
<pre>root     6087  0.0  0.1  4776  1248  ??  Ss   10:28AM   0:00.01 rpcbind</pre>
<p>Then do the killing:</p>
<pre>kill -9 6087</pre>
<p>Then we start these processes in reverse order:</p>
<pre>
rpcbind
/etc/rc.d/nfsd start
</pre>
<p>Starting nfsd should start mountd as well.
</li>
<li>Verify your exports are properly listed
<pre>showmount -e</pre>
<p>Should give you something like:</p>
<pre>Exports list on localhost:
/usr/home/web01/images    192.168.0.4
/usr/home/web01/swf    192.168.0.4
</pre>
</li>
<li>Now if you use <code>hosts.allow</code> and <code>hosts.deny</code>, make sure that the NFS client is allowed on the NFS services. We have these on our <code>/etc/hosts.allow</code>
<pre>
nfs : 192.168.0.4 : allow
mountd : 192.168.0.4 : allow
rpcbind : 192.168.0.4 : allow
</pre>
</li>
<li>Now, before mounting on or CentOS client machine we verify first wether the NFS exports are visible:
<pre>rpcinfo -p 192.168.0.3</pre>
<p>You should get something like:</p>
<pre>
   program vers proto   port
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100000    4     7    111  portmapper
    100000    3     7    111  portmapper
    100000    2     7    111  portmapper
    100005    1   udp    861  mountd
    100005    3   udp    861  mountd
    100005    1   tcp    767  mountd
    100005    3   tcp    767  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
</pre>
</li>
<li>So, our exports are visible we can now mount those shares.
<pre>
mount -t nfs 192.168.0.3:/usr/home/web01/images /usr/home/web02/images
mount -t nfs 192.168.0.3:/usr/home/web01/swf /usr/home/web02/swf
</pre>
</li>
<li>That should do it, you should be able to see your mount points and browse files within them.</li>
</ol>
<p>Questions welcome!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;n=FreeBSD+NFS+Server+and+CentOS+NFS+Client&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;title=FreeBSD+NFS+Server+and+CentOS+NFS+Client" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;t=FreeBSD+NFS+Server+and+CentOS+NFS+Client" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=FreeBSD+NFS+Server+and+CentOS+NFS+Client&amp;body=Link: http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A We%20were%20recently%20migrating%20a%20busy%20site%20from%20an%20aging%20FreeBSD%205.4%20and%20we%20cannot%20disrupt%20operations%20while%20switching%20platforms%20from%20FreeBSD%20to%20CentOS.%20So%20part%20of%20the%20plan%20was%20to%20share%20via%20NFS%20media%20files%20from%20the%20old%20FreeBSD%20server%20to%20the%20new%20CentOS." rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;title=FreeBSD+NFS+Server+and+CentOS+NFS+Client" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;title=FreeBSD+NFS+Server+and+CentOS+NFS+Client&amp;summary=We%20were%20recently%20migrating%20a%20busy%20site%20from%20an%20aging%20FreeBSD%205.4%20and%20we%20cannot%20disrupt%20operations%20while%20switching%20platforms%20from%20FreeBSD%20to%20CentOS.%20So%20part%20of%20the%20plan%20was%20to%20share%20via%20NFS%20media%20files%20from%20the%20old%20FreeBSD%20server%20to%20the%20new%20CentOS.&amp;source=LAMP with ·dotmanila" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/&amp;title=FreeBSD+NFS+Server+and+CentOS+NFS+Client" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=FreeBSD+NFS+Server+and+CentOS+NFS+Client+-+http://b2l.me/adkzfx&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
