Thursday, June 30, 2005

Running Processes Info

prstat -t <-- combined by user
prstat -s rss <-- the largest ones first

vi Editor Commands

0 <-- go to the beginning of the line
$ <-- go to the end of the line
ZZ <-- save and quit

Two ways to show patch info

showrev -a <- is a binary, so outputs faster
patchadd -p <- script

Wednesday, June 29, 2005

Backup Utility

rsync is a great backup utility. It can be used to do inceremental and full backups. http://rsync.samba.org has sample shell scripts that will do backups. rsync has a flag to do incremental backups over an SSH tunnel - saves bandwidth and is secure.

List Files of a Package

pkgchk -v SUNWmozilla <-- will list all the files of SUNWmozilla package just like `rpm -ql mozilla` command.

What Package does the File Belong to?

pkgchk -l -p /usr/bin/ls
-l <-- list info
-p <-- path to file

The equivalent of `rpm -qf /path/to/file` to learn what package owns a file.

Tuesday, June 28, 2005

`locate` Utility for SPARC

After installing pkg-get from blastwave.org, download and install findutils:
pkg-get -i findutils
Now, I can use `glocate` and `gupdatedb` commands.

SPARC - changing resolution

/usr/sbin/m64config -prconf <-- prints out current resolution and supported modes.
/usr/sbin/m64config -res 1024x768x85 <-- changes current resolution to the one specified if supported.

Monday, June 27, 2005

Booting From a CD on SPARC

Trying to boot from a CD, I was getting this error:
Can't open boot device
Followed this procedure:
1. Rebooted with Stop+a and got "ok" prompt
2. show-disks command and picked option a) for cdrom
3. nvalias cdrom ^Y (hit Ctrl+y) and appended 3,0:f at the end, which identifies the cdrom as a slave device on the secondary IDE port.
4. reset-all <- at this point the machine reboots.
5. Stop+a and use "boot cdrom" to boot SPARC installer.

Configure CDE Key Bindings

Copy the file from /usr/dt/config/C/sys.dtwmrc to ~/.dt/dtwmrc
Edit the file. I had to change from Alt to Ctrl, since only right Alt worked.

Using cdrw to Create CDs

cdrw -C -i cdimage.iso
-C is important, since it tells cdrw to use the actual CD size, which can be 80 min but not the default 74 min. I was getting an error that iso image was too large while burning Solaris Express CDs until I used the -C option.
cdrw -l will list the burning device.

Saturday, June 25, 2005

Single User Mode from CD - delete root passwd

1. Stop-A
2. Insert the CD and type at the prompt:
boot cdrom -s
3. mount the hd:
mount /dev/dsk/c0t0d0s0 /a
4. set the terminal type:
export TERM=vt100
5. vi /a/etc/shadow
delete root's encrypted password string
6. unmount /a and init 6

Proper Way to Shutdown Solaris 10

shutdown -i5 -g60 -y
-i5 = init 5
-g = grace period 60 sec
-y = confirm shutdown

$SHELL for root

In Solaris 10, I can change the shell for root from /sbin/sh to /bin/bash:
usermod -s /bin/bash root
It will not cause any issues if I cannot log into /bin/bash for some reason. I will be automatically thrown into /sbin/sh then.
Using /bin/bash turns on autocomplete for commands and lists my previous commands with upper arrow key. Nice!
* still better to do "exec /usr/bin/bash" in .profile

Solaris 10 stty erase for root

Put the following in .profile:
stty erase ^H
Make sure that ^H is the result of Ctrl+V+Backspace

Flash Archive for Solaris 10

Solaris 10 has an awesome utility called Flash Archive. It is a cloning program that allows me to create either full or differential images of systems. I can do a complete backup of my system with it. I use "flarcreate" command and put my image on a mounted NFS share. Later, when I need to reclone, I boot from Solaris Express install CD and point to the NFS share. Here is Sun's manual:
http://docs.sun.com/app/docs/doc/817-5668

Solaris 10 Links

Solaris has some cool web sites:
http://www.cuddletech.com/blog/ <-- This is an awesome blog. I've been learning a ton from just reading through it.
http://www.blastwave.org <-- These guys offer a ton of Linux tools, and they are super easy to install with their pkg-get utility. You configure the sources just like in apt-get, yum or jigdo and then type pkg-get -i mplayer to install mplayer.
http://www.sunfreeware.com <-- Haven't tried this web site yet, but it looks quite handy.