<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-1079838-3");
pageTracker._trackPageview();
} catch(err) {}</description><title>jben.net</title><generator>Tumblr (3.0; @jbendotnet)</generator><link>http://blog.jben.net/</link><item><title>Apple Mail gets stuck in a 'recovered mail' loop</title><description>&lt;p&gt;I had a call today from a client who was having trouble with Apple Mail. Specifically, there was a 25mb email sent to him by a family member that Mail was continually trying to ‘recover’ and send up to his Google Apps mail account. After a bit of googling, the answer was pretty easy, though asking someone to use the ‘rm’ command who’s never used the Terminal.app was a little concerning :)&lt;/p&gt;

&lt;p&gt;# Close Mail.&lt;br/&gt;
# Open a new terminal window and paste the following:&lt;br/&gt;
# &lt;code&gt;ls -la&lt;/code&gt;&lt;br/&gt;
# Then replace ‘email@domain.com’ with the one that matches the account that’s having issues&lt;br/&gt;
# &lt;code&gt;rm ~/Library/Mail/email@domain.com/.OfflineCache&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That should fix it.&lt;/p&gt;</description><link>http://blog.jben.net/post/336240833</link><guid>http://blog.jben.net/post/336240833</guid><pubDate>Fri, 15 Jan 2010 20:51:36 +0000</pubDate></item><item><title>Setting up Samba share for a vmware OS </title><description>&lt;p&gt;Sometimes it’s useful to be able to browse via the file system via a GUI. So on the advice of &lt;a href="http://twitter.com/andygale"&gt;@AndyGale&lt;/a&gt; I installed Samba on my Ubuntu OS instance and created a share for the entire server. The first part of these instructions were from &lt;a href="http://labs.boulevart.be/index.php/2008/09/22/this-file-server-does-not-allow-guest-access-on-os-x-leopard-the-solution/"&gt;labs.boulevart.be&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;open the samba config &lt;code&gt;sudo nano /etc/samba/smb.conf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;change “security=user” to “security=share”&lt;/li&gt;
&lt;li&gt;comment out “passdb backend = tdbsam” and “obey pam restrictions = yes”&lt;/li&gt;
&lt;li&gt;add a line saying “map to guest = bad user”&lt;/li&gt;
&lt;li&gt;comment out the lines beginning “passwd program =” and “passwd chat = “&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then we need to add a new share to the conf&lt;/p&gt;
&lt;pre&gt;[share]
    path = / 
    read only = no
    guest ok = yes
&lt;/pre&gt;</description><link>http://blog.jben.net/post/316986040</link><guid>http://blog.jben.net/post/316986040</guid><pubDate>Mon, 04 Jan 2010 23:24:04 +0000</pubDate></item><item><title>Links for setting up a VMware dev server</title><description>&lt;p&gt;Have waded through the net and found these the most useful.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download VMWare Fusion demo from &lt;a href="https://www.vmware.com/tryvmware/?p=vmware-fusion&amp;lp=1"&gt;&lt;a href="https://www.vmware.com/tryvmware/?p=vmware-fusion&amp;lp=1"&gt;https://www.vmware.com/tryvmware/?p=vmware-fusion&amp;lp=1&lt;/a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get the server image you require from &lt;a href="http://www.thoughtpolice.co.uk/vmware/#ubuntu8.04"&gt;&lt;a href="http://www.thoughtpolice.co.uk/vmware/#ubuntu8.04"&gt;http://www.thoughtpolice.co.uk/vmware/#ubuntu8.04&lt;/a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install using the guide that matches your download &lt;a href="http://www.thoughtpolice.co.uk/vmware/howto/1-minute-guide.html#ubuntu8.04"&gt;&lt;a href="http://www.thoughtpolice.co.uk/vmware/howto/1-minute-guide.html#ubuntu8.04"&gt;http://www.thoughtpolice.co.uk/vmware/howto/1-minute-guide.html#ubuntu8.04&lt;/a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Follow these instructions for installing SSH, VMWare tools &lt;a href="http://intranation.com/entries/2009/03/development-virtual-machines-os-x-using-vmware-and/"&gt;&lt;a href="http://intranation.com/entries/2009/03/development-virtual-machines-os-x-using-vmware-and/"&gt;http://intranation.com/entries/2009/03/development-virtual-machines-os-x-using-vmware-and/&lt;/a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now you can set up apache, mysql etc as you would do normally on a VPS or dedicated box, using SSH.&lt;/p&gt;
&lt;ol&gt;&lt;/ol&gt;</description><link>http://blog.jben.net/post/316447278</link><guid>http://blog.jben.net/post/316447278</guid><pubDate>Mon, 04 Jan 2010 15:31:33 +0000</pubDate></item><item><title>Clean inputted html with CakePHP BritaBehaviour</title><description>&lt;p&gt;I’ve been using TinyMCE as a text editor in my CMSs, and whilst it’s good, it can lead to the odd empty tag/para ending up in the html, font tags and all manner of other crap (especially if M$ Word has been involved at all), so I created a cakephp behaviour that uses the HTMLPurifier class to make all inputted html valid.&lt;/p&gt;
&lt;p&gt;First, you need to download the most recent version of the HTMLPurifier class from &lt;a href="http://htmlpurifier.org/download"&gt;&lt;a href="http://htmlpurifier.org/download"&gt;http://htmlpurifier.org/download&lt;/a&gt;&lt;/a&gt;, drop this in /{app}/vendors, and save the &lt;a href="http://pastie.org/745852"&gt;pasted code&lt;/a&gt; as ‘brita.php’ in /{app}/models/behaviors/.&lt;/p&gt;
&lt;p&gt;It’s dead simple to use, just do:&lt;/p&gt;
&lt;pre&gt;var $actsAs = array(
	'Brita'=&gt;array('synopsis', 'body', 'extended_body')
);&lt;/pre&gt;
&lt;p&gt;In the model(s) you need to clean up.&lt;/p&gt;</description><link>http://blog.jben.net/post/286268381</link><guid>http://blog.jben.net/post/286268381</guid><pubDate>Wed, 16 Dec 2009 16:52:48 +0000</pubDate></item><item><title>Be careful what you chew</title><description>&lt;a href="http://www.telegraph.co.uk/news/worldnews/europe/ukraine/6768473/Student-killed-by-exploding-chewing-gum.html"&gt;Be careful what you chew&lt;/a&gt;</description><link>http://blog.jben.net/post/276023280</link><guid>http://blog.jben.net/post/276023280</guid><pubDate>Wed, 09 Dec 2009 12:00:27 +0000</pubDate></item><item><title>Use MySQL's SUM function with CakePHP find()</title><description>&lt;p&gt;Saw this on IRC earlier, thought I’d blog it as it’s pretty useful info.&lt;/p&gt;
&lt;p&gt;Add this method to your AppModel:&lt;/p&gt;
&lt;pre&gt;public function sum($field='total')
{	
	$data = $this-&gt;find('first', array(
		'conditions'=&gt;$conditions,
		'fields'=&gt;array('SUM('.$field.') AS summed'),
		'contain'=&gt;array()
	));
	return $data[0]['summed'];
}&lt;/pre&gt;
&lt;p&gt;Then call it like so:&lt;/p&gt;
&lt;pre&gt;$total = $this-&gt;Model-&gt;sum('cost');&lt;/pre&gt;
&lt;p&gt;Hope this is useful for someone.&lt;/p&gt;</description><link>http://blog.jben.net/post/211992313</link><guid>http://blog.jben.net/post/211992313</guid><pubDate>Tue, 13 Oct 2009 15:18:15 +0100</pubDate></item><item><title>update on find('neighbours') with HABTM</title><description>&lt;p&gt;And, here, to cap off a really terrible brain day, is the solution, using cake’s core functionality, to the find(‘neighours’) with habtm conundrum!&lt;/p&gt;
&lt;pre&gt;$this-&gt;Mixture-&gt;bindModel(array('hasOne'=&gt;array('MixtureCategoriesMixture')), false);
$this-&gt;set('neighbours', $this-&gt;Mixture-&gt;find('neighbors', array(
	'field' =&gt; 'Mixture.sku', 'value' =&gt; $this-&gt;data['Mixture']['sku'],
	'conditions'=&gt;array(
		'MixtureCategoriesMixture.default'=&gt;1,
		'MixtureCategoriesMixture.mixture_category_id'=&gt;$this-&gt;data['MixtureCategory'][0]['id'],
		'Mixture.status'=&gt;1
	)
)));&lt;/pre&gt;
&lt;p&gt;Doh, doh doh!&lt;/p&gt;</description><link>http://blog.jben.net/post/125858269</link><guid>http://blog.jben.net/post/125858269</guid><pubDate>Thu, 18 Jun 2009 15:45:00 +0100</pubDate><category>cakephp</category></item><item><title>Update on find('neighbours'); </title><description>&lt;p&gt;After some IRCing, it appears I’d misunderstood how the array should work to get the method working correctly.&lt;/p&gt;
&lt;pre&gt;$this-&gt;set('neighbours', $this-&gt;Species-&gt;find('neighbors', array(
	'field' =&gt; 'Species.latin_name', 'value' =&gt; $this-&gt;data['Species']['latin_name'], 'order'=&gt;'asc',
	'conditions'=&gt;array(
		'Species.species_category_id'=&gt;$this-&gt;data['Species']['species_category_id'],
		'Species.status'=&gt;1
	)
)));&lt;/pre&gt;
&lt;p&gt;What a plonker.&lt;/p&gt;</description><link>http://blog.jben.net/post/125844770</link><guid>http://blog.jben.net/post/125844770</guid><pubDate>Thu, 18 Jun 2009 15:18:00 +0100</pubDate><category>cakephp</category></item><item><title>Replacement for find('neighbours') when dealing with HABTM and extra join data</title><description>&lt;p&gt;Found brain, solution realised, brainfart over, see &lt;a href="http://blog.jben.net/post/125858269/update-on-find-neighbours-with-habtm"&gt;&lt;a href="http://blog.jben.net/post/125858269/update-on-find-neighbours-with-habtm"&gt;http://blog.jben.net/post/125858269/update-on-find-neighbours-with-habtm&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.jben.net/post/125820619</link><guid>http://blog.jben.net/post/125820619</guid><pubDate>Thu, 18 Jun 2009 14:23:00 +0100</pubDate><category>cakephp</category></item><item><title>Long winded replacement for find('neighbours')</title><description>&lt;p&gt;Brain found, solution realised, brain fart over, see &lt;a href="http://blog.jben.net/post/125844770/update-on-find-neighbours"&gt;&lt;a href="http://blog.jben.net/post/125844770/update-on-find-neighbours"&gt;http://blog.jben.net/post/125844770/update-on-find-neighbours&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.jben.net/post/125792157</link><guid>http://blog.jben.net/post/125792157</guid><pubDate>Thu, 18 Jun 2009 13:05:00 +0100</pubDate><category>cakephp</category><category>php tips</category></item><item><title>Mystery open_base_dir errors with CakePHP 1.2</title><description>&lt;p&gt;A question came up on #cakephp about mystery open_base_dir errors, so I thought I’d document my fix. As I don’t use any other libraries when working with Cake projects, I simply removed the existing include path in &lt;code&gt;/app/webroot/index.php&lt;/code&gt;.&lt;/p&gt;    &lt;p&gt;on line 69 change: &lt;/p&gt;   &lt;p&gt;&lt;code&gt;ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'));&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;to&lt;/p&gt; &lt;p&gt;&lt;code&gt;ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS); &lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps someone.&lt;/p&gt;</description><link>http://blog.jben.net/post/30119836</link><guid>http://blog.jben.net/post/30119836</guid><pubDate>Fri, 28 Mar 2008 20:45:00 +0000</pubDate><category>cakephp</category><category>dev</category></item><item><title>First Post</title><description>&lt;p&gt;Found &lt;a href="http://tumblr.com"&gt;tumblr&lt;/a&gt; on &lt;a href="http://news.bbc.co.uk/1/hi/programmes/click_online/6574839.stm"&gt;bbc.co.uk news&lt;/a&gt;, probably won’t post again, but ya never know!&lt;/p&gt;
&lt;p&gt; j &lt;/p&gt;</description><link>http://blog.jben.net/post/1099361</link><guid>http://blog.jben.net/post/1099361</guid><pubDate>Sat, 21 Apr 2007 11:26:42 +0100</pubDate></item></channel></rss>
