All posts by admin

Binding to an Open Directory via Command Line

To add an OD via command line, you need to first bind to it using the command below.

$ dsconfigldap -v -a server.example.com

then use dscl to add the custom search path (CSP).

$ dscl /search append / CSPSearchPath /LDAv3/server.example.com

However, i am not too sure how exactly you would select the CSP after using dscl, but i think the below could work.

$ dscl -q localhost -change /Search SearchPolicy dsAttrTypeStandard:CSPSearchPath

Restart Directory Services after the changes are made.

$ sudo killall DirectoryServices

Setting or Resetting Hostname in OSX

There are 3 ways to do this. Some of which are for local service names within OSX. I suggest keeping them all in sync.

Edit the /etc/hostconfig file and change
HOSTNAME=-AUTOMATIC-
to
HOSTNAME=servername.example.com
sudo scutil --set HostName servername
sudo scutil –-set LocalHostName servername
systemsetup -setcomputername servername

Fixing broken PERL after a software update

Referenced from http://www.abstractwankery.com/.

So, I installed Apple’s Security Update 2009-001 yesterday, and tried to work on one of my Catalyst sites tonight. I got this fantastic error:

IO object version 1.22 does not match bootstrap parameter 1.23 at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/XSLoader.pm line 94. I head over to CPAN to update a few modules, and same error message with a stacktrace of doom. So, turns out, Apple distributed IO.bundle from way the hell back in 2005, which is what broke all of your other modules that you already updated if you use CPAN for anything at all. But hey, now CPAN is broken, so what now? You get to do a manual install, luckily, CPAN is an archive. Head over to the IO distribution over at CPAN, download the archive, and head into ye olde Terminal. Extract the archive if it hasn’t already, enter the directory, and execute:

perl Makefile.PL && make && sudo make install

Ding, everything works again. Write an angry letter to Apple.

Edit: You may find more crap that doesn’t work. For instance:

Weak references are not implemented in the version of perl at /Library/Perl/5.8.8/Catalyst.pm line 24 Well, just head into your now-functional CPAN and execute:

force install Scalar::Util

Bam, you made it spicy.