Rails + PostgreSQL on OSX

Posted by markm Thu, 04 Sep 2008 21:39:00 GMT

I was not able to find simple instructions to get PostgreSQL onto OSX and working with rails. So here is a simple way…

First grab the binary installer from the fine folks at EnterpriseDB .

Then you just need to toss on the ruby gem using:

sudo gem install postgres -- --with-pgsql-include=/Library/PostgreSQL/8.3/include/ --with-pgsql-lib=/Library/PostgreSQL/8.3/lib/

That is it, you should be good to go.

 

– BONUS: Sphinx with PostgreSQL –

Why not a little bonus! Since searching is something you probably want to do then you will need to install something like Sphinx - so if Sphinx is your choice here is the way to get it going. First download the source code and unzip it. From the folder run:

./configure --without-mysql --with-pgsql --with-pgsql-includes=/Library/PostgreSQL/8.3/include/ --with-pgsql-libs=/Library/PostgreSQL/8.3/lib/ make sudo make install

With that done we just need to configure rails. But for info on that you are better off going to railscasts.

Tips to lengthen your iPhone battery life.

Posted by markm Mon, 01 Sep 2008 23:44:00 GMT

One of my friends was complaining to me about the fact he needs to charge his iPhone nightly. Apparently his old "WinMo" device would last at least two days.

Like I told him, the first thing to keep in mind is that he uses his iPhone much more than his old HTC - you probably do too. If you use the device more, the battery is going to be consumed much quicker. Also, your old phone was probably an Edge device - Edge consumes much less battery power.

That being said, here are some tips to get at least two days off of a charge:

  • If you have an unlimited data plan, turn off WiFi. Doing this by itself doubles the battery life on my iPhone. It is that simple.
  • Unless you need it, turn off Push email. Push will keep a persistent connection open which means you are pretty much always moving some data around. That definitely hurts battery life.
  • If you are looking for that last little drop, force the phone into "Edge Only" mode by disabling 3G. This tip is useless though if you have WiFi enabled because WiFi consumes so much battery power that you won’t notice the benefits.

Personally, I get about two days with WiFi off and that is good enough for me (I will turn it on but only when I need it and immediately turn it off when I am done). I leave Push and 3G on.