Saturday, January 31, 2009

Config Postgres from binary packages on OpenSolaris

Download binary package from
http://www.postgresql.org/ftp/binary/

Choose package for solaris

Extract package

Open terminal

Point to package folder/bin

Check library link to initdb

#ldd initdb

if you see some line "Find not found", you can find it in /usr/lib

If in /usr/lib not contains that file, you can copy some file latest version back to version required

Initializing DB
#./initdb //data

using PgAdmin 3 login in to db, using current user you logged in.

Good luck!

VNC on Solaris

As Good A Place As Any


Tim Thomas's Blog






Script to Configure VNC Server in Solaris 10 5/08 and Solaris Express (Nevada)
07/09/08 06:07

I have been using a script for a while to configure VNC server displays for Solaris Express (Nevada) and I just found out that the same script works on Solaris 10 5/08 (Solaris 10 Update 5) as it includes Xvnc also.



I always do a full install of Solaris. If you don't, then maybe Xvnc will not be installed on your system. You can easily check:



# pkginfo | grep xvnc
system SUNWxvnc X11/VNC server



You run the below script once after OS installation is complete. It sets up two VNC displays and you connect to them with a VNC client as :1 and :2 . The second display is shared.



#!/bin/sh
#
# config_Xvnc_s10+snv.sh
#
# Run this script once after OS installation is completed.
#
# This has been tested with Solaris 10 5/08 and Solaris Express (Nevada) b87 onwards
#

#add vnc display 1
svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 addpropvalue options/server_args astring: '"SecurityTypes=None"'

#add vnc display 2, which is shared
svccfg -s application/x11/x11-server add display2
svccfg -s application/x11/x11-server:display2 addpg options application
svccfg -s application/x11/x11-server:display2 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"SecurityTypes=None"'
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"-alwaysshared"'

# Configure dtlogin to start it
if [ ! -d /etc/dt/config ] ; then
mkdir -p /etc/dt/config
fi
if [ ! -f /etc/dt/config/Xservers ] ; then
cp /usr/dt/config/Xservers /etc/dt/config/Xservers
fi

echo " :1 Local local_uid@none root /usr/X11/bin/Xserver :1" >> /etc/dt/config/Xservers
echo " :2 Local local_uid@none root /usr/X11/bin/Xserver :2" >> /etc/dt/config/Xservers

pkill -HUP dtlogin



#End



The displays persist when you disconnect the VNC client, so you can come back to a session at later time and all the windows and applications will be as you left them. Any jobs you kicked off will have continued to run.



You can get VNC client software from http://www.realvnc.com. There is a Free Edition and an enhanced Personal Edition for which you need a license.

VNC on OpenSolaris

VNC is really a good tool for sharing desktops to your remote peers.
The following is my personal experience with VNC on OpenSolaris. I am
running OpenSolaris build 86. It should be the same case in other
builds.


1.
Check the binaries I am using:

$ which vncserver

/usr/bin/vncserver

$ which vncviewer

/usr/bin/vncviewer


2.
I add a new user "vncuser" with "Basic Solaris User" privilege.
(This step is just my personal favor. But it helps you to have a clean
test environment.)

# users-admin


3.
Try the first run.

$ su - vncuser

$ vncserver


Some files will be created in $HOME/.vnc/ directory, including "xstartup".

Connect to the vncserver.

$ vncviewer localhost:1


A VNC desktop window appears.


4.
The default window manager seems not that good. Edit the file
"xstartup" to use JDS desktop. Comment all lines, and add
"gnome-session" to it.

$ cat xstartup

#!/bin/sh


#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

#xsetroot -solid grey

#vncconfig -iconic &

#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#twm &

gnome-session


5.
Run vncserver again. This time I specify more options to customize
it a bit. (Check manpage vncserver(1) for details of the options.)

$ vncserver :16 -alwaysshared -deferupdate 100 -geometry 1024x768 -depth 16


Run vncviewer:

$ vncviewer localhost:16


I then see a nice desktop window appears.


BTW, to kill the VNC servers that are run above, just type:

$ vncserver -kill :1

$ vncserver -kill :16

Show process list

Show processes list on OpenSolaris:

ps -ef