Installing PostgreSQL with PostgreSQL Tools for MacOS X

April 22nd, 2008

Mr. Dru made PostgreSQL server installation to OS X super EASY, Painless, and Simple.

no readline installation, no Fink port installation, no command line business!

Just simply download package from PostgreSQL for Mac.

Double click the dmg (at the time of writing postgresql_831.dmg was the current version).

Open the “Server” folder and double click “PostgreSQL 8.3.1″ to start installation.

This will install the followings:

1. Handy utilities such as start/stop server will be installed to Applications >> PostgreSQL

2. Server and the rest will be installed to Macintosh HD >> Library >> PostgreSQL8

Now, most of the time, that is all you need!!!

I personally recommend to download pgAdmin3 as client.

Of course, some will experience problem. I installed 3 times and had problem with last installation and here are the some helpful tip to resolve the problem.

Q. This installation creates new user postgres. What is the password for postgres?

password for postgres is required for some operation. Go to System Preference >> Account >> overwrite current passoword.

Q. I want to perform above but postgres user is not visible in System Pref >> Account. Can I make it visible?

1. Start NetInfo Manager (Applications >> utilities)

2.  menu “Domain” >> Open >> type “localhost” in domain text field

3. Click the lock icon to unlock it (will ask you admin pswd)

4. go to users >>  select postgres then change the Shell to /bin/bash

5. now the account should be visible!

Q. I want this postgres account to be invislbe but like to perform task as postgres without password. Is it possible?

Befure you “su - postgres”, use “sudo bash” so you will be root, then “su - postgres” will not ask you a password.

Q. data folder (/Library/PostgreSQL8/data) is empty and giving me an error.

Due to permission issue, this operation could fail during the installation. You just need toinit the db with following command:

su -m postgres -c ‘/Library/PostgreSQL8/bin/initdb -D /Library/PostgreSQL8/data’

Firefox 3

March 14th, 2008

I just installed Firefox 3 (version 3.0b4). As people praise, this is sexy browser!

After updated to FF3 the current version of Firebug was not compatible with FF3….

Don’t worry, firebug team know developer cannot resist to update to FF3 and at the same time they cannot live without Firebug.  Firebug 1.1 beta can be downloaded from here and this perfectly work with FF3 so far.

So far, I have encountered one issue.

When I try to access to our development FTP server, which has self generated certificate, via FF3 it game me error code: sec_error_untrusted_issuer and did not give an option to make exception. It seems that this bug has been reported/resolved already and should be in the next build.

The speed increase is very significant to me.

When you go gmail there is a message says “Firebug is known to make Gmail slow unless it is configured correctly.” but this doesn’t seems to be true with FF3.

Before you build your first AIR application…

March 1st, 2008

As soon as I finish installing AIR via APTANA Studio I attempt to create my first project. I clicked “Create a new Adobe AIR Project” from Aptana home but I decided to do some reading because there were options that I need to choose which I had no idea about….I assume you have installed SDK.

  1. Inside SDK: Inside the SDK folder there is a “bin” folder. Inside of the there are 2 files, ADL and ADT. 
    1. ADL (AIR Debug Launcher): to test the application.
    2. ADT (AIR Development Tool): to build a distributable package of application
  2. Rendering Engine: The rendering engine is Webkit. What it means to you is that you don’t have to worry about browser compatibility and you don’t have to talk bad about IE anymore.
  3. Reading:
    1. Developing AIR application with HTML and Ajax
    2. Christmas in the AIR by Jonathan Snook (quick way to get first app running!)
    3. Free book published from O’Reilly

Installing Adobe Air on OS X via Aptana

February 24th, 2008

I have MacBook Pro.Version of OS is 10.4.11.I installed Aptana about a month ago.This is a beautiful and simple IDE. Click Home icon to show Aptana start page (shown below).There will be link to everything you need.aptana1.tiff 

  1. Download and install Adobe AIR runtime. You can also download AIR runtime from Adobe Labs. At the time of writting, the latest versionf was air_b3_mac_121207.dmg. 
    1. Double click Adobe AIR Installer\
    2. Clicking “I Agree” will start installing runtime and that’s it!
  2. Download and install Adobe AIR SDK Beta. At the time of writting, the latest versionf was air_b3_mac_sdk_121207.dmg.
    1. Extract the contents of SDK
    2. Create a folder (ex: /Users/<UserName>/Applications/AIRSDK) and copy all the contents of SDK to the folder.
  3. Download and install the Aptana plugin for Adobe AIR Support.  
    1. Click step 3 from Aptana Home page Plugins Adobe Air.
    2. Follow the installation wizard.
    3. When installation is completed it will prompt you to restart Aptana. Restart Aptana.
    4. After Aptana restarted, Home Page got slightly changed (aptana2.tiff)…. Oh wow! As in new instruction #2 there is a new menu “Install Adobe AIR Runtime” under “Help” menu!
  4. Install Adobe AIR Runtime. Aptana IDE “Help” menu -> “Install Adobe AIR Runtime”
    1. Click “Agree”
    2. Runtime1
    3. Installing
    4. runtime2.tiff
    5. Done!
    6.  runtime3.tiff
  5. This was SO EASY and beautiful! If you are to install without using Aptana then you will have to set Environment variable etc… OK! I am ready to go sleep. Tomorrow, I will try to build my first Adobe Air Project.

XML 1.0 unrecognized character

February 6th, 2008

I build report module which generate xml and xslt. It has been working with no errors for quite a while.

However I got report that this was generating error. So I ran the problem report… Indeed… it generated invalid xml. How can it be!

After the investigation, I find out that client’s data contains a vertical tab - ASCII decimal character code 11. So I removed the character from data. Client data also contained form feed character which was also unrecognized character…

I google it immediately.

According to http://www.xom.nu/apidocs/nu/xom/Text.htm,

“characters such as the form feed, null, vertical tab, unmatched halves of surrogate pairs, and 0xFFFE and 0xFFFF are not allowed.”

also, http://www.stylusstudio.com/api/jdom10/org/jdom/Verifier.htm says, according to XML 1.0 specification,

“The C0 controls (e.g. null, vertical tab, formfeed, etc.) are specifically excluded except for carriage return, linefeed, and the horizontal tab. Surrogates are also excluded. ”

I learn things everyday.

WordPress - Auto generated link doesn’t work!?

February 3rd, 2008

After installing WordPress, I was able to post and add pages. It was very pleasure experience until I realized that almost any auto-generated link were taking me to index.html which contains Google Ajax Search API info: I was so confused as to why this page was there. I did not want to remove cause I thought there were there for a good reasons. But I was wrong. I have created this blog directory which I have installed WordPress long time ago and I had this index.html… Deleting this file fixed all the problems. Oh well, I learned my lesson.

WordPress - Installation

February 2nd, 2008

Oh wow… it was really easy to install. Literary five minutes as they claim.

  1. Download WordPress. At the time of writing, 2.3.2 is the latest version.
  2. Created new database with MySQL. My database name is simply called “blog”
  3. Rename the wp-config-sample.php file to wp-config.php and edit necessary parameters. The comments in the config file is precise enough that you cannot make mistake!
  4. Place the WordPress files in the desired location on your web server. I have created folder called “blog” and copied all the contents of WordPress folder.
  5. Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.

and that was it! This just works!