A collection of computer systems and programming tips that you may find useful.
 
Brought to you by Craic Computing LLC, a bioinformatics consulting company.

Showing posts with label "Mac OS X". Show all posts
Showing posts with label "Mac OS X". Show all posts

Tuesday, February 22, 2011

Setting up PostgreSQL on Mac OS X 10.6

I needed to set up PostgreSQL on my Mac in order to troubleshoot a problem with a Rails application.

Here are the steps that I followed:

1: Using Homebrew, install and build PostgreSQL
Homebrew will give you commands to create a Launch Agent that starts the server on a reboot
$ brew install postgresql
$ cp /usr/local/Cellar/postgresql/9.0.3/org.postgresql.postgres.plist ~/Library/LaunchAgents
$ launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist


2: Setup PostgreSQL
You should look into setting administration user - I skipped that for my purposes
$ initdb /usr/local/var/postgres
The files belonging to this database system will be owned by user "jones".
This user must also own the server process.
[...]


3: Create a specific database and verify that it is running
$ createdb mydb
$ psql mydb
mydb-# select version();
mydb-# \h


4: Install the PostgreSQL ruby gem
You'll see different names for this gem - just use 'pg'. Using the ARCHFLAGS env variable is important. I did not need to specify the explicit path to the Homebrew installation of the PostgreSQL software.
$ env ARCHFLAGS="-arch x86_64" gem install pg



 

Wednesday, September 8, 2010

Mouse and Trackball Setup with MacPymol

I was having problems configuring a Kensington Expert Mouse Trackball to work correctly with the MacPymol protein modeling software on a Mac OS X 10.6.3 Intel Mac.

The Kensington mouse drivers (and specifically their MouseWorks software) has not been updated for several years and they are not supporting the trackball on Mac OS X Snow Leopard. But in fact the software works... MouseWorks is a 32bit version of a Preference Pane and so Preferences will have to shift to that version before you can interact with it.

But with just the trackball on that machine I was not able to configure the buttons correctly. That was the only mouse I had on that machine.

I noticed references in the MacPymol docs saying that the Apple Mighty Mouse with the little ball works well with the software. Even though I don't like that mouse, I did have one lying around so I plugged that it and configured it. With following setup it works as expected with MacPymol:

Left Button = Primary Button
Ball Button = Button 3
Right Button = Secondary Button

In 3-Button Viewing Mode this setup gives you Rotation on Left Button down and drag, Zoom on Right Button down and drag and XY translation on Ball Button down and drag.

Interestingly, once I had the Mighty Mouse setup like this, I could then get the Trackball working correctly. In Kensington MouseWOrks I have it set up as follows:
Left Lower button = Click
Right Lower Button = Right-Click
Left Upper Button = Middle-Click

MouseWorks knows about MacPymol (somehow) and you can setup MacPymol application settings - but I don't have this figured out. Unfortunately I'm not finding any more info in the MacPymol docs/wiki.

Hope this is useful


 

Archive of Tips