Monday, April 6, 2009

Solaris: SunRay Error Codes

Here are the error codes for the SunRay devices

http://www.filibeto.org/sun/sunray-users/lib/sunsolve/77966.html

Enjoy! (Thanks Chris!)

Tuesday, March 31, 2009

MAC OS X: Create an ISO from CD/DVD (and mount it)

Run this command to create an ISO image from a physical CD/DVD:

# for i in `drutil status | grep dev | awk '{print $4}'`
> do diskutil unmountDisk $i
> dd if=${i} of=/Users/username/Desktop/thecdname.iso bs=2048
> done

Mount it
mount /Users/username/Desktop/thecdname.iso -t iso9660 -o ro,loop /mnt/

Enjoy!

MAC OS X: Creating an ISO file from a directory ...

Here is the command to create an iso file from a directory on your Mac OS X system:

hdiutil makehybrid -o ~/image.iso ~/directory -iso -joliet

Enjoy!

Friday, March 27, 2009

Solaris: Mount an ISO file

Solaris has the ability to mount an ISO file, just like you stuck in a DVD into the drive. You need to first create the software device that is "mountable" and then mount it, so there are two basic commands.

The two files in this example are located in /root/
sol-10-u6-ga1-sparc-dvd.iso
sol-10-u6-ga1-x86-dvd.iso

Create a directory to mount the ISOs to. I like to create a directory off of root (/) called lofi. So when you are done, you will have /lofi. "cd" into /lofi and create two directories, one for each of the solaris types, sol10-sparc sol10-x86 ... so when you are done ... you will have /lofi/sol10-sparc and /lofi/sol10-x86.

The files you need are in /root, so the lofi command will look like this
# lofiadm -a /root/sol-10-u6-sparc-dvd.iso /dev/lofi/1

# lofiadm -a /root/sol-10-u6-x86-dvd.iso /dev/lofi/2

Note the device number change at the end. Now let's mount them to the directories we created. Remember to "mount" something, the directory has to already exist.

The command below mounts the sparc image. The -F is the filesystem type, in this case it is High Sierra File System (HSFS) also known as a type of CD/DVD file system.

The -o are options that you can add ... in this case we want to specify read-only so the system or users don't think otherwise.
# mount -F hsfs -o ro /dev/lofi/1 /lofi/sol10-sparc
# mount -F hsfs -o ro /dev/lofi/2 /lofi/sol10-x86

So now you can cd into the directories and nab file as needed.

When you are finished you reverse the steps to get rid of the configuration:

Unmount the lofi devices
# umount /lofi/sol10-sparc (make sure you aren't in the directory or it won't unmount)
# umount /lofi/sol10-x86

To see the devices that are registered in lofi, just type
# lofiadm
Block Device File
/dev/lofi/1 /root/sol-10-u6-ga1-sparc-dvd.iso
/dev/lofi/2 /root/sol-10-u6-ga1-x86-dvd.iso

To remove the devices:
# lofiadm -d /dev/lofi/1 (you can enter either the device name or file name)
# lofiadm -d /dev/lofi/2

Issue the command lofiadm again ... it should be empty ...

Enjoy!

Thursday, March 26, 2009

Solaris: Resetting webconsole, smcwebconsole so it will start

This command resets Solaris smcwebserver also known as svc:/system/webconsole:console in services land.

# smcwebserver stop
# /usr/share/webconsole/private/bin/wcremove -i console

# svcs webconsole

If it isn't enabled, then make sure cacaoadm is enabled and running
# /usr/sbin/cacaoadm status
# /usr/sbin/cacaoadm enable
# /usr/sbin/cacaoadm start
# svcadm enable webconsole

Everything should startup ...


UNIX: Listing Used Ports

This will list used ports on a server along with the interface it is bound to.

# netstat -an | grep LISTEN | awk '{print $1}'

Solaris: Giving a user the ability to start privileged ports

In order to give a user other than root to start services requiring ports that are privileged.

As root, enter the following command on Solaris

# usermod -K defaultpriv=basic,net_privaddr