Posts Tagged Mac

PostgreSQL & Python on Mac

I’ve been playing with Django & MySQL for a while but for my next project I wanted to integrate it with a PostgreSQL database. Everything went well until I wanted to install Psycopg as my python adapter to PostgreSQL.

After a bit of blundering about here’s what it eventually took:

  • Download and install PostgreSQL one-click installer from http://www.postgresql.org/download/macosx. Remember to read the README file before actually running the installer.
  • Download the psycopg2 source from http://initd.org/pub/software/psycopg/.
  • Edit the setup.cfg file to provide a path to the pg_config executable. On my Mac it sits in /Library/PostgreSQL/8.4/bin/pg_config and is not by default on the PATH so if you don’t put it on the PATH or in this configuration file the next step will fail in a spectacular manner.
  • Run ‘sudo easy_install .‘ in the top level psycopg2 source directory.
  • Specify postgresql_psycopg2 when you configure Django’s database layer for your project.

Tags: , , ,

JPasskeep and Command-Q on Mac

I’ve released a new version of my long-running password keeper application: JPasskeep. This new release is now able to handle a Command-Q keystroke on the Mac, giving a user (i.e. me) an chance to save any updated entries. No more mousing around to close a window.

The actual mechanism to do this was to reflectively call Apple’s EAWT application classes to allow me to register the correct event listener. Hmm, run anywhere with java GUI apps.

You can download the cross-platform and mac DMG binaries from the project’s GitHub repository.

Tags: , , , , , ,

Using a Samsung TV as an external monitor

Here’s a weird bug. I connected my macbook pro to my Samsung widescreen TV – it was detected but I had to select 59.9 as the refresh rate (rather than then autodetected 60) otherwise the TV just sat there with a message that I was using an unsupported display setting. That’s fine but how to do this in clamshell mode as macs seem not to share monitor settings between dual monitor mode and clamshell mode (or for that matter a mac mini connected to the same TV)?
My solution was to turn on screen sharing and enable VNC access. Then I plugged the mac (in clamshell mode) into the TV and connected to it via VNC. I could then select a 59.9 refresh rate and the TV magically came to life. This only needed to be done the first time I connected the mac & TV together. Weird ….

Tags: , , ,