<?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>workbench @ haefelinger.it &#187; macosx</title>
	<atom:link href="http://workbench.haefelinger.it/archives/category/macosx/feed" rel="self" type="application/rss+xml" />
	<link>http://workbench.haefelinger.it</link>
	<description>Notes, thouhts and other stuff on software development</description>
	<lastBuildDate>Wed, 07 Apr 2010 07:02:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wireshark &amp; Snow Leopard</title>
		<link>http://workbench.haefelinger.it/archives/181</link>
		<comments>http://workbench.haefelinger.it/archives/181#comments</comments>
		<pubDate>Wed, 07 Apr 2010 07:02:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[macosx]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://workbench.haefelinger.it/?p=181</guid>
		<description><![CDATA[Wireshark failed to start after having upgraded to Snow Leopard, the latest incarnation of Mac OS X.
This is a well known bug. To make Wireshark run again, try to delete your local X11 font cache, i.e. 

$ rm -rf $HOME/.fontconfig

That should do it.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Wireshark">Wireshark</a> failed to start after having upgraded to Snow Leopard, the latest incarnation of Mac OS X.</p>
<p><a href="https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3969">This is a well known bug</a>. To make Wireshark run again, try to delete your local X11 font cache, i.e. </p>
<pre lang="bash">
$ rm -rf $HOME/.fontconfig
</pre>
<p>That should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://workbench.haefelinger.it/archives/181/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacPorts, MySQL, PHP5 and that socket thing ..</title>
		<link>http://workbench.haefelinger.it/archives/162</link>
		<comments>http://workbench.haefelinger.it/archives/162#comments</comments>
		<pubDate>Sat, 13 Feb 2010 20:36:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[macosx]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://workbench.haefelinger.it/?p=162</guid>
		<description><![CDATA[I&#8217;m using MacPorts to have a variety of Open-Source software on my computer. Amongst them MySQL and Apache&#8217;s web server with PHP. In addition I&#8217;m also running Wordpress, a popular blog software, and  Mediawiki, the software behind Wikipedia. Both applications are written in PHP and can be configured to use MySQL as database. 
I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using MacPorts to have a variety of Open-Source software on my computer. Amongst them MySQL and Apache&#8217;s web server with PHP. In addition I&#8217;m also running Wordpress, a popular blog software, and  Mediawiki, the software behind Wikipedia. Both applications are written in PHP and can be configured to use MySQL as database. </p>
<p>I install those two web applications myself rather than using MacPorts to do so. The installation is basically nothing more than unzipping the distribution package and to modify the configuration files to make sure they connect to my MySQL database on my <em>localhost</em>. However, while installing Wordpress went smooth, I run into <em>database connection failures</em> when installing Mediawiki. It took me some time to figure out what is going on here.</p>
<p>If you have weird connection problems using PHP and MySQL then try one or both of the following solutions:</p>
<ul>
<li><strong>Solution</strong>: Use <code>127.0.0.1</code> instead of <code>localhost</code> as host of your MySQL database server. This has a rather surprising effect, see below.
</li>
<li><strong>Solution</strong>: Change your PHP&#8217;s configuration file, which is  <code>/opt/local/etc/php5/php.ini</code>, to contain the following two lines:
<ol>
<li>Tell PHP about the Unix domain socket to use
<pre>
   mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock
</pre>
</li>
<li> In addtion make sure that PHP&#8217;s save mode is off (notice that this feature has been deprecated and removed in PHP 6), otherwise your previous modification will be gracefully ignored:
<pre>
    safe_mode = Off
</pre>
</li>
</ol>
<p>Notice that in addition you need to <strong>restart your Apache web server</strong> so that your changes are taken into account. You can do that with <code>apachectl restart</code>.
</li>
</ul>
<h4>Background Information</h4>
<p>Neither Mediawiki nor Wordpress (nor most other PHP based web application accessing MySQL) implement the gory details how to connect to a database. Usually they just delegate this to <code>mysql_connect();</code>, a API function provided by PHP.</p>
<p>PHP in turn uses the functionality of a (shared) library provided by MySQL, i.e. the MySQL driver. MySQL allows you to connect to the database via <strong>two routes</strong>:</p>
<ol>
<li>via <strong>Internet sockets</strong> (TCP/IP); and via</li>
<li><strong>UNIX domain sockets</strong></li>
</ol>
<p>So, how does one choose between this two routes? The answer is rather surprising. MySQL decided to give <em>localhost</em> a new meaning. If you specify <code>localhost</code>, then the UNIX domain socket route is chosen. If you say <code>127.0.0.1</code> instead, then you connect via an Internet socket. While this is probably the most natural thing for those MySQL folks, it&#8217;s a rather confusing fact for all other humans. It is rather carved deep in our brain for years now that  <code>127.0.0.1</code> and <code>localhost</code> is the same thing.</p>
<p>After I have changed both Mediawiki and Wordpress to use <code>localhost</code> I had for the first time a situation where both web applications behaved in the very same way. <em>They both did not work</em>. Then, when I changed to <code>127.0.0.1</code>, both worked fine. Btw, notice that <code>localhost</code> is the default <em>hostname</em> used by Mediawiki while  <code>127.0.0.1</code> is the default <em>host</em> suggested by Wordpress.</p>
<p>Using <code>127.0.0.1</code> is usually fine, however I <strong>do want</strong> to use the UNIX socket and I was wondering what went wrong.</p>
<p>The problem is that MacPorts MySQL port patches the original MySQL sources to use socket <code>/opt/local/var/run/mysql5/mysqld.sock</code> instead <code>/tmp/mysql.sock</code>. This change is not particular well documented. One would assume that this kind of change goes into an appropriate <code>my.conf</code> configuration file. That&#8217;s actually not the case. Even worse, MacPorts MySQL port does not even ship with such a configuration file. </p>
<p>Changing the default socket location is one thing, not telling us and the PHP5 maintainer this is another sin. So, while MySQL happily uses that weird socket location, PHP5 still expects <code>/tmp/mysql.sock</code>. In other words, PHP and MySQL are not working out of the box when using MacPorts. At least not when relying on Unix domain sockets. It does work when using Internet domain sockets cause that default port, being 3306, has not changed. Btw, the MacPorts maintainer of PHP and MySQL is one and the same person. Sounds familiar? Yes, I also have been thinking about <em>Dr. Jekyll and Mr. Hyde</em>. No serious. I assume that there is a serious reason why this does not work out of the box as we all wish. I just don&#8217;t get it.</p>
]]></content:encoded>
			<wfw:commentRss>http://workbench.haefelinger.it/archives/162/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSync Plugin</title>
		<link>http://workbench.haefelinger.it/archives/137</link>
		<comments>http://workbench.haefelinger.it/archives/137#comments</comments>
		<pubDate>Tue, 02 Feb 2010 10:25:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[macosx]]></category>

		<guid isPermaLink="false">http://workbench.haefelinger.it/?p=137</guid>
		<description><![CDATA[Uploaded an iSync plugin for the Nokia 2720 (fold) mobile phone. When plugged in, it will become easy to synchronize addresses, events etc. between the mobile phone and your Mac. Just enable Bluetooth on your Mac and on your phone and make sure that they are paired. Then, start-up iSync and add a device. It [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://download.haefelinger.it/isync-nokia-2720/latest/">Uploaded</a> an iSync plugin for the Nokia 2720 (fold) mobile phone. When plugged in, it will become easy to synchronize addresses, events etc. between the mobile phone and your Mac. Just enable Bluetooth on your Mac and on your phone and make sure that they are paired. Then, start-up iSync and add a device. It should find automatically your mobile. Otherwise it will report that your mobile is not supported. Once the device is added, just press the big round button to start syncing.<br />
 <div class="wp-caption aligncenter" style="width: 433px"><img alt="iSync screenshot with device Nokia 2720 added." src="http://download.haefelinger.it/isync-nokia-2720/latest/isync-nokia-screenshot.png" title="iSync screenshot" width="423" height="132" /><p class="wp-caption-text">iSync screenshot with device Nokia 2720 added.</p></div></p>
<p>The easiest way to install this plugin is by using the <a href="http://download.haefelinger.it/isync-nokia-2720/latest/nokia-2720a-2.dmg">nokia-2720a-2.dmg</a> installer package. When being used, the plugin will be installed in folder <code>/Library/PhonePlugins/</code>. To support other installation locations, other package formats have been <a href="http://download.haefelinger.it/isync-nokia-2720/latest/">uploaded</a> as well. To support a <em>private</em> installation, create folder <code>~/Library/PhonePlugins</code> then download an untar <a href="http://download.haefelinger.it/isync-nokia-2720/latest/nokia-2720a-2.phoneplugin.tgz">package nokia-2720a-2.phoneplugin.tgz</a> within this folder. Eventually restart iSync and try adding your device again.</p>
]]></content:encoded>
			<wfw:commentRss>http://workbench.haefelinger.it/archives/137/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love my Mac!</title>
		<link>http://workbench.haefelinger.it/archives/17</link>
		<comments>http://workbench.haefelinger.it/archives/17#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:26:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[macosx]]></category>

		<guid isPermaLink="false">http://workbench.haefelinger.it/?p=17</guid>
		<description><![CDATA[This article is actually not about developing software. It's all about that the <em>wow!..</em> is back, at least once a while. It was again my Mac featuring MacOS X 10.5 aka Leopard making me happy. It started with my mobile device which, for unknown reasons, stops working when in a foreign country. Stops working in this context means that I can't make any phone call nor send SMS. So this is pretty serious.]]></description>
			<content:encoded><![CDATA[<p>This article is actually not about developing software. It&#8217;s all about that the <em>wow!..</em> is back, at least once a while. It was again my Mac featuring MacOS X 10.5 aka Leopard making me happy. It started with my mobile device which, for unknown reasons, stops working when in a foreign country. Stops working in this context means that I can&#8217;t make any phone call nor send SMS. So this is pretty serious. I called my provider&#8217;s help desk. Not that I expected any help. It&#8217;s just about that I call it because its there or not having a bad conscious not having called them for help. After 12 days without any sign of live from my provider, I called them today for a status query ..</p>
<p>After that call I decided to go for a master reset of my good old T630 phone. Obviously such a master reset will kill any data on that device. So how to export them? On Windows XP I used <a href="http://fma.sourceforge.net/index2.htm">FMA</a> which worked reasonably well and is free software. Ok but now I&#8217;m using a Mac..</p>
<p>After I while of searching the Internet for a Mac based tool I had the glorious idea to just let my Mac connect to my via phone via Bluetooth and see what will happen. So I did and voila , after having established a connection, a tool started up out of the blue. It was <a href="http://www.apple.com/support/isync/">iSync</a> which comes packaged with Leopard. And from there I lifted off and saved my phone&#8217;s address book on my back. Basically it all happens in seconds. So there it was, <em>the wow effect</em>. This is really a marvellous piece of work, this computer and it&#8217;s software. I love it.</p>
<p>As you might know, light and shadow are close friends. I&#8217;m still not able to do my master reset cause I have no clue about my phone&#8217;s <em>phone lock code</em>&#8230;.</p>
<p>Happy Hacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://workbench.haefelinger.it/archives/17/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
