Archive for the ‘Techie Stuff - Mac’ Category

Xprotect security OSX and Java

Tuesday, February 12th, 2013

I was curious about how Apple managed to quickly respond and disable Java after the CERT and SEI vulnerability warnings remotely. Some googling later, figured out that the Xprotect security mechanism in OSX Lion operates on this file which can be remotely updated by Apple - mine seems to have been on Feb 8, 2013.

/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist

Xprotect Meta Plist Lion

Interesting to see Flash listed in this same block list as well.

Installing ns2 (2.35) on Mac OSX Lion

Wednesday, January 30th, 2013

Turns out that installing ns2.35 on Mac OSX Lion 10.7.5 wasn’t as painful as other blogs said [Blog1][Blog2][Blog3]. [Blog1] and its comments presented useful information. So here is a quick summary of what I had to do (as of Jan 30, 2013).

1. Downloaded ns2 from sourceforge, untarred ns-allinone-2.35.tar.gz

[Here]

2. The standard install script and a modification recommended in one of the blogs [here] blew up in a whole lot of places.

In particular when the standard script is linking the files, it throws up:

Undefined symbols for architecture x86_64:

As recommended, the way to solve it is by installing tcl8.5.10, tk8.5.10, tclcl-1.20, otcl-1.14, and ns-2.35 in that order with 64-bit enabled. I guess the install script can be modified, but I don’t have time for that now.

3. To compile tcl8.5.11

Navigate to ns/tcl8.5.10/unix in the download, configure with 64-bit compilation enabled, make and make install


cd tcl8.5.10/unix
./configure --enable-framework --enable-64bit
make
make test
## you should pass all test.
sudo make install

4. To compile tk8.5.10

Navigate to tk8.5.10/unix in the download folder, configure with 64-bit compilation enabled, make and make install


cd tk8.5.10/unix
./configure --enable-framework --enable-64bit
make
sudo make install

5. To compile otcl-1.14

Navigate into the otcl-1.14 directory, configure, move a couple headers to an alternate location, make


cd otcl-1.14/
./configure --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10
cp tcl8.5.10/unix/*.h tcl8.5.10/generic/
make

If you tried make without copying the headers above, you will get error: tclUnixPort.h: No such file or directory and then Make goes beserk.

6. To compile tclcl-1.20

Navigate to tclcl-1.20/, configure, make


cd tclcl-1.20
./configure --with-otcl=../otcl-1.14 --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10
make

7. To compile ns-2.35

Navigate to ns-2.35, configure, make, run validation tests


cd ns-2.35
./configure --with-otcl=../otcl-1.14 --with-tclcl=../tclcl-1.20 --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10
make

Note here that we are specifying absolute path for otcl-1.14 and tclcl-1.20 here; since tcl-8.5.10 & tk8.5.10 was installed in their default Library locations (make install), we do not need to specify the same. To learn more, type ./configure –help.

Now run validation, take a long break


./validate
##(Validation can take 1-30 hours to run.)

Finally, you will get this:


"validate overall report: all tests passed"

8. That’s it. ns2 is now installed on the Mac OSX Lion. Wasn’t painful at all. Some intelligent changes in the standard install script would make it a no-brainer.

 

Installing DBD::mysql on Mac OS X Lion

Wednesday, March 21st, 2012

I was trying to install the perl module DBD::mysql on Mac OS X Lion. I faced some hassles. Here are a couple of useful links (Thanks!). I had some peculiar problems of my own, so this post is a “note-to-self” for the next time :

http://blogs.perl.org/users/phillip_smith/2012/03/installing-dbdmysql-on-mac-os-x-107-lion.html

http://probably.co.uk/problems-installing-dbdmysql-on-os-x-snow-leopard.html

According to Joe Di Pol’s blog, OS X works slightly backwards to what most of us from Linux and Solaris backgrounds understand – compiled binaries look at a dynamic library, which in turns says where it is, rather than the traditional way of thinking which is to include a library search path in the compiled binary.


cpan[1]> install DBD::mysql

So, when it comes down to testing (make test), it fails.

# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/aalap/.cpan/build/DBD-mysql-4.020-9nL8LG/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/aalap/.cpan/build/DBD-mysql-4.020-9nL8LG/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib

There are two solutions:

  1. Symlinking ‘libmysqlclient.XX.dylib’ from ‘/usr/local/mysql/lib’ to ‘/usr/lib/’ (where XX is the version of the library that is available to link to).
  2. Run install_name_tool command, install DBD::mysql buillds

  3. sudo install_name_tool -id /usr/local/mysql-5.5.21-osx10.6-x86_64/lib


    otool -D `mdfind libmysqlclient.18.dylib`

Alas, it still failed for me. Building successfully doesn’t mean it is installed. CPAN performs make install only after make test. I had changed my root password. The Makefile expects “” (NULL) password. I had to pass a valid user and a valid password. Passing arguments to the Makefile to ensure that the tests run using a proper MySQL user (the Makefile defaults to the system user running the tests, if no other user is provided, which fails for me as that user doesn’t exist). After a few more turns I realized, it lacks permissions to place some files in /Library/Perl/5.12/darwin-thread-multi-2level/Bundle/DBD. I decided to use root and run sudo CPAN. The way to do it is:


cpan[2] o conf makepl_arg "--testuser=root --testpassword=Whatever_my_password_is"

Now run install DBD::mysql again

cpan[3] install DBD::mysql

Yoohoo..


Running make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bs
Installing /Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Installing /Library/Perl/5.12/darwin-thread-multi-2level/Bundle/DBD/mysql.pm
Installing /Library/Perl/5.12/darwin-thread-multi-2level/DBD/mysql.pm
Installing /Library/Perl/5.12/darwin-thread-multi-2level/DBD/mysql/GetInfo.pm
Installing /Library/Perl/5.12/darwin-thread-multi-2level/DBD/mysql/INSTALL.pod
Installing /usr/local/share/man/man3/Bundle::DBD::mysql.3pm
Installing /usr/local/share/man/man3/DBD::mysql.3pm
Installing /usr/local/share/man/man3/DBD::mysql::INSTALL.3pm
Appending installation info to /Library/Perl/Updates/5.12.3/darwin-thread-multi-2level/perllocal.pod
CAPTTOFU/DBD-mysql-4.020.tar.gz
/usr/bin/make install -- OK

All’s well that end’s well. Annoying errors had me stuck me for a while.