<?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>MrMason's Blog</title>
	<atom:link href="http://blog.mrmason.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mrmason.net</link>
	<description>Ruby on Rails, Linux, Mac OSX, and other everyday tinkering.</description>
	<lastBuildDate>Mon, 11 Apr 2011 15:44:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>RVSiteBuilder / cPanel / PEAR / Pecl</title>
		<link>http://blog.mrmason.net/2011/04/11/rvsitebuilder-cpanel-pear-pecl/</link>
		<comments>http://blog.mrmason.net/2011/04/11/rvsitebuilder-cpanel-pear-pecl/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 15:44:30 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=51</guid>
		<description><![CDATA[Our customers recently started complaining that RV Site Builder stopped working. So I did the normal fix of running the following command as root over SSH: # perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi After a while the installed quit with the error: Cannot execute &#8230; <a href="http://blog.mrmason.net/2011/04/11/rvsitebuilder-cpanel-pear-pecl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Our customers recently started complaining that RV Site Builder stopped working. So I did the normal fix of running the following command as root over SSH:</p>
<div class="codesnip-container" ># perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi</div>
<p>After a while the installed quit with the error:</p>
<p><span style="color: #ff0000;">Cannot execute pear on path /usr/local/bin/pear</span></p>
<p>I thought this was a bit odd, as we have always compiled our PHP with PEAR and PECL support, but after searching for the Pecl and Pear binaries the script was correct &#8211; they didn&#8217;t exist.</p>
<p>I eventually found copies of the binaries in</p>
<div class="codesnip-container" >/usr/local/cpanel/3rdparty/bin/</div>
<p>I copied these across to /usr/local/bin and re-ran the script &#8211; which worked correctly.</p>
<p>After a bit more research though, it turns out that PEAR is now included in the default PHP installation, and that by ticking the box inside Easy Apache inside cPanel you are in fact disabling PEAR rather than enabling &#8211; so if you un tick the box and re-run Easy Apache everything should be back to normal.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2011/04/11/rvsitebuilder-cpanel-pear-pecl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WHMCS .uk domains checkout</title>
		<link>http://blog.mrmason.net/2011/04/04/whmcs-uk-domains-checkout/</link>
		<comments>http://blog.mrmason.net/2011/04/04/whmcs-uk-domains-checkout/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 15:28:06 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WHMCS]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=28</guid>
		<description><![CDATA[We are currently in the process of moving our billing software from AWBS to WHMCS. One of the things that was annoying in AWBS was that when buying a UK Domain name (.co.uk etc) a client was given the option to enter &#8230; <a href="http://blog.mrmason.net/2011/04/04/whmcs-uk-domains-checkout/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We are currently in the process of moving our billing software from AWBS to WHMCS.</p>
<p>One of the things that was annoying in AWBS was that when buying a UK Domain name (.co.uk etc) a client was given the option to enter a company number even when signing up as an Individual ( Individual registrations account for about 95%+ of uk domain registrations ). This confused clients, and probably made some people abandon the cart.</p>
<p>I was somewhat frustrated to see that WHMCS doesn&#8217;t seem to have addressed the situation any better, so I thought it was time to take things into my own hands. I&#8217;ve written some jQuery that removes the options for individual users. I&#8217;m sure there is a better way to do this &#8211; but for now this seems to work.</p>
<p>Your template (/templates/orderforms/web20cart/configuredomains.tpl) will have to look like this for this jQuery to work:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="sy0">&lt;</span>div <span class="kw2">class</span><span class="sy0">=</span><span class="st0">&quot;cartbox&quot;</span><span class="sy0">&gt;</span> <span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>eppenabled<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$LANG</span><span class="sy0">.</span>domaineppcode<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span>p<span class="sy0">&gt;&lt;</span>input type<span class="sy0">=</span><span class="st0">&quot;text&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;epp[<span class="es4">{$num}</span>]&quot;</span> size<span class="sy0">=</span><span class="st0">&quot;20&quot;</span> value<span class="sy0">=</span><span class="st0">&quot;{<span class="es4">$domain</span>.eppvalue}&quot;</span> <span class="sy0">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="re0">$LANG</span><span class="sy0">.</span>domaineppcodedesc<span class="br0">&#125;</span><span class="sy0">&lt;/</span>p<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>dnsmanagement<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span>p<span class="sy0">&gt;&lt;</span>input type<span class="sy0">=</span><span class="st0">&quot;checkbox&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;dnsmanagement[<span class="es4">{$num}</span>]&quot;</span><span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>dnsmanagementselected<span class="br0">&#125;</span> checked<span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span> <span class="sy0">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="re0">$LANG</span><span class="sy0">.</span>domaindnsmanagement<span class="br0">&#125;</span> <span class="br0">&#40;</span><span class="br0">&#123;</span><span class="re0">$domain</span><span class="sy0">.</span>dnsmanagementprice<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">&lt;/</span>p<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>emailforwarding<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span>p<span class="sy0">&gt;&lt;</span>input type<span class="sy0">=</span><span class="st0">&quot;checkbox&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;emailforwarding[<span class="es4">{$num}</span>]&quot;</span><span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>emailforwardingselected<span class="br0">&#125;</span> checked<span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span> <span class="sy0">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="re0">$LANG</span><span class="sy0">.</span>domainemailforwarding<span class="br0">&#125;</span> <span class="br0">&#40;</span><span class="br0">&#123;</span><span class="re0">$domain</span><span class="sy0">.</span>emailforwardingprice<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">&lt;/</span>p<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>idprotection<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span>p<span class="sy0">&gt;&lt;</span>input type<span class="sy0">=</span><span class="st0">&quot;checkbox&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;idprotection[<span class="es4">{$num}</span>]&quot;</span><span class="br0">&#123;</span><span class="kw1">if</span> <span class="re0">$domain</span><span class="sy0">.</span>idprotectionselected<span class="br0">&#125;</span> checked<span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span> <span class="sy0">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="re0">$LANG</span><span class="sy0">.</span>domainidprotection<span class="br0">&#125;</span> <span class="br0">&#40;</span><span class="br0">&#123;</span><span class="re0">$domain</span><span class="sy0">.</span>idprotectionprice<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">&lt;/</span>p<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">if</span><span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="kw1">foreach</span> <a href="http://www.php.net/key"><span class="kw3">key</span></a><span class="sy0">=</span>domainfieldname item<span class="sy0">=</span>domainfield from<span class="sy0">=</span><span class="re0">$domain</span><span class="sy0">.</span>fields<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span>p<span class="sy0">&gt;&lt;</span>label<span class="sy0">&gt;</span><span class="br0">&#123;</span><span class="re0">$domainfieldname</span><span class="br0">&#125;</span><span class="sy0">:&lt;/</span>label<span class="sy0">&gt;</span> <span class="br0">&#123;</span><span class="re0">$domainfield</span><span class="br0">&#125;</span><span class="sy0">&lt;/</span>p<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="sy0">/</span><span class="kw1">foreach</span><span class="br0">&#125;</span> <span class="sy0">&lt;/</span>div<span class="sy0">&gt;</span></div>
</div>
<p>which generates this HTML: </p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;cartbox&quot;</span>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span>Legal Type:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/select.html"><span class="kw2">select</span></a> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;domainfield[0][0]&quot;</span>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a> <span class="kw3">style</span><span class="sy0">=</span><span class="st0">&quot;display: none;&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span>Company ID Number:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;domainfield[0][1]&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="kw3">disabled</span><span class="sy0">=</span><span class="st0">&quot;&quot;</span>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span>Registrant Name:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;domainfield[0][2]&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span>&gt;</span><br />
&nbsp; &nbsp; *<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span>WHOIS Opt-out:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;checkbox&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;domainfield[0][3]&quot;</span>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span></div>
</div>
<p>And here is the jQuery. I included this at the bottom of the site, just before the close body tag.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="co1">// Disables Company Numbers for UK Domains on change</span><br />
$<span class="br0">&#40;</span><span class="st0">&#8216;select[name^=&quot;domainfield&quot;]&#8216;</span><span class="br0">&#41;</span>.<span class="me1">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;select[name$=&quot;[0]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">change</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;Individual&quot;</span> <span class="sy0">||</span> $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;Sole Trader&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">removeAttr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">// Disables Company Numbers for UK Domains on page load</span><br />
$<span class="br0">&#40;</span><span class="st0">&#8216;select[name$=&quot;[0]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;Individual&quot;</span> <span class="sy0">||</span> $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;Sole Trader&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">removeAttr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;input[name$=&quot;[1]&quot;]&#8217;</span><span class="br0">&#41;</span>.<span class="me1">parent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2011/04/04/whmcs-uk-domains-checkout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix BIND Dynamic Update DoS Vulnerability , Cpanel WHM and CentOS / Redhat</title>
		<link>http://blog.mrmason.net/2009/07/29/fix-dynamic-update-dos-vulnerability-cpanel-whm-and-centos-redhat/</link>
		<comments>http://blog.mrmason.net/2009/07/29/fix-dynamic-update-dos-vulnerability-cpanel-whm-and-centos-redhat/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 18:59:06 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[CVE-2009-0696]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[VU#725188]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=22</guid>
		<description><![CDATA[Please see https://www.isc.org/node/474 for details! CVE: CVE-2009-0696 CERT: VU#725188 Before you start! Redhat users will find that bind is already updated via running up2date These versions are big fixed &#8211; see http://rhn.redhat.com/errata/RHSA-2009-1180.html : bind-utils-9.2.4-30.el4_8.4 bind-libs-9.2.4-30.el4_8.4 bind-devel-9.2.4-30.el4_8.4 ypbind-1.17.2-13 bind-9.2.4-30.el4_8.4 # rpm &#8230; <a href="http://blog.mrmason.net/2009/07/29/fix-dynamic-update-dos-vulnerability-cpanel-whm-and-centos-redhat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Please see https://www.isc.org/node/474 for details!</p>
<table border="0">
<tbody>
<tr>
<td class="field field-type-text field-field-cve" valign="top">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">CVE:</div>
</div>
</div>
</td>
<td width="15"></td>
<td><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0696" target="_blank">CVE-2009-0696</a></td>
<td></td>
</tr>
<tr>
<td class="field field-type-text field-field-cert" valign="top">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">CERT:</div>
</div>
</div>
</td>
<td width="15"></td>
<td><a href="http://www.kb.cert.org/vuls/id/725188" target="_blank">VU#725188</a></td>
</tr>
</tbody>
</table>
<p><strong>Before you start!</strong></p>
<p>Redhat users will find that bind is already updated via running up2date</p>
<p>These versions are big fixed &#8211; see http://rhn.redhat.com/errata/RHSA-2009-1180.html :</p>
<p>bind-utils-9.2.4-30.el4_8.4<br />
bind-libs-9.2.4-30.el4_8.4<br />
bind-devel-9.2.4-30.el4_8.4<br />
ypbind-1.17.2-13<br />
bind-9.2.4-30.el4_8.4</p>
<blockquote><p># rpm -qa | grep &#8216;bind&#8217;</p></blockquote>
<p>will show you what versions you are running.</p>
<p>If you are running any other package management then running apt-get update or yum update should sort you out as these fixes have been push. Always make sure you have a backup of your named working directory though!</p>
<p><strong>Step 1: Find out what version of bind you are running</strong></p>
<blockquote><p># named -v</p></blockquote>
<p>If you are running anything that isn&#8217;t one of these versions : <strong>9.4.3-P3</strong>, <strong>9.5.1-P3</strong> or <strong>9.6.1-P1</strong> then you need to upgrade.  I found all my cpanel/WHM boxes were running <strong>BIND 9.2.4</strong></p>
<p><strong>Step 2: Make a backup of your working directories</strong></p>
<blockquote><p># mkdir /backup/bind/</p>
<p># cd /backup/bind</p>
<p># cp -R /var/named zones</p>
<p># cp /etc/named.conf named.conf</p></blockquote>
<p>If all goes to plan then you won&#8217;t need this backup &#8211; but you can never be too careful!</p>
<p><strong>Step3 : Download a new version of bind</strong></p>
<blockquote><p># mkdir /backup/bind/bind-9.4.3-P3</p>
<p># cd /backup/bind/bind-9.4.3-P3</p>
<p># wget http://ftp.isc.org/isc/bind9/9.4.3-P3/bind-9.4.3-P3.tar.gz</p>
<p># tar zxvf bind-9.4.3-P3.tar.gz</p></blockquote>
<p><strong>Step 4: Compile and install new Bind</strong></p>
<blockquote><p># cd bind-9.4.3-P3</p>
<p># ./configure</p>
<p># make</p>
<p># make install</p></blockquote>
<p><strong>Step5: Make sure your version is now updated</strong></p>
<blockquote><p># named -v</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2009/07/29/fix-dynamic-update-dos-vulnerability-cpanel-whm-and-centos-redhat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing default file permissions for SFTP</title>
		<link>http://blog.mrmason.net/2009/05/27/changing-default-file-permissions-for-sftp/</link>
		<comments>http://blog.mrmason.net/2009/05/27/changing-default-file-permissions-for-sftp/#comments</comments>
		<pubDate>Wed, 27 May 2009 10:23:28 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[umask]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=19</guid>
		<description><![CDATA[We primarily use SFTP for file transfers, and we encourage our customers to do the same. One problem we&#8217;ve been having is that the default file permissions when files are uploaded in SFTP don&#8217;t match the umask set for that &#8230; <a href="http://blog.mrmason.net/2009/05/27/changing-default-file-permissions-for-sftp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We primarily use SFTP for file transfers, and we encourage our customers to do the same.</p>
<p>One problem we&#8217;ve been having is that the default file permissions when files are uploaded in SFTP don&#8217;t match the umask set for that user, or the umask set on the server. This causes many php scripts to Internal Server Error. Files uploaded via normal FTP are fine, because the FTP service sets the permissions on the files with a umask configuration in the config file.</p>
<p>My basic solution to this, is to create a script that sits between SSH and SFTP and changes the umask as the user logs in:</p>
<blockquote><p><strong>&gt; nano /opt/sftp-server.sh</strong></p>
<p>#!/bin/bash<br />
umask 022<br />
/usr/libexec/openssh/sftp-server</p></blockquote>
<p>Then edit the ssh_d config file (<strong>/etc/ssh/sshd_config</strong>) and edit the sftp SubSystem line to point to your script:</p>
<blockquote><p>Subsystem       sftp    /opt/sftp-server.sh</p></blockquote>
<p>Make sure you&#8217;ve set the permissions correctly on your new script:</p>
<blockquote><p><strong>&gt; chmod 755 /opt/sftp-server.sh</strong></p></blockquote>
<p>Now files uploaded via SFTP should have the permissions 755!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2009/05/27/changing-default-file-permissions-for-sftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the Ruby mysql-2.7 gem on OS X 10.4/ 10.5</title>
		<link>http://blog.mrmason.net/2009/05/26/installing-the-ruby-mysql-27-gem-on-os-x-104-105/</link>
		<comments>http://blog.mrmason.net/2009/05/26/installing-the-ruby-mysql-27-gem-on-os-x-104-105/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:31:36 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=16</guid>
		<description><![CDATA[Today I was updating a rails application, and editing some databases to convert them to mysql. After changing my rails config file I started getting this error : &#62; db:test:prepare (in /Users/tom/workspace/solitaire) !!! The bundled mysql.rb driver has been removed &#8230; <a href="http://blog.mrmason.net/2009/05/26/installing-the-ruby-mysql-27-gem-on-os-x-104-105/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I was updating a rails application, and editing some databases to convert them to mysql.</p>
<p>After changing my rails config file I started getting this error :</p>
<blockquote><p>&gt; db:test:prepare<br />
(in /Users/tom/workspace/solitaire)<br />
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.<br />
rake aborted!</p></blockquote>
<p>Strange, everything was working correctly on the other mysql databases and projects on my system. Anyway, I did as instructed :</p>
<blockquote><p>&gt; sudo gem install mysql<br />
Password:<br />
Building native extensions.  This could take a while&#8230;<br />
ERROR:  Error installing mysql:<br />
ERROR: Failed to build gem native extension.</p>
<p>/opt/local/bin/ruby extconf.rb<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lm&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lz&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lsocket&#8230; no<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lnsl&#8230; no<br />
checking for mysql_query() in -lmysqlclient&#8230; no</p>
<p>Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.<br />
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out</p></blockquote>
<p>I did some searching and found a few older articles on the problem :</p>
<p>http://blog.wearesakuzaku.com/installing-the-mysql-ruby-gem-on-os-x/</p>
<p>I tried all of the suggested solutions on this page, and none of them seemed to make any difference, so I did some more searching, and I found that I had a 64bit version of mysql installed, and the rails gem didn&#8217;t seem to like this. So I downloaded and installed the latest 32bit version of mysql :</p>
<p>http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.81-osx10.5-x86.dmg/from/http://mirrors.dedipower.com/www.mysql.com/</p>
<p>and then ran:</p>
<blockquote><p>sudo gem install mysql &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config</p></blockquote>
<p>That seemed to fix the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2009/05/26/installing-the-ruby-mysql-27-gem-on-os-x-104-105/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error in option spec long&#124;! mytop</title>
		<link>http://blog.mrmason.net/2009/05/21/error-in-option-spec-long-mytop/</link>
		<comments>http://blog.mrmason.net/2009/05/21/error-in-option-spec-long-mytop/#comments</comments>
		<pubDate>Thu, 21 May 2009 14:39:57 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mytop]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=13</guid>
		<description><![CDATA[mytop has started to break recently on our cPanel Redhat and CentOS machines. When you run mytop: #mytop Error in option spec: &#34;long&#124;!&#34; The fix for this is to edit the mytop script and comment out the line containing long&#124;! &#8230; <a href="http://blog.mrmason.net/2009/05/21/error-in-option-spec-long-mytop/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>mytop has started to break recently on our cPanel Redhat and CentOS machines.</p>
<p>When you run mytop:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="co0">#mytop</span><br />
Error <span class="kw1">in</span> option spec: <span class="st0">&quot;long|!&quot;</span></div>
</div>
<p>The fix for this is to edit the mytop script and comment out the line containing long|!</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="co0"># nano /usr/bin/mytop</span></div>
</div>
<p>Run a search (control+w) for &#8220;long|!&#8221; and change:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="st0">&quot;long|!&quot;</span> =<span class="sy0">&gt;</span> \<span class="re1">$config</span><span class="br0">&#123;</span>long_nums<span class="br0">&#125;</span>,</div>
</div>
<p>to</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="st0">&quot;long|long_nums|l!&quot;</span> =<span class="sy0">&gt;</span> \<span class="re1">$config</span><span class="br0">&#123;</span>long_nums<span class="br0">&#125;</span>,</div>
</div>
<p>Now run mytop again, and away you go!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2009/05/21/error-in-option-spec-long-mytop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fantastico &#8211; You cannot install more than one script in the root directory of a domain</title>
		<link>http://blog.mrmason.net/2008/11/13/fantastico-you-cannot-install-more-than-one-script-in-the-root-directory-of-a-domain/</link>
		<comments>http://blog.mrmason.net/2008/11/13/fantastico-you-cannot-install-more-than-one-script-in-the-root-directory-of-a-domain/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 12:33:43 +0000</pubDate>
		<dc:creator>MrMason</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Fantastico]]></category>

		<guid isPermaLink="false">http://blog.mrmason.net/?p=7</guid>
		<description><![CDATA[Fantastico allows you to install scripts using cPanel very easily, however it occasionally glitches after you&#8217;ve installed/uninstalled scripts not using Fantastico. This leads to a common error when you try to install another script in the root directory: You cannot &#8230; <a href="http://blog.mrmason.net/2008/11/13/fantastico-you-cannot-install-more-than-one-script-in-the-root-directory-of-a-domain/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Fantastico allows you to install scripts using cPanel very easily, however it occasionally glitches after you&#8217;ve installed/uninstalled scripts not using Fantastico.</p>
<p>This leads to a common error when you try to install another script in the root directory:</p>
<blockquote>
<pre><span class="mediumtext">You cannot install more than one script in the root directory of a domain</span></pre>
</blockquote>
<p>This is usually an easy fix:</p>
<p>Find the folder : <strong>.fantasticodata</strong> in your folder, and edit the file <strong>installed_in_root.php</strong></p>
<p>It should look like this :</p>
<blockquote>
<pre>&lt;?
$installed_in_root["domain1.com"] = 1;$installed_in_root["domain2.com"] = 1;
?&gt;</pre>
</blockquote>
<p>So you just need to delete &#8220;<strong>$installed_in_root["domain1.com"] = 1;</strong>&#8221; for the domain you want to install the new Fantastico script from.</p>
<p>You can then go back into Fantastico and install the new script!</p>
<h2><strong>Warning!</strong></h2>
<p><span style="color: #ff0000;">Fantastico is only designed to run 1 script from any folder, so it&#8217;s not advisable to use this to install multiple scripts in a root directory!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrmason.net/2008/11/13/fantastico-you-cannot-install-more-than-one-script-in-the-root-directory-of-a-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

