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

Disable system beep in Solaris 10

This is what I have found on the web. I use the first one.

Method1# /usr/openwin/bin/xset b 0

or

Method2# /usr/openwin/bin/xset b off

or

Method3# /usr/openwin/bin/xset -b

Thursday, March 15, 2007

Volume Management of a Floppy Disk in Solaris

In Windows, you pop a floppy in the drive and just use it. Sometimes you do a quick format and maybe once or twice in a lifetime you do a long format. And besides all that, who still uses floppies anyway? Well, that doesn't matter for now. It's the principle that we care about. So onward...

Insert the floppy into the drive (make sure you set the tab on it to be writable). Then run through the following:

First, you need to mount the floppy
# volcheck

Then you need to see if the system see's the floppy
# cd /floppy/floppy0

If all goes well, you should see something like "unnamed". That's because you have a dos formatted 1.44" floppy disk that has the name "unnamed". Check it to see if anything is on it.
# ls -l /floppy/unnamed

If you see some contents there, then everything is working so far. Now you might want to format the disk. First you have to unmount it.
# eject floppy

This might seem kinda weird to Windows users. When we think of "eject" we think of the floppy physically leaving the machine and therefore wouldn't be readable. But in Solaris, eject simply means to remove the file system from the device. More about that later. But for now, let's format it.
# fdformat -b MyDisk -t dos /vol/dev/rdiskette0/nomedia

So essentially I am saying to create a new dos (pcfs) file system on this disk (fdformat -t dos). It will wipe out any data that is already there. I am also telling it to give it the name "MyDisk". We choose the raw device to format and on we go. After you run the above command and hit enter, then enter again to accept, it should finish.

The vold daemon runs around making this all happen. So if this process is corrupt or something, then you might need to reboot. But if it's working, then you can stop and start volmgt. This isn't necessary,.. I am just saying to do it for good measure.
# /etc/init.d/volmgt stop
# /etc/init.d/volmgt start

Now to remount that floppy
# volcheck

Now let's see if our format worked.
# cd /floppy

Is anything there? You should see the "mydisk" item there now. If so, check it's contents. There should be no contents in it. Try creating some files in it.
# cd /floppy/mydisk
# touch file1 file2 file3 file4
# ls -l /floppy/mydisk

And that's about it. These concepts also apply to cdroms and zip drives and other things. Although it's done differently. CD roms are automatically mounted for instance. I'll probably write up a simple practice tutorial on usb drives and cdroms in a few days.

Thursday, March 8, 2007

General Linux Directory Structure and Sys Admin

Linux file hierarchy:

/bin - common binaries
/sbin - Binaries used for system administration are placed here.
/boot - static files of the boot loader. Usually it contain the Linux kernel, Grub boot loader files and so on.
/dev - device files such as your CD drive, hard disk, and any other physical device. (In Linux/Unix, the common premise is that everything is a file).
/home - user home directories are found here. In unices like FreeBSD, the home directories are found in /usr/home. And in Solaris it is in /export. So quite a big difference here.
/lib - Essential shared libraries and kernel modules
/mnt - temporary mount point useful for when you insert your USB stick and it gets mounted under /mnt. Though in Ubuntu and the likes, it is usually mounted under /media.
/var - variable data, such as logs, news, mail spool files and so on which is constantly being modified by various programs running on your system.
/tmp - temporary files are placed here by default.
/usr - the secondary hierarchy which contain its own bin and sbin sub-directories.
/etc - Usually contain the configuration files for all the programs that run on your Linux/Unix system.
/opt - Third party application packages which does not conform to the standard Linux file hierarchy can be installed here.
/srv - Contains data for services provided by the system.
/proc - And of course there is the directory which does not actually reside on the disk.

And some links:
link: http://www.goitexpert.com/entry.cfm?entry=A-guide-to-Linux-directory-structure--Part-One
link: http://www.itweek.co.uk/personal-computer-world/features/2184995/linux-disaster-recovery

How the vi editor would seem if it has been made by Microsoft

Click on the image below to see it bigger...

Change display resolution in Solaris UNIX

Do something like this:
# m64config -depth 24 -res 1024x768x75

Be sure to consult the man page for "m64config"

Wednesday, March 7, 2007

Solaris 9 UNIX system won't boot

So today I troubleshooted my very first real live UNIX disaster. Luckily this is on the machine I am learning on so no big deal. But I finally got to apply what I learned for the first time in a real life situation.

First off, a couple links that really helped me out.
Link #1: How to change the default boot device
http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5oa?a=view

Link #2: Booting problems in Solaris
http://www.adminschoice.com/docs/booting__problems_in_solaris.htm#%22The%20file%20just%20loaded%20does%20not%20appear%20to%20be%20executable.

I wish I could thank whoever wrote those pages. But for now, here's what happened.

One morning, I came in and the screen displayed this:
"Timeout waiting for ARP/RARP packet"

I am still new to UNIX (been taking classes for only about 6 months so far) so I wasn't sure what that meant. So how to fix it? Well, just like in Windows, power off the machine and power it back up. Right? LOL. Well normally wrong but this time I got lucky. It booted and away I went.

Then this morning, same thing happened. And coincidentally, it all happened at the same time I started learning about file systems and formatting and whatnot. Maybe I mucked something? Well either way, I finally figured out how to fix it.

1> While it repeats that ARP message thing, press [stop]+[a] on the keyboard. This gets you to the OK prompt.
2> Then I type "printenv" from the OK prompt. I see a list of things with settings. There are 3 things that should be set like this:

boot-device disk
mfg-switch? false
diag-switch? false

I first noticed that "boot-device" was set to "disk net". So somewhere along the line that got changed. Was my machine hacked perhaps? Who knows. Also, "diag-switch?" was set to true. So I changed these items to their correct options like so...

OK setenv boot-device disk
OK setenv diag-switch? false

And then typed "reset" to reboot the machine and take the settings.

OK reset

And whaddya know? The machine begins to boot! Hooray. Somehow, someway, I must've fubarred the boot block. So that was part of the problem. Another part of the problem is that I managed to get it connected on the network but I'm not real good with that yet so it's possible that it got hacked. Or maybe I am just paranoid? Either way, after "correcting" all the block parameters, it's not fixed and I'm back in actioon. Hooray!

Outlook 2003 - Contacts Not Showing in Address Book

Subject: Outlook 2003 - Contacts Not Showing in Address Book

Outlook 2003 - Contacts Do Not Work as Email Address Book

The Contacts Database in Outlook has replaced the Personal Address Book as the
preferred place to store custom email addresses. But sometimes it is not
enabled and doesn't work (or show) as an email address book.

Enabling Contacts Database As An Email Address Book in Outlook 2003

1. click on 'Tools' menu then 'Email Accounts' option - see dialog.
2. click on the 'View or change existing directories or address books' option.
3. click 'Next'.
4. click on the 'Add' button then 'Additional Address Books' option.
5. click 'Next'.
6. click on the 'Outlook Address Book' option.
7. click 'Next'.
8. click on 'Finish' button.

9. click on the 'Contacts' tab - see contacts database.
10. right-click on the 'Contacts' option on the left-hand side (under 'My
Contacts').
11. click on the 'Properties' option - see multi-tabbed dialog.
12. click on the 'Outlook Address Book' tab.
13. ensure that the 'Show this folder as an e-mail address book' option is
selected.
14. click OK.

Your Contacts database should now be active as an e-mail address book.