<?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, Apache, PHP, MySQL Musings</description>
	<lastBuildDate>Wed, 01 Feb 2012 23:32:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>rdiff-backup User and Group Mapping</title>
		<link>http://dotmanila.com/blog/2011/06/rdiff-backup-user-and-group-mapping/</link>
		<comments>http://dotmanila.com/blog/2011/06/rdiff-backup-user-and-group-mapping/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 10:56:20 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[Backups]]></category>
		<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[rdiff-backup]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=182</guid>
		<description><![CDATA[rdiff-backup is a great tool for mirroring or backing up files locally and between remote servers. It is based on rsync and works on top of SSH. To this note, I recently encountered one caveat when using the &#8211;user-mapping-file and &#8211;group-mapping-file options. Because these options intends to map a source user/group to a destination user/group [...]]]></description>
			<content:encoded><![CDATA[<p>rdiff-backup is a great tool for mirroring or backing up files locally and between remote servers. It is based on rsync and works on top of SSH. To this note, I recently encountered one caveat when using the &#8211;user-mapping-file and &#8211;group-mapping-file options. Because these options intends to map a source user/group to a destination user/group it requires rdiff-backup to run on escalated privileges much as &#8220;chown&#8221; command would do.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2011/06/rdiff-backup-user-and-group-mapping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AirPort &#8211; Self Assigned IP Address</title>
		<link>http://dotmanila.com/blog/2010/11/airport-self-assigned-ip-address/</link>
		<comments>http://dotmanila.com/blog/2010/11/airport-self-assigned-ip-address/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 16:05:01 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[wireless security]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=158</guid>
		<description><![CDATA[If you&#8217;re stuck with this problem and you&#8217;ve tried almost every other user&#8217;s attempt to solve this and plea for a solution from Apple read on. Try this. If you have access to your wireless AP or router and is able to change the Wireless Security Mode, try switching to another mode i.e. from WEP [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re stuck with this problem and you&#8217;ve tried almost every other user&#8217;s attempt to solve this and plea for a solution from Apple read on.</p>
<p>Try this. If you have access to your wireless AP or router and is able to change the Wireless Security Mode, try switching to another mode i.e. from WEP to WPA or vice versa. If other devices relies on the currently set mode, switch once, let AirPort authenticate and grab an IP, turn AirPort off, switch back your router security mode and then turn on AirPort again.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2010/11/airport-self-assigned-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 &#8220;Got a packet bigger then &#8216;max_allowed_packet&#8217; bytes&#8221; error. After setting this variable to a reasonable value the restore went smoothly.</p>
]]></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 &#8216;ON UPDATE CURENT_TIMESTAMP&#8217;. 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 &#8216;ON UPDATE CURENT_TIMESTAMP&#8217;. Examine the simple structure below:</p>
<pre class="brush: sql;ruler: true;">
CREATE TABLE `stories` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 255 ) NOT NULL ,
`text` TEXT NOT NULL ,
`creationdate` DATETIME NOT NULL ,
`lastupdate` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE = MYISAM</pre>
<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&#8217;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>
]]></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&#8217;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>
]]></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>

