Thursday, September 19, 2013

Setup postgreSQL Virtualbox and connect from windows

TurnKey (http://www.turnkeylinux.org/) providing easy way to get a PostgreSQL instance up and running on your server or VM (VMware, VirtualBox, Xen, KVM) of choice in just a couple of minutes. It is designed to provide users with a pre-integrated, turn-key operating system environment that is carefully built from the ground up with the minimum components needed to run PostgreSQL with maximum usability, efficiency, and security.

Feature highlights
  • SSL support out of the box
  • PHPPgAdmin administration front-end for PostgreSQL
  • auto-updated daily with the latest security patches
  • easy to use configuration console and web management interface
  • minimal footprint - includes only minimum components needed
  • packaged as installable Live CD that runs on real machines and most types of virtual machines (e.g., VMWare, VirtualBox)
  • based on Ubuntu 8.04.2 Hardy LTS
  • PostGIS support
1. Download “Open Virtualization Format(OVF)” from TURNKEY site 

Unzip the downloaded file

2. Import the turnkey ovf file from Oracle VM VirtualBox. If you don’t have Oracle VM VirtualBox then you can download from Oracle site 

Select File menu and select "Import Apliance.."


Select downloaded turnkey ovf (Open Visualization Format) file

3. I got following error when I try to import , it might be the issue because of virtual box configuration or virtual box unsupported ( My version 4.2.0 r80737)

Error when importing 


Failed to import appliance E:\Software\postgresql\turnkey-postgresql-12.1-squeeze-amd64\turnkey-postgresql-12.1-squeeze-amd64.ovf.
Error reading "E:\Software\postgresql\turnkey-postgresql-12.1-squeeze-amd64\turnkey-postgresql-12.1-squeeze-amd64.ovf": unknown element "Config" under Item element, line 47.

Result Code: 	VBOX_E_FILE_ERROR (0x80BB0004)
Component: 	Appliance
Interface: 	IAppliance {3059cf9e-25c7-4f0b-9fa5-3c42e441670b}

I opened the “turnkey-postgresql-12.1-squeeze-amd64.ovf” and lines 47 indicate as follows.


 Line 47 at turnkey-postgresql-12.1-squeeze-amd64.ovf file


So I have removed that segment, it is related to USB Controller (EHCI). When I try to import again it threw following error.



Failed to import appliance E:\Software\postgresql\turnkey-postgresql-12.1-squeeze-amd64\turnkey-postgresql-12.1-squeeze-amd64.ovf.
The SHA1 digest of 'turnkey-postgresql-12.1-squeeze-amd64.ovf' does not match the one in 'turnkey-postgresql-12.1-squeeze-amd64.mf' (VERR_MANIFEST_DIGEST_MISMATCH).
Result Code: 	VBOX_E_FILE_ERROR (0x80BB0004)
Component: 	Appliance
Interface: 	IAppliance {3059cf9e-25c7-4f0b-9fa5-3c42e441670b}

It is because , "manifest" (.mf) file has the SHA1 checksums and since we remove segment from “turnkey-postgresql-12.1-squeeze-amd64.ovf” it is not matched. So I have simply removed “turnkey-postgresql-12.1-squeeze-amd64.mf” file from ovf folder and tried again , it worked fine.

Select the "Reinitialize the MAC address of all network cards" if you have more than one instance in VBox


4. Run the imported instance from Oracle VBox, It direct to postgre installation and configuration wizard.

Provide root password for TurnKey Linux

Provide DBA password for Postgres DB server


You can Skip this step , Press "Tab" to jump from to


Press Enter to


Default Network Configurations , you can change in if require


Advance Menu


Default admin postgres username is “postgres” , password which you provided in above step

5. I have changed the network configarion to “Host-Only” in VBox because for my case I only need to access the database from my Windows. 

If you select "Host-Only" then connect can be make from your Host PC only

6. Setup the database connection from Windows host PC.6. Setup the database connection from Windows host PC.

Connection testing from Host PC

pgAdmin tool is GUI based tool you can download from here http://www.pgadmin.org/ to connect to VBox postgres DB.

Connection properties in pgAdmin tool to connect VBox postgres DB

Connection properties in pgAdmin tool to connect VBox postgres DB

7. Done !


Tuesday, September 10, 2013

How to change the appearance of Eclipse in Linux

Default fonts size of Eclipse editor , Tab , Menu and other text comes with large. To changes the appearance

1. To change the tab spaces and hight

 ECLIPSE_HOME/plugins/org.eclipse.platform_4.2.0.v201206081400/css/e4_default_gtk.css

.MPartStack {         font-size: 9;         font-family: "Droid Sans";         swt-simple: false;         swt-mru-visible: false; }


2. To change Editor text size and style

Eclipse -> Preference






3. To change Windows , Menu and other negotiations

Somewhere on your home directory, create a gtkrc file (like: ~/.gtkrc-eclipse) with following content:

style "eclipse" {         font_name="Sans Condensed 8"         GtkButton::default_border={0,0,0,0}         GtkButton::default_outside_border={0,0,0,0}         GtkButtonBox::child_min_width=0         GtkButtonBox::child_min_heigth=0         GtkButtonBox::child_internal_pad_x=0         GtkButtonBox::child_internal_pad_y=0         GtkMenuItem::horizontal-padding=0         GtkToolbar::internal-padding=0         GtkToolbar::space-size=0         GtkOptionMenu::indicator_size=0         GtkOptionMenu::indicator_spacing=0         GtkPaned::handle_size=0         GtkRange::trough_border=0         GtkRange::stepper_spacing=0         GtkScale::value_spacing=0         GtkScrolledWindow::scrollbar_spacing=0         GtkExpander::expander-size=0         GtkExpander::expander_spacing=0         GtkTreeView::vertical-separator=0         GtkTreeView::horizontal-separator=0         GtkTreeView::expander-size=0         GtkTreeView::fixed-height-mode=TRUE         GtkWidget::focus_padding=0 } class "GtkWidget" style "eclipse"
Finally, to launch eclipse, use following command line:
GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/user/.gtkrc-eclipse '/opt/eclipse-3.3/eclipse'


or, for a desktop icon:
env GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/user/.gtkrc-eclipse '/opt/eclipse-3.3/eclipse'
Ref : http://techtavern.wordpress.com/2008/09/24/smaller-font-sizes-for-eclipse-on-linux/
http://hwellmann.blogspot.sg/2012/06/fixing-editor-tab-fonts-in-eclipse-juno.html