Tuesday, March 20, 2007

Connecting PostgreSQL 8.1 & ColdFusion MX 7

So far ColdFusion does not have a default driver to connect to a PostgreSQL Database. However you can manually create a connection using a JDBC driver.

  1. Download the JDBC driver http://jdbc.postgresql.org/
    You need to know what is your JDK version so that you can select the proper driver. To check your JDK version open Terminal and type:

    java --version

    In my case I have "1.4.2", therefore I downloaded JDBC 3 for PostgreSQL 8.1
  2. Copy the driver (jar file) to your coldfusion location at:

    [cf root folder]/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib

    in my case this was:
    /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib

  3. Restart ColdFusion:
    cd into /opt/jrun4/bin/ and type:

    ./jrun -restart

    NOTE: for some reason when I execute this command it my system won't complete the restart process so I had to do a Stop and Start like ./jrun -stop and then ./jrun -start

  4. Now go to your ColdFusion admin add a new Data Source of type "Other"
  5. Enter your JDBC URL as: jdbc:postgresql://localhost/[your database name]
  6. Set Driver Class and Driver Name as: org.postgresql.Driver
  7. Enter the user name and password.
    Note: You can use your "postgres" user account. I have instead created a specific account for coldfusion, you can create users through pgAdmin.
  8. Submit. You should get an "ok" in the status.

Saturday, March 3, 2007

auto915Resolution - Ubuntu Resolution fix for Intel chipset 8x-945

If you have an Intel Chipset 8x - 945 series you will have some trouble setting your resolution in Ubuntu.
Theres is a tool, made by Steve Tomljenovic, called 915Resolution that will fix this problem. However you will have to run this tool every time you restart or logoff from Ubuntu because these changes are only temporary. To avoid this you need to create a startup script that will run before the X server starts. So I have written a small script that will automate this process for you that I called auto915resolution.

The script will automatically install 915resolution and will create the startup script for you.

Below is a sample run of the script that will serve as a guide on how to use it and will give you an idea of how it works.

  1. Download auto915Resolution
  2. Extract the file to your home folder (i.e. /home/[your user name]/
  3. Run terminal.
  4. Login as root (you must be logged in as root to create the startup script)
  5. Navigate to that folder. In my case my home folder is "rolando", replace it with your folder name.

    # cd /home/rolando/auto915Resolution/
  6. Run the script. (notice the dot before the forward slash)

    # ./auto915resolution.sh
  7. When you get the prompt to install 915resolution fix enter 'Y'. If you have 915resolution already installed you can choose not to install it.
  8. A list of all available resolutions ( Modes ) will be displayed followed by a prompt to enter the "Mode" you want to replace with you desired screen resolution. (You might have to maximize the terminal window to see the entire list)
    At the top of the list you will see your chipset info. In my case I have a 915GM.

    Example:
    Chipset: 915GM
    BIOS: TYPE 1
    Mode Table Offset: $C0000 + $269
    Mode Table Entries: 36

  9. Enter the "Mode" number you want to replace. You should replace your default resolution. In my case my default resolution was 1024x768 in mode 34.

    # 34
  10. A prompt to enter your desired resolution will be displayed. Enter your horizontal resolution followed by a space and then your vertical resolution. For example for a resolution of "1280x800" enter "1280 800".

    # 1280 800

  11. A prompt for your maximum color depth (in bits) will be displayed. Options are 8, 16, 24 and 32. Most monitors should be able to handle 24, so if you're not sure enter:

    # 24

  12. The resolution (Mode) list is refreshed and the Mode you chose should now be replaced with the new resolution and color depth.
    A prompt to create the startup script will be displayed. You should enter 'y' in here if you see that your changes were applied correctly in the list.
  13. If you entered 'y', then you should see this output:

    Creating startup script...
    The startup script has been created! Please restart for changes to take effect.

  14. Restart your computer.