Category Archives: Mac - Page 2

Check library information of a dylib file

There is a nifty command called “file” which will give you the architecture and type information about a library file.

file /usr/lib/libosg.3.0.1.dylib

Gives me the following information

libosg.3.0.1.dylib: Mach-O 64-bit dynamically linked shared library x86_64

This information is especially useful when searching for explanations to strange Xcode linker errors

Tested on OSX 10.6.8 and file v5.03

Linking sites to htdocs in Xampp OSX

I usually do not want to put my webprojects inside the htdocs directory in the default Xampp setup. Depending on the type of project I want them in different places. One simple way to run them from htdocs (localhost/projectname) is to make symbolic links to the projects in the htdocs folder. Here is how I did it:

1. Navigate to the htdocs folder in the Xampp package, normaly ‘/Applications/XAMPP/htdocs/
2. Run the command ‘ln -s <path to project>‘. Eg ‘ln -s /Users/niklas/NetBeansProjects/project1

This will create a symbolic link called ‘project1‘ in you htdocs directory pointing to the ‘/Users/niklas/NetBeansProjects/project1‘ directory.

Apache will, with the default settings, run the project as if it really was inside the htdocs directory. Just navigate to ‘http://localhost/project1‘ and enjoy the result

There are other ways to accomplish the same result but this it the solution I like the best

Taking screenshots in OSX

As a former windows geek I was a slave under the “print screen” button. On OSX things are a little different:

Take a screen shoot of the desktop:
This will put the screen shoot on your desktop in PNG format

Take a screen shoot of the desktop 2:
This will put the screen shoot into the clipboard

Define area for screen shoot:
This will turn your mouse pointer into a cross-hair. Us this to define an area on the screen. When you let go of the mouse button the screen shoot will be placed on the desktop as a PNG. If you want it on the clipboard instead just add the Control key

Take a screen shoot of a application window:
Command-Shift-4 + Spacebar
Your mouse pointer will now transform into a camera that will select whole windows. To take a picture of the selected window just press left mouse button and the picture will be placed on the desktop as a PNG. If you want it on the clipboard instead just add the Control key like this: Command-Control-Shift-4 + Spacebar

This was tested on OSX v10.6