Category: OS X

The Apple (R) Operating System

OS X

PECL on OS X Mountain Lion: Quick and dirty

Yes, this is pretty simple, but I had to look around for too long to find a solution that didn’t involve homebrew or ports or (even worse) some kind of path manipulation to install PEAR/PECL to MAMP. (No, I do not want to set my bash_profile to use the MAMP PHP over the default. And no, I don’t want to recompile PHP – at least not today and at least not until I want to upgrade the version installed.) I just wanted to install pecl_http to run some tests, and I figured if I didn’t put my notes somewhere I would lose them. So here they are.

Before you begin, you need to have Xcode installed – get it from the app store.

Installing PEAR (which includes PECL) is pretty straight-forward (thanks to Jason McCreary at pureconcepts.net)

Two simple terminal commands, and some configuration:

curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

in the configuration prompt –
Type 1 and then Return
then type:
/usr/local/pear

Type 4 and then return and type
/usr/local/bin

Hit return and you are done (with the first part).

Verify pear with:
pear version

Now, before you run off and type sudo pecl install pecl_http you should know that it will fail, as autoconf is not yet installed. Thankfully, this is quite simple as well, (thanks to This question on serverfault.com)

Download the latest release http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz

Extract the files and do a normal ./configure; make; sudo make install;

Now you can
sudo pecl install pecl_http

OS X

Custom Parallels VM icons

I run a lot of VMs in Parallels. (Currently I am running 7, although not all at once, of course.) I end up with a bunch of red generic Parallels VM alias icons on my desktop. Which means that the usual visual quick clues (color, logos, etc) aren’t there and I have to look at the text underneath. Sometimes I am in a rush and start Windows Server 2008 instead of Windows 7 Pro, or Ubuntu Linux instead of Debian Linux (one is set up as a desktop and one as a server with no X).

I really wanted some custom icons for those VMs. My solution, (as usual) when it doesn’t exist make it. So, I opened pvs.icns (contained in the Parallels Desktop.app bundle /Applications/Parallels Desktop.app/Contents/Resources/pvs.icns) in Icon Composer.app, selected the 512 x 512 version and copied it to the clipboard. I then pasted that into a new Photoshop document and began editing. I saved each new version as a 512 x 512 pixel png and then dropped them in img2icns.app which converted them to the icns files I needed to customize my VM launchers.

icon_anim.gifBehold the glory:

They aren’t perfect, especially the Windows Server 2008, but they are different enough that it is easy to select the right VM in a heartbeat.

You can download the icns files from http://www.evardsson.com/files/parallels_icons.zip

OS X

SVN on OS X – /usr/bin or /usr/local/bin

I recently installed the openCollabNet OS X Universal binary for SVN 1.5.4 from Tigris and found something odd. I had installed the openCollabNet binary for 1.4.4 a while back, and don’t recall changing any install paths, but apparently something changed. After installing I ran svn –version and saw something that I shouldn’t have seen:

svn, version 1.4.4 (r25188)
compiled Sep 23 2007, 22:32:34

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

Strange, I should have seen the new 1.5.4 there. So I did a bit of digging. Everything I saw about the openCollabNet binary said it installed in /usr/local/bin, but when I ran which svn I saw /usr/bin/svn. So I looked in /usr/bin and /usr/local/bin. Sure enough, two installs in two different places. Not being one to do anything rash (like deleting svn from /usr/bin and then changing the path on all my tools that rely on it) I decided the best thing to do was fix it in a way that was reversible. So, I fired off a sudo ls (to get my password in scope in the shell) and then a simple

for i in `ls /usr/bin/svn*`; do mv /usr/bin/$i /usr/bin/$i.old && ln -sf /usr/local/bin/$i /usr/bin/$i; done

Once I had fired off that command another call to svn –version revealed the fix:

svn, version 1.5.4 (r33841)
compiled Oct 27 2008, 11:19:10

Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

I am still a little confused as to how 1.4.4 ended up in /usr/bin while 1.5.4 went to /usr/local/bin (where it is expected to go from the openCollabNet binary installer). I wondered, did I change the install path at some point in the install? Somehow I doubt it, as that is not a change I would be likely to make. Just another little mystery for the unsolved cases file.

Browsers

Minefield: I came, I saw, I couldn’t use it

I decided I would be brave and download Minefield (the latest “trunk build” from Firefox) and try it out. I have been reading several reviews about how fast it is, and wanted to see for myself.

I was not, however, able to use it at all. First, my current setup. I am running OS X 10.5 on a 17″ MBP with 4GB RAM. (I have the older mobo however, and the system only actually uses 3GB.) I also have Parallels 3.0 installed with a Windows XP VM (this is important) and two Linux VMs (a Gentoo server and an Ubuntu desktop).

When attempting to start Minefield on OS X (Parallels not running), as Minefield starts Parallels attempts to start an installer on Win XP. The VM cannot be shut down until Minefield is shut down and the only way to do that is via Force Quit. Otherwise the installer continues to attempt to run on Win XP in Parallels. I did not download the Windows installer, nor did I wish to, however, there is something that is triggering a “Firefox Installer” on Win XP whenever Minefield attempts to open on OS X.

Needless to say, while Minefield will not start until it has finished “installing” on XP, and since it is trying (I guess) to install the OS X version on XP, I end up with a hung Minefield and an endless loop of Windows error messages (“The application Firefox Installer has performed and illegal operation etc etc”) followed by the “Firefox Installer” on Windows dying and respawning. Maybe I’ll try again in a week or two, since these are trunk builds and fixes and updates are coming in pretty regularly at this point.

OS X

Mail.app – Making the switch

It has been 10 days now that I have been using Mail.app rather than Thunderbird and I am ready to uninstall Thunderbird entirely. While I am still waiting for GPGMail for 10.5 to advance beyond the beta stage I can use it as is. I didn’t really notice any difference in startup times between Mail.app and Thunderbird, but I did notice that it was faster at sorting incoming mail by rules and especially at putting the junk mail where it belongs. Thunderbird first loads all the incoming into the inbox and then sorts out junk mail and applies the other sorting rules. With Mail.app I don’t end up waiting for the rules to run before I can start weeding through my mail. I think the biggest thing, though, is that using Mail.app gets me into a position where I can more easily use other tools like the address book and it will, no doubt, facilitate syncing with the iPhone (if I ever get around to taking it out of the box and activating it – but that’s another story for another time.)

OS X

Solved: Mail.app folder headaches

Well, I finally worked through the issues with Mail.app and mapping the Junk folder. I found the fix for it entirely accidentally – I was going through all the settings and found that changing the setting under Mail > Preferences > Junk Mail > When junk mail arrives from “Mark as junk mail, but leave it in the Inbox” to “Move to the Junk mail folder” was enough to restore the mapping for the Junk mail folder.

I also found that the Drafts folder didn’t exactly disappear, it just doesn’t show up when there are no drafts saved.

While GPGMail for 10.5 still incorrectly reports signatures as not being valid, it is still in beta and sure to improve. So, I guess the week of trying it on has begun.

Technorati Tags: ,

OS X

Trying Mail.app again (it’s so very trying)

I am trying out Mail.app again – to see if some the issues I had in the past have been corrected in Leopard. Somehow, it just doesn’t seem to work right. I installed GPGMail (which is still beta for Leopard) and mostly got that working, except that for every key in my GPGKeyring it says that the key is invalid and there is no signing date (they all work fine in Enigmail…). Also, I set Mail.app to use the Trash folder for trash and the Sent folder for sent items, the Drafts folder for drafts and the Junk folder for junk mail. Seemed straightforward. Until I shut down Mail.app and reopened it. The trash and sent mail were still correctly mapped, but the Drafts folder was gone and no matter what I tried the Junk folder would not map to junk mail. Thankfully I didn’t have anything in the Drafts folder at the time! What a pain! So any junk mail I get is marked as junk (but I mostly have to do it myself – I am used to Thunderbird catching the majority of the stuff that spamassassin didn’t mark) but it stays in the inbox. That’s because Mail.app doesn’t know that the Junk folder is the junk folder. Even after I tried again (and again, and again) with the Mailbox > Use Folder As > Junk.

If I can get Mail.app to properly map the Drafts and Junk folders again I will likely try it on for a full week or two and see how I feel about it. If I can’t get it over that hurdle, however, forget it.

Technorati Tags: , ,

Read More

OS X

Leopard – First Run

After waiting all this time for a multi-desktop environment I was excited to get and install my copy of 10.5 today. Even though it isn’t ready for some because of program incompatibilities (sorry, Ted) I hadn’t run across anything to make me think it wasn’t ready for my use. And in truth, there isn’t anything ‘wrong’ with Leopard. It just turns out that I hadn’t gotten the word that I would have to upgrade Parallels to build 5160 in order to use it on Leopard. And since I primarily want the multiple desktops (“Spaces”) to make it easier to run VMs that is in an issue. So, I am downloading the update now. Since it isn’t going to cost me anything to upgrade Parallels, that’s ok. For me, running a VM in full-screen mode while still having access to my Mac desktop is important. While I am at the desk I can do that by hooking up another monitor. When I’m not at the desk, though, that isn’t possible. What I sincerely hope is that I can run my guest OS fullscreen on one desktop while coding on another and browsing on another and wasting time (chatting and playing mindless puzzle games) on the fourth. This was my MO when I was working with VMWare on a Linux machine with XFCE. So, now I plan on doing the same on my Mac. After all, when was the last time a window manager for BSD didn’t have multiple desktops? (Ok, I know, OS X is more than a WM, but you get the drift.)

Technorati Tags: , ,

Apache

Apache 2.2.6, PHP 5.2.4 and MySQL 5.0.45 on OS X

I got tired of looking for a way to replace the Apache/PHP that Apple packages with OS X (without breaking anything else in the process) so I decided to install Apache 2.2 and PHP5 in their own location to avoid stepping on the Apple package toes.

Since I do a great deal of development again MySQL I needed to install that as well, and figured that I would probably need the GD functionality as well so I grabbed libjpeg and libpng to make those work as well. This is the step-by-step.

(Props to James Pelow and his article from last year, from which I borrowed the configure command lines and configuration modifications, as well as the idea of installing the whole mess in /apache2.)

Download the latest MySQL (I used the package version) from MySQL.

Installation is straightforward following the same methods as any other Mac installer.

Download and install libjpeg and libpng – from Ethan Tira-Thompson (this is also in a Mac installer which contains both libraries in one installer).

Download the latest Apache httpd server (Unix source) from Apache

in the terminal:

tar -xzvf httpd-2.2.6.tar.gz && cd httpd-2.2.6

./configure

--prefix=/apache2

--enable-module=most

--enable-shared=max

make

sudo make install

sudo mkdir /apache2/php

Download the latest PHP from PHP

tar -xzvf php-5.2.4.tar.gz && cd php-5.2.4

./configure

--prefix=/apache2/php

--with-zlib

--with-xml

--with-ldap=/usr

--enable-cli

--with-zlib-dir=/usr

--enable-exif

--enable-ftp

--enable-mbstring

--enable-mbregex

--enable-dbx

--enable-sockets

--with-iodbc=/usr

--with-curl=/usr

--with-mysql=/usr/local/mysql

--with-gd

--with-jpeg-dir=/usr/local

--with-png-dir=/usr/local
--with-apxs2=/apache2/bin/apxsmake

sudo make install

sudo cp php.ini-dist /apache2/php/lib/php.ini

Now to make your Apache2.2 a little more ‘Mac’ – you can point it at the Mac web shared files folder, change the user and group and change the location for user files to match the Mac folder system.

Edit httpd.conf (I use nano, you can use any flat text editor like nano, pico, vi, emacs or even BBedit)

sudo nano -w /apache2/conf/httpd.conf

The changes to httpd.conf I made:
I changed

User daemon
Group daemon

to

User www
Group www

and

DocumentRoot "/apache2/htdocs"

to

DocumentRoot "/Library/WebServer/Documents"

and

<Directory "/apache2/htdocs">

to

<Directory "/Library/WebServer/Documents">

and added

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html index.php

Edit httpd-userdir.conf

sudo nano -w /apache2/conf/extra/httpd-userdir.conf

The changes to httpd-userdir.conf I made:
I changed

UserDir public_html

to

UserDir Sites

To start and stop the server:
MySQL comes with a Preference Pane that allows you to start and stop it there. To start and stop Apache you need to first make sure that the default Apache shipped with OS X is stopped.

sudo /apache2/bin/apachectl start
sudo /apache2/bin/apachectl stop

I only ran into one issue, when trying to start the server I ran against the following error message (and no running server, of course):

httpd: Syntax error on line 53 of /apache2/conf/httpd.conf:
Cannot load /apache2/modules/libphp5.so into server:
Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /apache2/modules/libphp5.son  Reason: image not found

To fix this I did the following:

cd /usr/local/mysql/lib
sudo mkdir /usr/local/mysql/lib/mysql

for i in `ls ./l*`; do sudo ln -sf /usr/local/mysql/lib/$i /usr/local/mysql/lib/mysql/$i; done

This creates soft links in the directory that libphp5.so is looking for the MySQL libraries.

Then it started right up! Wheee! (I did a quick test by dropping PhpMyAdmin into the /Library/WebServer/Documents folder and browsed to it – the whole Apache/PHP/MySQL is working correctly)

Technorati Tags: , , ,

Read More

OS X

Aqua port of OpenOffice.org in alpha release

It has been a long time coming, but OpenOffice.org have moved a step closer to a native OS X port. The first development snapshot was released this morning. This is an alpha release, and they warn:

THESE BUILDS SHOULD BE USED AT YOUR OWN RISK FOR TESTING PURPOSES ONLY. THEY MAY CRASH OR CAUSE DATA LOSS.

As with any early development release there are lots of things that don’t work yet, such as printing, exporting to PDF, copy/paste, drang and drop, multiple monitors, etc. That’s to be expected. While I am a little tempted to run the alpha release and provide feedback to the development team, I don’t know that I actually have the time to devote to that sort of endeavor right now. Instead, I think I will jump on the first beta, and install it alongside the X11 version, so that I can chime in on testing at that stage.

For those who are interested, the Mac Porting team have blogs and a news section where you can keep up with development if you wish.

Technorati Tags: ,