Tuesday, March 27, 2007

Solaris 9 - Change your hostname

Are you a student of or new to Solaris and all you want to do is change your hostname but can't find any help on the internets because everyone is always so cryptic on posting help? Well look no further. Just take a look below. I cat'd all the files that I have that are required to change the hostname. If /etc/nodename is missing, just create it. My hostname is "neptune". You can choose anything you want.

Note:
- I am in a Windows 2003 Server Active Directory environment and reserved the x.x.x.13 address ahead of time.

[root@neptune]# cat /etc/nodename
neptune
[root@neptune]# cat /etc/hostname.hme0
neptune
[root@neptune]# cat /etc/inet/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.1.13 neptune
[root@neptune]# cat /etc/net/ticlts/hosts
# RPC hosts
neptune neptune
[root@neptune]# cat /etc/net/ticots/hosts
# RPC hosts
neptune neptune
[root@neptune]# cat /etc/net/ticotsord/hosts
# RPC hosts
neptune neptune
[root@neptune]#

Reboot when you are done for changes to take effect.

Tuesday, March 20, 2007

Install Firefox 2.0 on Solaris 9

First, find it on the internets. Go to google and search for "firefox-2.0.0.2.en-US.solaris8-sparc-gtk1.tar.bz2". Or just click the link and download the file I have conveniently linked for you. Save it to your /home directory.

Next, do this:
# cd (get into your home directory - or wherever you have saved this file)
# tar xjv firefox-2.0.0.2.en-US.solaris8-sparc-gtk1.tar.bz2 (this should work but I just unbunzipped it on my fedora box, tarred it and then ftp'd it over to my Solaris box. So whatever works best for you).
# cp firefox-2.0.0.2.en-US.solaris8-sparc-gtk1.tar /usr/bin
# cd /usr/bin
# tar xvf firefox-2.0.0.2.en-US.solaris8-sparc-gtk1.tar (this will untar it in the /usr/bin directory)

Then just add /usr/bin/firefox to your path and you're all set.
# firefox &

Add a package in Solaris 9

Some things to try

1> Remove a package...
# pkgrm SUNWbzip

2> Check to see if a package is installed...
# pkginfo SUNWbzip

or

# pkginfo -l SUNWbzip

3> If a package is installed, see where it installed to...
# pkgchk -v SUNWbzip

4> Add a package from the Solaris 1 of 2 CD's...
# cd /cdrom/sol_9_905_sparc/s0/Solaris_9/Product
# pkgadd -d . SUNWbzip

5> Run through a few things...
# pkgrm SUNWbzip
# pkginfo -l SUNWbzip
# pkgchk -v SUNWbzip

# cd /cdrom/.../Products
# ls
# pkgadd -d . -s spool SUNWbzip (add this package as a spooled package only)
# ls -l /var/spool/pkg

# cd /
# pkgadd SUNWbzip (the package will add if it is located in /var/spool/pkg)
# pkginfo SUNWbzip (to see if it actually got installed)

Monday, March 19, 2007

Your Eye's "megapixel" Resolution

The average human retina has five million cone receptors on it. Since the cones are responsible for colour vision, you might suppose that this equates to a five megapixel equivilant for the human eye.

But there are also a hundred million rods that detect monochrome contrast, which plays an important role in the sharpness of the image you see. And even this 105MP is an underestimate because the eye is not a still camera.

You have two eyes (no kidding!) and they continually flick around to cover a much larger area than your field of view and the composite image is assembled in the brain - not unlike stitching together a panoramic photo. In good light, you can distinguish two fine lines if they are seperate by at least 0.6 arc-minutes (0.01.Degrees).

This gives an equivilant pixel size of 0.3 arc-minutes. If you take a conservative 120 degrees as your horizontal field of view and 60 degrees in the vertical plane, this translates to ...

576 megapixels of available image data.

Curiously - as a counterpoint to this - most people cannot distinguish the difference in quality between a 300dpi and a 150dpi photo when printed at 6x4", when viewed at normal viewing distances.

So: although the human eye and brain when combined can resolve massive amounts of data, for imaging purposes, 150dpi output is more than enough to provide adequate data for us to accept the result as photographic quality.

But don't forget that women have more cones and men have more rods - I kid you not.Therefore the ladies see colours brighter than gents but can't see as well when it gets dark.

Friday, March 16, 2007

This is my custom PS1 prompt for Solaris 10 UNIX

This is what I use for my root bash shell. There are many great tutorials out there, this isn't one of them. I'm just posting my own personal settings. If you have a better way, then by all means...

Change my default shell for root to bash
# usermod -s /bin/bash root

Create a .profile in roots home directory and add the following:
# ls -laih /.profile
(if none exists, then create it... If it does exist, then modify it)
# vi .profile
(add the line below)
export PS1="\e[0;34m[\u@\h]# \e[m"

The above line explained
\e[ <-- this starts the color scheme
0;34m <-- this says to color it blue
[\u@\h]# <-- this puts username@hostname, in brackets with the pound sign as the prompt
\e[m <-- this stops the color scheme

EDIT:
I almost forgot to add this:
List of Color codes
Color Code
Black 0;30
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33