<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>leftcolumn.net</title>
	
	<link>http://www.leftcolumn.net</link>
	<description>Covering Mac OS X, Mac Software, and other stuff</description>
	<lastBuildDate>Sat, 18 May 2013 05:48:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/leftcolumn" /><feedburner:info uri="leftcolumn" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Get my new ebook – A Pretty Good OS X Terminal Reference</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/waCnoUvB5Fk/</link>
		<comments>http://www.leftcolumn.net/2013/05/17/get-my-new-ebook-a-pretty-good-os-x-terminal-reference/#comments</comments>
		<pubDate>Thu, 16 May 2013 22:59:39 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=308</guid>
		<description><![CDATA[Hey I&#8217;ve just hit &#8216;publish&#8217; on this new reference ebook. Check out the info page here:  Ebook &#8211; A Pretty Good OS X Terminal Reference &#160;]]></description>
				<content:encoded><![CDATA[<p>Hey I&#8217;ve just hit &#8216;publish&#8217; on this new reference ebook. Check out the info page here:</p>
<p><a title="A Pretty Good OS X Terminal Reference" href="http://www.leftcolumn.net/product/a-pretty-good-os-x-terminal-reference/"> Ebook &#8211; A Pretty Good OS X Terminal Reference</a></p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/waCnoUvB5Fk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2013/05/17/get-my-new-ebook-a-pretty-good-os-x-terminal-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2013/05/17/get-my-new-ebook-a-pretty-good-os-x-terminal-reference/</feedburner:origLink></item>
		<item>
		<title>Fix Wi-Fi problems on Mac OSX</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/I38t0JkGo0Q/</link>
		<comments>http://www.leftcolumn.net/2013/04/01/fix-wi-fi-problems-on-mac-osx/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 10:01:48 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Wi-Fi]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=285</guid>
		<description><![CDATA[If  you find your wi fi network is getting slow, there may be interference from another network. If another Wi-Fi network nearby uses the same channel, or even a close channel, the two networks will collide, reducing speed for everyone. In OSX Lion or OSX Mountain Lion, hold down Option and click the Wireless network [...]]]></description>
				<content:encoded><![CDATA[<p>If  you find your wi fi network is getting slow, there may be interference from another network. If another Wi-Fi network nearby uses the same channel, or even a close channel, the two networks will collide, reducing speed for everyone.</p>
<p>In OSX Lion or OSX Mountain Lion, hold down Option and click the Wireless network menu item at the top right. This shows the wireless menu but with some added information. Under your network look for Channel. It will usually be 1, 6, or 11. Then hover over the other networks and note the channels that they use.</p>
<p>If any are close to your channel you might see some improvement in Wi-Fi speed if you pick another channel manually.  You need to use a channel as far from all the others as possible, and ideally it should be farthest from any channels that have a good signal(since they will disrupt you the most).</p>
<p>Open Applications &gt; Utilities &gt; AirPort Utility. Edit the settings for your device (the exact steps here depend on the version of AirPort Utility), go to Wireless &gt; Wireless Options and select the channel you decided on earlier. Save the settings and wait for the device to come back. Then test!</p>
<p>This issue seems to be particularly bad when the base station (a Time Capsule in my case) is in a far corner of the house, where, for example, channel 11 is a good choice. My office, in the other corner of the house, has many other nearby networks, some of which are on or around 11. So channel 11 is actually a poor choice for a channel. I looked at the channels in use nearby: 1, 6, 9, 11, 13. I manually set my Time Capsule ( but this is the same for any AirPort base station) to channel 4, which is around halfway between 1 and 6  and seemed like the best bet.</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/I38t0JkGo0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2013/04/01/fix-wi-fi-problems-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2013/04/01/fix-wi-fi-problems-on-mac-osx/</feedburner:origLink></item>
		<item>
		<title>How to install weekly Minecraft snapshots on Mac OSX</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/ycy8_xa_lzg/</link>
		<comments>http://www.leftcolumn.net/2012/11/18/how-to-install-weekly-minecraft-snapshots-on-mac-osx/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 08:45:23 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[minecraft]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=269</guid>
		<description><![CDATA[Did you know that future updates to Minecraft are always previewed in weekly snapshots? Big parts of the &#8216;pretty scary update&#8217; were available for weeks before it was officially released! Here&#8217;s how you can get access to the cool stuff in upcoming versions of Minecraft on your Mac: Quit Minecraft first! Go to Mojang&#8217;s site [...]]]></description>
				<content:encoded><![CDATA[<p>Did you know that future updates to Minecraft are always previewed in weekly snapshots? Big parts of the &#8216;pretty scary update&#8217; were available for weeks before it was officially released! Here&#8217;s how you can get access to the cool stuff in upcoming versions of Minecraft on your Mac:</p>
<ul>
<li>Quit Minecraft first!</li>
<li>Go to <a title="Mojang's website" href="http://www.mojang.com" target="_blank">Mojang&#8217;s site</a></li>
<li>Find and the newest snapshot (sometimes they call them &#8216;pre-releases&#8217;)</li>
<li> On your mac go to /Users/[your user name]/Library/Application Support/minecraft/bin</li>
<li>Click on minecraft.jar and press Command + D to duplicate it</li>
<li>Open another Finder window at your Downloads folder</li>
<li>Drag minecraft.jar from your Downloads folder into the /Users/[your user name]/Library/Application Support/minecraft/bin window, replacing the older version of minecraft.jar</li>
<li>Next time you start Minecraft, check the version number in the bottom left of the login screen</li>
<li>That&#8217;s it. Play!</li>
</ul>
<p>&#8230;Since you&#8217;ve backed up the only file we&#8217;re changing you can always go back to an older version of Minecraft if you have problems. But because new versions will be working on your saved games, it&#8217;s a good idea to back those up before changing anything. Here&#8217;s how to backup you Minecraft saved worlds on Mac OS X:</p>
<ul>
<li>Quit Minecraft first!</li>
<li>On your mac go to /Users/[your user name]/Library/Application Support/minecraft</li>
<li>Click on &#8216;Saves&#8217; and hit Command + D to duplicate it.</li>
<li>Drag this copy to the Desktop</li>
</ul>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/ycy8_xa_lzg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2012/11/18/how-to-install-weekly-minecraft-snapshots-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2012/11/18/how-to-install-weekly-minecraft-snapshots-on-mac-osx/</feedburner:origLink></item>
		<item>
		<title>How to fix blank screens when instantiating objects in Zend Framework</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/7x8pjnv05_Y/</link>
		<comments>http://www.leftcolumn.net/2012/04/05/how-to-fix-blank-screens-when-instantiating-objects-in-zend-framework/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 04:25:38 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[how]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=256</guid>
		<description><![CDATA[In certain cases ZF will refuse to instantiate an object and exit, mainfesting as a blank screen (or &#8216;silent fail&#8217;). No exceptions are thrown and nothing is logged by php. Since it fails to trigger the basic mechanisms of php error reporting this kind of error can be annoying to troubleshoot. Here&#8217;s what I&#8217;ve found: [...]]]></description>
				<content:encoded><![CDATA[<p>In certain cases ZF will refuse to instantiate an object and exit, mainfesting as a blank screen (or &#8216;silent fail&#8217;). No exceptions are thrown and nothing is logged by php. Since it fails to trigger the basic mechanisms of php error reporting this kind of error can be annoying to troubleshoot. Here&#8217;s what I&#8217;ve found:</p>
<p>It seems to occur when instantiating a class that extends Zend_Db_Table_Abstract or other models<br />
It always involves syntax errors in the class<br />
The errors are not detected<br />
It is not related to file corruption or bad characters in the source file (Zap Gremlins/ Convert to Ascii on the source does not make any difference)<br />
File permissions are ok</p>
<p>HOW TO FIX IT:  Try to instantiate the class from inside a Controller/Action and see what happens. Usually php will behave normally under these conditions and correctly report the error type and the line number.</p>
<p>Lastly, I am not sure why this problem occurs inside models but not not  controllers. Also, I haven&#8217;t struck it in ZF 1.11, only 1.10 and earlier.</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/7x8pjnv05_Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2012/04/05/how-to-fix-blank-screens-when-instantiating-objects-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2012/04/05/how-to-fix-blank-screens-when-instantiating-objects-in-zend-framework/</feedburner:origLink></item>
		<item>
		<title>How to add TinyMCE to a Zend_Form</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/XlVHHppKacg/</link>
		<comments>http://www.leftcolumn.net/2012/04/01/how-to-add-tinymce-to-a-zend_form/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 20:55:19 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[tinymce]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=242</guid>
		<description><![CDATA[I struck some annoying issues getting CKEditor to work on a recent project and switched to TinyMCE, which is faster to implement. Here&#8217;s how to make TinyMCE integrate with your Zend Forms. 1. Install Download TinyMCE and put it somewhere the browser can find it. The important thing is that it needs to be accessible [...]]]></description>
				<content:encoded><![CDATA[<p>I struck some annoying issues getting CKEditor to work on a recent project and switched to TinyMCE, which is faster to implement. Here&#8217;s how to make TinyMCE integrate with your Zend Forms.</p>
<h2>1. Install</h2>
<p><a title="Download TinyMCE" href="http://www.tinymce.com/download/download.php">Download TinyMCE </a>and put it somewhere the browser can find it. The important thing is that it needs to be accessible to the world, for example: /js/tinymce/, which on your server may be a path like /var/www/html/your_site/js/tinymce/.</h2>
<h2>2. .htaccess for TinyMCE</h2>
<p>The .htaccess that sets up your index.php as the ZF bootstrap will greedily grab all requests ending in .php. It needs to <em>exclude the php files that TinyMCE uses</em>. So if your bootstrap code in .htaccess looks like this:</p>
<p><code>RewriteEngine on<br />
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php</code></p>
<p>you’ll need to change it. I typically only rewrite to /index.php if the requested file really doesn’t exist. So .htaccess should be something like this:</p>
<p><code><br />
RewriteEngine on<br />
RewriteCond %{SCRIPT_FILENAME} !-f<br />
RewriteCond %{SCRIPT_FILENAME} !-d<br />
RewriteRule ^(.*)$ index.php/$1</code></p>
<h2>3. Zend_Form Elements</h2>
<p>Here&#8217;s an example of a textarea element in a Zend_Form:<br />
<strong>Important: You must filter out all tags and attributes that you don’t want to explicitly allow. The code below will allow any html permitted by TinyMCE to be uploaded. Use this in conjunction with a quality filtering tool such as HTMLPurifier. </strong></p>
<p><code><br />
$node_content = new Zend_Form_Element_Textarea('node_content');<br />
$node_content->setLabel('Node Content')<br />
	->setRequired(false)<br />
	->setAttrib('cols', 40)<br />
	->setAttrib('rows', 12)<br />
	->addFilter('StringTrim')<br />
	->addValidator('NotEmpty')<br />
	->addValidator('StringLength', false, array(0,65534));	</code></p>
<h2>4. View Script</h2>
<p>Let’s assume that you use Layouts, and that you only want to use TinyMCE on a couple of pages on your site. For reasons of economy you don’t want to include the TinyMCE code on every page, so do something like this in the View Script (Note: WordPress is messing with the quote marks in this block, ensure you have single quotes after src= and before the last semicolon. The other quotes should be double quotes.):</p>
<p><code><br />
$this->custom_head = '&lt;script src="/js/tinymce/tiny_mce.js" type="text/javascript"&gt;&lt;/script&gt;';<br />
$this->custom_head .= "&lt;script language='javascript' type='text/javascript' src='/js/customs.js'&gt;&lt;/script&gt;";<br />
</code></p>
<h2>5. Layout Script</h2>
<p>The scripts we have added in the View Script won&#8217;t bubble up to the Layout Script unless it knows about this new variable, so the Layout Script needs to know to refer to $this->custom_head if it is set. Drop the code below inside the <head> section of your layout script:</p>
<p><code><br />
if ($this->custom_head) {<br />
	echo $this->custom_head;<br />
}<br />
</code></p>
<h2>6. Start TinyMCE</h2>
<p>Create /js/custom.js and put this in it:</p>
<p><code>tinyMCE.init({<br />
	mode : "textareas",<br />
	theme : "advanced",<br />
        theme_advanced_buttons1_add_before : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor"<br />
        theme_advanced_buttons2_add_before : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code"<br />
        theme_advanced_buttons3_add_before : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"<br />
});</code></p>
<p>&#8230;You will probably want to <a href="http://www.tinymce.com/wiki.php/Buttons/controls" title="customise the TinyMCE toolbar buttons">customise</a> the toolbar buttons.</p>
<h2>7. Last Steps</h2>
<p>It is vital that you install and configure <a href="http://htmlpurifier.org/">HTMLPurifier</a> if you haven&#8217;t already. Do not attempt to write your own filter!</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/XlVHHppKacg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2012/04/01/how-to-add-tinymce-to-a-zend_form/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2012/04/01/how-to-add-tinymce-to-a-zend_form/</feedburner:origLink></item>
		<item>
		<title>/etc/hosts file on Mac OSX</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/DRhR6oEH3FA/</link>
		<comments>http://www.leftcolumn.net/2011/11/29/etchosts-file-on-mac-osx/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 04:28:09 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[mac system admin]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=237</guid>
		<description><![CDATA[I just put this together to cover a question I was asked recently. Might be useful to someone&#8230; Where is the /etc/hosts file in Mac OS X? The hosts file used by Mac OS X is in /etc/. Windows users sometimes have problems finding it since there&#8217;s no %SystemRoot%\system32\drivers\etc folder in the Mac OS. UNIX [...]]]></description>
				<content:encoded><![CDATA[<p><em>I just put this together to cover a question I was asked recently. Might be useful to someone&#8230;</em></p>
<h3>Where is the /etc/hosts file in Mac OS X?</h3>
<p>The hosts file used by Mac OS X is in /etc/. Windows users sometimes have problems finding it since there&#8217;s no %SystemRoot%\system32\drivers\etc folder in the Mac OS. UNIX users might not expect /etc/ to be hidden by the Mac OS X Finder, so they often look in /Library/Application Support/</p>
<h3>Accessing /etc/hosts</h3>
<p>/etc/ is hidden by default. The easiest way of getting to the hosts file is to open /Applications/Utilities/Terminal.app. Then type:<br />
<code>sudo nano /etc/hosts</code></p>
<p>&#8230;you will need to type in your password. Your hots file will open in the text editor &#8216;nano.&#8217;</p>
<h3>Adding entries to /etc/hosts</h3>
<p>On a new line type the IP Address followed by at least one space or tab and then the hostname. Examples:<br />
<code>127.0.0.1 mydevsite.local<br />
192.168.1.222 ads.shadycompany.biz</code></p>
<p>&#8230;hit ctrl + o to Save, and then ctrl + x to quit the text editor.</p>
<p>See here for more about using /etc/hosts for Virtual Servers: <a href="http://www.leftcolumn.net/2009/07/04/adding-an-entry-to-etchosts-on-os-x/" title="Adding an entry to /etc/hosts on OS X">Adding an entry to /etc/hosts on OS X</a></p>
<h3>Background: What is /etc/hosts used for?</h3>
<p>The hosts file is a simple way of mapping IP Addresses to hostnames. It overrides mappings provided by the Domain Name System network. The hosts file is commonly used by network administrators to provide access to LAN resources when no name resolution is available. The other common usage is to block access to specified hosts by adding host entries resolving them to &#8212; for example &#8212; 127.0.0.1.<br />
More Resources:<br />
<a title="Hosts File" href="http://en.wikipedia.org/wiki/Hosts_(file)">http://en.wikipedia.org/wiki/Hosts_(file)</a></p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/DRhR6oEH3FA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2011/11/29/etchosts-file-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2011/11/29/etchosts-file-on-mac-osx/</feedburner:origLink></item>
		<item>
		<title>Two Nifty Terminal History Tricks</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/dyC-yDx0pqw/</link>
		<comments>http://www.leftcolumn.net/2010/05/12/nifty-terminal-history-trick/#comments</comments>
		<pubDate>Tue, 11 May 2010 12:39:51 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=226</guid>
		<description><![CDATA[I&#8217;ve covered the &#8216;history&#8217; command before, but here are two more useful Mac OS X Terminal commands&#8230; I&#8217;ve been using the Ctrl+ R trick (Hit Ctrl + R, start typing part of the command you want. If you don&#8217;t like the first suggestion hit Ctrl + R again to show the next one). This is [...]]]></description>
				<content:encoded><![CDATA[<p><strong>I&#8217;ve covered the <a href="http://www.leftcolumn.net/2009/02/15/40-useful-mac-os-x-shell-scripts-and-terminal-commands/">&#8216;history&#8217; command</a> before, but here are two more useful Mac OS X Terminal commands&#8230;</strong></p>
<p>I&#8217;ve been using the Ctrl+ R trick (Hit Ctrl + R, start typing part of the command you want. If you don&#8217;t like the first suggestion hit Ctrl + R again to show the next one). This is really handy and fast and it will return matches from the middle of the string.</p>
<p>And I just found another great Terminal command here: <a href="http://osxdaily.com/2010/05/10/discover-the-last-used-command-beginning-with-anything-without-executing-it/">Discover the last used command beginning with anything without executing it</a>&#8230; this one is a bit harder to use:</p>
<p><code>![needle]:p</code></p>
<p>&#8230;where [needle] is the first character(s) of the command you&#8217;re looking for. It&#8217;s not as flexible because it only shows the most recent match instead of cycling through the results, but could still come in handy.</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/dyC-yDx0pqw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2010/05/12/nifty-terminal-history-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2010/05/12/nifty-terminal-history-trick/</feedburner:origLink></item>
		<item>
		<title>Adding an entry to /etc/hosts on OS X</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/jbAjnD5owzM/</link>
		<comments>http://www.leftcolumn.net/2009/07/04/adding-an-entry-to-etchosts-on-os-x/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 23:31:53 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=216</guid>
		<description><![CDATA[Web Developers, Administrators of Mac Networks, and anyone who likes to noodle with OS X will probably eventually need to add hosts file entries. I use them when I&#8217;m testing a moved and/or changed version of a website at new hosting before I move the DNS. I used to add hosts file entries manually then [...]]]></description>
				<content:encoded><![CDATA[<p>Web Developers, Administrators of Mac Networks, and anyone who likes to noodle with OS X will probably eventually need to add hosts file entries. I use them when I&#8217;m testing a moved and/or changed version of a website at new hosting before I move the DNS.</p>
<p>I used to add hosts file entries manually then wonder why they didn&#8217;t seem to work. I tried rebooting, logging out, etc with varying success, until I learned this trick. On the Mac you must flush the DNS cache for the changes to take effect. Mac OS X used to have a friendly utility called NetInfo Manager, but that seems to have been removed in Leopard, so we&#8217;re using terminal commands.</p>
<p>Open a terminal sesion and type:<br />
<code>sudo nano /etc/hosts</code></p>
<p>Hit the down arrow until you get to the end of the file, and add your hosts file entry, for example:<br />
<code>192.168.2.33 myintranetserver.mydomain.com</code><br />
&#8230; I put in an extra line break at the end. I don&#8217;t think it&#8217;s really necessary but it&#8217;s a habit from having to use Windows, which would ignore the last line in a hosts file. </p>
<p>then flush the cache:<br />
<code>sudo dscacheutil -flushcache</code></p>
<p>&#8230;the name should now resolve! Test it:<br />
<code>ping myintranetserver.mydomain.com</code></p>
<h3>Other Info</h3>
<p>One thing that Windows, for all its annoyances, did get right is that changes to the hosts file (in &#8216;c:\Windows\system32\drivers\etc&#8217;) are reflected immediately. I&#8217;d like to see Apple do something about this in OS X, perhaps just flushing the cache automatically when /etc/hosts changes.</p>
<p>Another handy use for /etc/hosts is to set up mapping of virtual server addresses. For example, I use MAMP on my development Mac, and create new virtual hosts entries in Apache for each site I&#8217;m working on. Then for each I just add a new entry in the hosts file, e.g.:<br />
<code>127.0.0.1 devclientsite7.leftcolumn.net</code><br />
&#8230; then I just use devclientsite7.leftcolumn.net:8080 in Safari or Firefox to access the development site. It means my development sites don&#8217;t have to be in subdirectories, instead I just make sure the sites use a config file to figure out what their address is, and I make sure that config file is updated when the site is moved to a live system.</p>
<p>On OS X Tiger (10.4) and probably earlier, there was some strange behaviour with hosts file entries. You could add an entry and it would take effect, but if you had no network available, the name would not resolve and could not be used, even if it resolved to 127.0.0.1! So you have the bizarre situation of putting in addresses for virtual hosts as described in the previous paragraph, all of which resolve to 127.0.0.1, but still not being able to use them for testing and development when not connected to the Internet. If anyone can enlighten me as to how this was anything other than a bug in OS X I&#8217;d be interested&#8230;</p>
<p>You can also use hosts file entries to block ads (by resolving common ad server addresses to e.g.: 127.0.0.1). You can download huge lists of ad servers for this purpose. This is a good idea when you&#8217;re stuck using  Internet Explorer on Windows, especially on dial-up.</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/jbAjnD5owzM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2009/07/04/adding-an-entry-to-etchosts-on-os-x/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2009/07/04/adding-an-entry-to-etchosts-on-os-x/</feedburner:origLink></item>
		<item>
		<title>MacBook Pro won’t wake up from sleep</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/SMpM5nSSoVQ/</link>
		<comments>http://www.leftcolumn.net/2009/05/24/macbook-pro-wont-wake-up-from-sleep/#comments</comments>
		<pubDate>Sun, 24 May 2009 00:31:47 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mac osx]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=205</guid>
		<description><![CDATA[One day my new MacBook Pro 17&#8243; wouldn&#8217;t wake up. When I opened the lid machine was running but the Desktop wouldn&#8217;t load (just a default blue Desktop background colour) and there was no response from the Mouse or Keyboard. I eventually had to hard reset the Mac. This annoying issue can apparently be caused [...]]]></description>
				<content:encoded><![CDATA[<p>One day my new MacBook Pro 17&#8243; wouldn&#8217;t wake up. When I opened the lid machine was running but the Desktop wouldn&#8217;t load (just a default blue Desktop background colour) and there was no response from the Mouse or Keyboard. I eventually had to hard reset the Mac. </p>
<p>This annoying issue can apparently be caused a few different ways, but if your Mac is new and has all System Updates applied, chances are that the issue is caused when you close the lid and then move the mac before the contents of RAM are written out. There&#8217;s a feature called Safe Sleep, enabled by default, which can preserve and restore the state of a sleeping Mac even when the battery is removed. This sounds great, but the Safe Sleep procedure can take up to 30 seconds, which is too long for me.</p>
<p>How to fix this annoying problem? Here&#8217;s how I switched it off:</p>
<pre>sudo pmset -a hibernatemode 0
sudo rm /var/vm/sleepimage
</pre>
<p>&#8230;you need to supply the super user password. After making the change, reboot the Mac. The Mac should now Sleep within a couple of seconds. The second line removes the file that Sleep Safe uses to store the contents of RAM. Since you&#8217;ve switched off Safe Sleep, the space can be recovered.</p>
<p>Personally I don&#8217;t see the need for Safe Sleep on a Mac with a non-removable battery, but be aware that if the machine is asleep and runs out of battery power you wil lose your logged in session! I haven&#8217;t tried it, and most OS X apps will deal pretty well with this anyway, but it&#8217;s not wise to let this happen&#8230;</p>
<p>More details:</p>
<p><a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/pmset.1.html">Apple pmset Manual</a><br />
<a href="http://www.macworld.com/article/53471/2006/10/sleepmode.html">Macworld article on setting sleep modes</a></p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/SMpM5nSSoVQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2009/05/24/macbook-pro-wont-wake-up-from-sleep/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2009/05/24/macbook-pro-wont-wake-up-from-sleep/</feedburner:origLink></item>
		<item>
		<title>Zend Framework: How to add FCKeditor to a Zend_Form</title>
		<link>http://feedproxy.google.com/~r/leftcolumn/~3/BFq8rI_iF1U/</link>
		<comments>http://www.leftcolumn.net/2009/03/10/zend-framework-how-to-add-fckeditor-to-a-zend_form/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 00:39:18 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://www.leftcolumn.net/?p=157</guid>
		<description><![CDATA[UPDATE: Please use my TinyMCE Zend_Form instructions instead: they are easier. They are also potentially more secure since the instructions below advocate an outdated, flimsy form of html filtering. There are around 1,083,367 JavaScript-based Rich-Text Editors out there, and I&#8217;m sure most are pretty good. But I&#8217;ve had good results with FCKeditor so I use [...]]]></description>
				<content:encoded><![CDATA[<p><strong><em>UPDATE: Please use my <a href="http://www.leftcolumn.net/2012/04/01/how-to-add-tinymce-to-a-zend_form/">TinyMCE Zend_Form instructions</a> instead: they are easier. They are also potentially more secure since the instructions below advocate an outdated, flimsy form of html filtering.</em></strong></p>
<p><strong><em>There are around 1,083,367 JavaScript-based Rich-Text Editors out there, and I&#8217;m sure most are pretty good. But I&#8217;ve had good results with FCKeditor so I use it on all my projects. Here&#8217;s a step-by-step guide to adding the FCKeditor to your Zend Form Elements. </em></strong></p>
<h3>1 &#8211; The basics</h3>
<p><span style="font-weight: normal;"><a href="http://www.fckeditor.net/">Download FCKeditor</a> and Upload it to your Web Server. It needs to be somewhere accessible to the world, for example: <strong>/js/fckeditor/</strong>, which on your server may be a path like <strong>/var/www/html/your_site/js/fckeditor/</strong>.</span></p>
<p><span style="font-weight: normal;"><br />
</span></p>
<h3>2 &#8211; .htaccess</h3>
<p><span style="font-weight: normal;">The .htaccess that sets up your index.php as the bootstrap needs to <em>exclude the files that FCKeditor uses</em>. If your bootstrap code in .htaccess looks like this:</span></p>
<pre>RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php</pre>
<p>you&#8217;ll need to change it. I typically only rewrite to /index.php if the requested file <em>really</em> doesn&#8217;t exist. So .htaccess should be something like this:</p>
<pre>RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1</pre>
<p><span style="font-weight: normal;"><br />
</span></p>
<h3>3 &#8211; Zend_Form Elements</h3>
<p>In the Form code, you need to make sure that you know the id of the Element (In this case the id is &#8216;body&#8217;), and that you are filtering out all tags and attributes that you don&#8217;t want to explicitly allow. Create an allowed_tags list like the one below and ensure that the FormElement has a StripTags filter applied to it:</p>
<pre>$allowed_tags = array(
	'a' =&gt;	array('href', 'title'),
	'strong',
	'img'	=&gt;	array('src', 'alt'),
	'ul',
	'ol',
	'li',
	'em',
	'u',
	'strike');

$body = new Zend_Form_Element_Textarea('body');
$body-&gt;setLabel('Body')
	-&gt;setAttrib('rows', 12)
	-&gt;setAttrib('cols', 40)
	-&gt;setRequired(true)
	-&gt;addFilter('StringTrim')
	-&gt;addFilter('StripTags', $allowed_tags);</pre>
<p><span style="font-weight: normal;"><br />
</span></p>
<h3>4 &#8211; View Script</h3>
<p>Let&#8217;s Assume that you use Layouts, and that you only want to use the FCKeditor on a couple of pages on your site. You don&#8217;t want to include the FCKeditor code on every page because it just adds to the page size, so we do something like this in the View Script <em>(Note: WordPress is messing with the quote marks in this block, ensure you have single quotes after <strong>src=</strong> and before the last semicolon. The other quotes should be double quotes.)</em>:</p>
<pre>$this-&gt;custom_head = '&lt;script src="/js/fckeditor/fckeditor.js" type="text/javascript"&gt;&lt;/script&gt;';
$this-&gt;custom_head .= "&lt;script language='javascript' type='text/javascript' src='/js/customs.js'&gt;&lt;/script&gt;";
$this-&gt;custom_body = ' onload="setupFCK()"';</pre>
<p><span style="font-weight: normal;"><br />
</span></p>
<h3>5 &#8211; Layout Script</h3>
<p>The Layout Script needs to know about this new variable, so the Layout Script needs to know to refer to $this-&gt;custom_head if it is set. Drop the code below inside the &lt;head&gt; section of your layout script:</p>
<pre>&lt;?php

if ($this-&gt;custom_head) {
	echo $this-&gt;custom_head;
}
?&gt;</pre>
<p>&#8230;and change the html body element to look like this:</p>
<pre>&lt;body&lt;?php if ($this-&gt;custom_body) {
	echo $this-&gt;custom_body;
}?&gt;&gt;</pre>
<h3>6 &#8211; Loading the FCKEditor when the page loads</h3>
<p>Create /js/custom.js and put this in it:</p>
<pre><span style="font-weight: normal;">function setUpFCK() { if(document.getElementById('body')) { var oFCKeditor = new FCKeditor('body') ; oFCKeditor.BasePath = "/js/fckeditor/" ; oFCKeditor.Height = 400; oFCKeditor.ReplaceTextarea() ; } }</span></pre>
<h3>7 &#8211; FCKeditor changes</h3>
<p>I like to implement FCKeditor as a single row of buttons for basic editing, just to keep it from looking too big and clunky. I use a set of icons like this:</p>
<pre>FCKConfig.ToolbarSets["Default"] = [
	['Bold','Italic','Underline','StrikeThrough','OrderedList','UnorderedList','Blockquote','Link','Unlink','Image', 'SpecialChar','SpellCheck']
] ;</pre>
<p>And I don&#8217;t want to enable any kind of file uploads, so I make sure these configs are all set to false (edited to show the relevant bits):</p>
<pre>FCKConfig.LinkBrowser = false ;
...
FCKConfig.ImageBrowser = false ;
...
FCKConfig.FlashBrowser = false ;
...
FCKConfig.LinkUpload = false ;
...
FCKConfig.ImageUpload = false ;
...
FCKConfig.FlashUpload = false ;</pre>
<p><span style="font-weight: normal;"><br />
</span></p>
<h3>8 &#8211; Anything else?</h3>
<p>Not really! There are no Controller changes, which is good because this stuff all belongs in Views anyway. The Models know about the allowed tags, which is good because that&#8217;s the kind of work that Models should do. So to me this solution fits the MVC pattern and is not too hack-like. Feedback welcome&#8230;</p>
<h3>Update: 25/3/09</h3>
<p>Fixed various problems with the instructions and it should now all work properly.</p>
<h3>Update: 29/11/2011</h3>
<p>Fixed a typo. Also: check out Frost&#8217;s comment below for a tidier way to do this.</p>
<img src="http://feeds.feedburner.com/~r/leftcolumn/~4/BFq8rI_iF1U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.leftcolumn.net/2009/03/10/zend-framework-how-to-add-fckeditor-to-a-zend_form/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.leftcolumn.net/2009/03/10/zend-framework-how-to-add-fckeditor-to-a-zend_form/</feedburner:origLink></item>
	</channel>
</rss>
