Helpful commands in IRIX

From Higher Intellect wiki
Jump to: navigation, search
Helpful commands in IRIX:
see also:
ln -s <existing_file> <link_file>
      <source>        <target>
B = byte
b = bit

so what does MB mean ?  megabyte or megabit ???
and what is Mb?         Megabit ? Megabyte

Majority tends to say:
MB	Megabyte
Mb	Megabit
Mbps	Megabit per seconds
Netzwerk	100Mb/sec  <=> 12.5 MB/sec (=12.5 Megabytes/sec)

Bandwith measure in bits per second
1Kb/s = 1000 bits per second
1Mb/s = 1'000'000 bits per second

Space measured in bytes and multipliers are power of 2
1KB = 1'024 bytes
1MB = 1'048'576 bytes
1GB = 1'073,741,824 bytes

always double check:
df -m			will say MB and actually means Mbytes
fx> label/show/part	states Megabytes	
diskperf		MB = Megabytes 
ftp			says Kbytes/s
Typical speeds:
source: ~nick/info/net/speed

33600bps	33 kbit/s                       10 MBytes/40Min

10BaseT         10 Mbit/s    1.25 MByte/s    12.5 MByte/10s     75 MByte/Min

100BaseT        100Mbit/s    12.5 MByte/s    125 MByte/10s     750 MByte/Min

Gigabit Ethernet:
                1000Mbit/s   125 MByte/s     1250  MByte/10s  7'500 MByte/Min

ATM OC3		155Mbit/s
ATM OC12        622Mbit/s

Fibre Channel           100 MBytes/s  (~1Gb/sec)
			200 MBytes/s  (~2Gb/sec)

IEEE1394        400Mbit/s       50 MBytes/s

PCI bus bandwidth:
  33MHz, 64bit wide, 266 MB/s Theoretical bandwidth;
  66MHz              532 MB/s Theoretical bandwidth;

Unfortunately, you're both incorrect. Due to the implementation of
the Origin's XIO-to-PCI Bridge/Xbridge chip(s), the (X)Bridge will
"disconnect" DMA on every cache-line boundary, which casues a certain
fraction of the PCI bandwidth to be unavailable. On the O2000 this leads
to the *theoretical* maximum on a 64-bit/33-Mhz bus being ~213 MB/s
(not 266), and we've actually seen ~211 MB/s in certain test cases.

The same applies to Xbridge, so the *theoretical* maximum through
Xbridge to/from a 64-bit/66-Mhz bus is ~426 MB/s (roughly), though
I don't know what the max we've actually ever seen is. (A vague
memory says ~380 MB/s with some SCSI controllers, but don't quote me.)
SCSI Cable Length
SCSI-1          SE 6m           HVD 25m
SCSI-2          SE 3m           HVD 25m
SCSI-3          SE 1.5m         HVD 25m
( SCSI-3 can be used up to 3m with max 4 devices including the controller (HA))


Address Allocation for Private Internets

The Internet Assigned Numbers Authority (IANA) has reserved the
   following three blocks of the IP address space for private internets:        -  (10/8 prefix)      -  (172.16/12 prefix)     - (192.168/16 prefix)
System Configuration:
hinv		hardware inventory command
hinv -vv	detailliert mit revision level
hinv -mv	Revision of Octane Powersupply
nvram,sgikopt	get or set non-volatile RAM variables
diskpatch -v	Get info about the disk (very useful)
help_mem	get exact memoryinfo (only at PROM)
swap -ln	Swap info in MegaBytes
swap -s
		display graphics subsystems informationstopgfx
glxinfo		display info about a GLX extension and OpenGL renderer
setmon		set the current and default video output format
/usr/gfx/setmon 60Hz
also check for ~ /usr/gfx/ucode/<XXX>/vof
/usr/gfx/setmon 1024x768_75
/usr/gfx/setmon stereo
To do setmon from remote (via network):
  setenv DISPLAY :0.0 ; /usr/gfx/setmon 72Hz
stopgfx;gfxinit;startgfx;	gfxinit will not work if stopgfx was not used
				just before

Octane dual head with new monitor GDM5411:   setmon -p0 72Hz;setmon -p1 72Hz

xsetmon		graphical setmon
xscreen		replaces setmon (GUI) actually a link to xsetmon
O2: /usr/sbin/flatpanel
ircombine (for Onyx)	

mt status

pre6.4: scsicontrol
>=6.4 :  scsiha -p #
scsicontrol	probe and control scsi devices
		devices for the CDROM can be found in /dev/scsi
		when issuing scsicontrol no CD must be in CD driver
		if there is a CD mounted then the error message appears:
		sc0d4l0:  cannot open: Resource busy
Ex: scsicontrol -i sc0d4l0    (l0 stands for lun 0)
sc0d4l0:  CD-ROM        TOSHIBA CD-ROM XM-3501TA0095
ANSI vers 2, ISO ver: 0, ECMA ver: 0; 
Response format type 1, but has SCSI-2 capability bits set
supports:  reladdr.  inquiry format is SCSI 1
Device is  not ready

to get the firmware of the CDROM drive with a mounted CD use: fx

scsiadminswap -p -b # -d #

diskpatch -v		Info about all disks
sc0d3l0:  Disk         SGI     IBM  0662 S12   1S11  Serial: 00222769
sc0d1l0:  Disk         SGI     QUANTUM XP34300 S89C  Serial: MP621520

devnm name	identifies the special file associated with the mounted 

/dev/MAKEDEV	create device special files
		!!! first do "cd /dev " then "./MAKEDEV ......"
		MAKEDEV will create the device file in the current dir!!!
		./MAKEDEV plp

ioconfig 	IRIX 6.4  (ioconfig -f /hw ;reinitialize the hwgraph tree)
		-d add debuging output (ioconfig -d -f /hw)
sample for /etc/ioconfig to set SCSI bus differently on a O2000:
1051 /hw/module/1/slot/io5/mscsi/pci/1/scsi_ctlr/0

on O200 following line should work
103  /hw/module/1/slot/MotherBoard/node/xtalk/8/pci/3/scsi_ctlr/0

/dev/console 0644 root sys

flash		reprogram the flash PROM hardware on Origin and OCTANE machines
		-V Print currently loaded flash PROM version and time

see also FYI 100490 and the addition sent on August 27
Flash node from in PROM
>>flashcpu dksc(0,1,0)/usr/cpu/firmware/ip27prom.img
>> enable all
setdevperms - Update printing device entries in /etc/ioperms

Flash Octane from PROM:
flashcpu cdrom(0,4,7)/firmware/IP30/IP30prom.bin  # maybe option -o (overwrite) has to be used

TIB 200415 IP35 Cache Size May Be Set Incorrectly to 4MB
  If you find some nodes that are not 8 MB, you should reflash 
  them from the IRIX(R) operating system by using the -o option 
  with the following command line to override version checking:
flash -o -b <brick id>/usr/cpu/firmware/ip35prom.img

O3000/O3k l1 and l2 commands directly from Unix (starting with IRIX 6.5.15):
l1cmd - Send a command to the SGI L1 System Controller
	Ex:	# l1cmd env
l2cmd - Send a command to an SGI L2 System Controller

how do I check fan speeds" or voltages:
I know this is invading ESP-land but here is a cronjob I setup in the Peachtree

2,17,32,47 * * * * test 32 -le `sysctlrd -p | grep "air temp" | awk '{print
$5}' | awk -F. '{print $1}'` && echo "Overtemperature condition in Peachtree
Lab" |
Mail -s "Overtemperature in Lab"

Something similar can be created for the O3K.  This real example sends email if
32C is less than the reported temperature.

ide fe


nvram		get or set non-volatile RAM variables
chkconfig	configuration state checker
	-n	Show the internal version number rather than the date
	long impr_base		Shows all files that belong to impr_base
	config			Shows all config files
				--> usefull to find license files
	changed			List installed configuration files that have 
				a corresponding .O or .N file and their 
				respective .O or .N files.

	-b			brief
versions -b patchSG\*
	-m			(modified)  List only modified installed files

showfiles	show files belonging to installed products
	-A	Print absolute pathnames
	-c	Show only config files
showfiles -- <name_of_file>

showprods	-nD1

IRIX 6.4 SCSI commands:
scsiha -p X 	where X is the scsibus 
ioconfig -f /hw this will add the entries for that device 

scsiadminswap 	this will prepare a drive for hot removal 
scsiadminswap -u -b <bus#> -d <id#>	  (-u unplug)
scsiadminswap -p -b <bus#> -d <id#>   (-p plug)

pciconfig	hot-plug insert, hot-plug remove, and query PCI devices
csh:	/usr/local/bin/sgi_conf >&! /usr/local/sgiadm/configs/`hostname``date +_%b%d_%Y`
sh,ksh:	/usr/local/bin/sgi_conf >/usr/local/sgiadm/configs/`hostname``date +_%b%d_%Y` 2>&1
Add a CDdrive while the system is running (hot plug!):
scsiha -p <X>		<X> is the SCSI bus; probe the bus
			Probe for devices on the bus
ioconfig -f /hw
/etc/init.d/mediad stop; /etc/init.d/mediad start

other scsi commands:
scsiha -t <X> 		where <X> is the scsibus ; 
			Return interesting SCSI bus and attached target parameters
scsicontrol -i /dev/scsi/sc0d1l0 show device type 
scsiadminswap this will prepare a drive for hot removal 
scsiquiesce this will take the bus in quiet mode 
mkfs -n version=2	# this feature was introduced in 6.5.5, and will
			# be de default starting with 6.5.14
			# if IRIX older that 6.5.6 -> not able to mount xfs filesystems
			# that were created with version=2 format
			# see also NPA 200378
make new devices in Fabric visible (SAN / Switch)
scsiha -lp <busNr>
ioconfig -f /hw
	>now it should be visible in hinv
Integral SCSI controller 16: Version Fibre Channel QL2200
  Fabric RAID controller: node 2000006016fe1ee1 port 0 on SCSI controller 16 
  Fabric RAID controller: node 2000006016fe1ee3 port 0 on SCSI controller 16 
  Fabric RAID lun: node 2000006016fe1ee3 port 0 lun 1 on SCSI controller 16

fx -x -d /dev/rdsk/world-wide-name/lun#vol/cCpN
# = Lun No., C = Controller No., N = Port No.
Ex: fx -x -d /dev/rdsk/2000006016fe0d52/lun2vol/c16p0

How do I see the world wide names of the HBAs on a host, from the host itself?
scsiha -w <SCSI controller ID>
# scsiha -w 15
15 Portname: 210000e08b020637
new tape support in IRIX 6.5.11
docu:	man ts (/var/sysgen/master.d/tpsc is obsolete)
chkconfig ts on 
     To add support for a new device, you must add device information to the
     ts_types table, run an autoconfig to generate a new kernel, execute
     chkconfig -f ts on, and restart the system to execute this kernel.

master.d/scsi                      file that contains the ts_types table

Umount /root in miniroot -> "resource busy"
---> umount /root/hw
Enabling Disabling CPU's valid for Octane and ??
go to PROM:	disable 0	disable CPU 0
		enable 0	enable CPU 0
		enable		show status of the CPU's

Fibre Channel see also Origin Fibre Vault and Fibre Channel RAID Admin Guide 007-3715-00X
command ssmcli (storage processor command line interface) talks to the SP (storage
processor) in the Fibre Channel RAID ecnlosure. It communicates directly with the ssmagent.
ssmcli is an alternitive to the Raid GUI ssmgui.
ssmagent must be runnung - if no > ssmcli commands will fail
# chkconfig ssm on
# /etc/init.d/ssm start
 add in .login (or even better .cshrc) the path to
 set path = ($path /usr/ssm/bin /usr/ssm/lib)
 add in .profile 

ssmcli can be used to get various info about the RAID and can also be used to bind/unbind 
the disks.

GIU:	/usr/ssm/bin/ssmgui &

collect usseful info:
getlun for every lun
getlog for every SP
getcache for every SP
getcontrol for every SP
getcrus for every enclosure
getdisk for every enclosure
scsifo -d
fx label/show/all for every lun visible to irix
xlv_mgr -c 'show -long -verbose all'

sesmgr		Fibre Channel Drive Enclosure Status/Configuration Command Line Interface
sesmgr getversion
sesmgr poll
sesmgr topology
sesmgr getstatus
sesmgr getstatus -v
 -> get the Enclosure ID 0x5....
sesmgr getstatus -e 0x50050cc00000205c	#Obtaining a detailed status of an enclosure

Fibre Channel NON-RAID commands:
command fccli (fibre channel command line interface) talks directly to the JBOD
agent fcagent. Only way to talk to JBOD storage.
fcagent must be running, other wise fccli does not work
# chkconfig fcagent on
# /etc/init.d/fcagent start

# fccli getstatus -c 14
      4   |   OK        OK       OK         OK 

zdi80010 6# fccli getstatus -c 14 -e 4
 Enclosure 4, status OK
  Vendor ID:     CLARiiON
  Product ID:    DISK ENC
  LCC SN#:       ms1033430400
  LCC Mfg. Date: 9820
  LCC code rev:  003
  FRUs:          10 disk slot(s)
                 1 fan slot(s)
                 2 power supply slot(s)
                 1 peer LCC slot(s)

  | [ 4]  OK                              |      |
  +---------------------------------------+      |
  |   |   |   |   |   |   |   |   |   |   | P    |
  | O | O | O | O | O | O | O | O | O | O | E  L |
  | K | K | K | K | K | K | K | K | K | K | E  L |
  | 40| 41| 42| 43| 44| 45| 46| 47| 48| 49| R  C |
  +---------------------------------------+      |
  |               FANS  OK                |  OK  |
  |      PS0  OK            PS1  OK       |      |

Clariiion SCSI Channel RAID stuff:
add following lines to /.login  (better .cshrc)
# complete path definition:
set path = ($path /usr/cluster/bin /usr/raid5)

raidgui		graphical raid interface
raid5		linked to raidcli

# raid5 getagent

see which disk is bound to which lun:
# raid5 -d sc5d8l0 getdisk |grep Lun
 or check all luns with
# raid5 -d sc5d8l0 getlun 0

get detailed info about disk A0:
# raid5 -d sc5d8l0 getdisk a0

Get the FRU info about disk:
# raid5 -d sc5d8l0 getfru c2

returns firmware (flare) revision and SP model number. 
NOTE: model 7624 = SAUNA controller and model 7305 = PHOENIX controller. 
# raid5 -d sc5d8l0 getsp

Which SP owns which lun ?
# scsifo -d
Group 8:
  [P] sc2d8l3 (82)
  [ ] sc5d8l3 (181)
Group 9:
  [P] sc2d8l2 (80)
  [ ] sc5d8l2 (172)
Group 10:
  [P] sc2d8l1 (71)
  [ ] sc5d8l1 (170)
Group 11:
  [ ] sc2d8l0 (62)
  [P] sc5d8l0 (168)

assign a certain lun to a certain SP
Ex: assign lun1 to go over SCSI bus 5 (SPB)
# scsifo -s sc2d8l1

Which SCSI bus belongs to which SP:
# raid5 getagent |egrep 'Name|Node'
Name: xl-raid3-SPA
Node: sc2d8l0
Name: xl-raid3-SPB
Node: sc5d8l0

Reassign Lun Ownership can also be done with 
# raidcli tresspass sc6d6l0 mine

Get 'Current' and 'Default' owner of a certain lun
# raid5 -d sc11d8l0 getlun 0 | egrep 'Current|Default'

PS9400 commands:
CLI:	/usr/bin/tpssm7cli
# tpssm7cli -d -i
san-storage 1
san-storage 1
san-storage 1
san-storage 0
san-storage 0
san-storage 0
# tpssm7cli -c "help show" -n "san-storage 1"

Total Performance Storage Manager 7 Devices, Version
Built Wed Dec 12 14:45:17 CST 2001
Copyright (C) LSI Logic Corp 1999.  All rights reserved.

/dev/scsi/200400a0b80c3c48/lun0/c3p1 [Storage Array san-storage 1, Volume 3, LUN 0, Volume WWN <600a0b80000c3b6d000000073c764137>]
/dev/scsi/200400a0b80c3c48/lun0/c4p2 [Storage Array san-storage 1, Volume 3, LUN 0, Volume WWN <600a0b80000c3b6d000000073c764137>]
/dev/scsi/200400a0b80c3c48/lun1/c3p1 [Storage Array san-storage 1, Volume 4, LUN 1, Volume WWN <600a0b80000c3c48000000013c76415d>]
/dev/scsi/200400a0b80c3c48/lun1/c4p2 [Storage Array san-storage 1, Volume 4, LUN 1, Volume WWN <600a0b80000c3c48000000013c76415d>]
/dev/scsi/200400a0b80c3c48/lun31/c3p1 [Storage Array san-storage 1, Volume Access volume, LUN 31, Volume WWN <600a0b80000c3b6d0000000800000000>]
/dev/scsi/200400a0b80c3c48/lun31/c4p2 [Storage Array san-storage 1, Volume Access volume, LUN 31, Volume WWN <600a0b80000c3b6d0000000800000000>]
/dev/scsi/200500a0b80c3c48/lun0/c3p1 [Storage Array san-storage 1, Volume 3, LUN 0, Volume WWN <600a0b80000c3b6d000000073c764137>]
/dev/scsi/200500a0b80c3c48/lun0/c4p2 [Storage Array san-storage 1, Volume 3, LUN 0, Volume WWN <600a0b80000c3b6d000000073c764137>]
/dev/scsi/200500a0b80c3c48/lun1/c3p1 [Storage Array san-storage 1, Volume 4, LUN 1, Volume WWN <600a0b80000c3c48000000013c76415d>]
/dev/scsi/200500a0b80c3c48/lun1/c4p2 [Storage Array san-storage 1, Volume 4, LUN 1, Volume WWN <600a0b80000c3c48000000013c76415d>]
/dev/scsi/200500a0b80c3c48/lun31/c3p1 [Storage Array san-storage 1, Volume Access volume, LUN 31, Volume WWN <600a0b80000c3c480000000200000000>]
/dev/scsi/200500a0b80c3c48/lun31/c4p2 [Storage Array san-storage 1, Volume Access volume, LUN 31, Volume WWN <600a0b80000c3c480000000200000000>]
/dev/scsi/200200a0b80c3972/lun0/c4p2 [Storage Array san-storage 0, Volume 1, LUN 0, Volume WWN <600a0b80000c3972000000093c76400f>]
/dev/scsi/200200a0b80c3972/lun0/c3p1 [Storage Array san-storage 0, Volume 1, LUN 0, Volume WWN <600a0b80000c3972000000093c76400f>]
/dev/scsi/200200a0b80c3972/lun1/c3p1 [Storage Array san-storage 0, Volume 2, LUN 1, Volume WWN <600a0b80000c3747000000013c764078>]
/dev/scsi/200200a0b80c3972/lun1/c4p2 [Storage Array san-storage 0, Volume 2, LUN 1, Volume WWN <600a0b80000c3747000000013c764078>]
/dev/scsi/200200a0b80c3972/lun31/c3p1 [Storage Array san-storage 0, Volume Access volume, LUN 31, Volume WWN <600a0b80000c451b0000000a00000000>]
/dev/scsi/200200a0b80c3972/lun31/c4p2 [Storage Array san-storage 0, Volume Access volume, LUN 31, Volume WWN <600a0b80000c451b0000000a00000000>]
/dev/scsi/200300a0b80c3972/lun0/c3p1 [Storage Array san-storage 0, Volume 1, LUN 0, Volume WWN <600a0b80000c3972000000093c76400f>]
/dev/scsi/200300a0b80c3972/lun0/c4p2 [Storage Array san-storage 0, Volume 1, LUN 0, Volume WWN <600a0b80000c3972000000093c76400f>]
/dev/scsi/200300a0b80c3972/lun1/c3p1 [Storage Array san-storage 0, Volume 2, LUN 1, Volume WWN <600a0b80000c3747000000013c764078>]
/dev/scsi/200300a0b80c3972/lun1/c4p2 [Storage Array san-storage 0, Volume 2, LUN 1, Volume WWN <600a0b80000c3747000000013c764078>]
/dev/scsi/200300a0b80c3972/lun31/c4p2 [Storage Array san-storage 0, Volume Access volume, LUN 31, Volume WWN <600a0b80000c37470000000200000000>]
/dev/scsi/200300a0b80c3972/lun31/c3p1 [Storage Array san-storage 0, Volume Access volume, LUN 31, Volume WWN <600a0b80000c37470000000200000000>]

Failover path:

If you try the command "scsifo -d", it should show you all pases to the
TP9400 Luns, with a p on the primary, the other pases is where the xlv 
fails over to in case of a failure on the primary path.

For this to work you need to have the xlvplex software installed; but you 
do not need the plexing license.

If you want to change the default selected pases, you need to enter a config
in /etc/failover.conf
/etc/failover.conf is only needed for JBOD, bandwidth solutions, and 3rd-party RAID
if using our RAID products the failover will happen automatically 240 seconds
after the 1st failed I/O request
Performance stuff:
sysmeter -v all		display system performance values eoe.sw.perf
sysmeter -h <rem_hostname>
How to Burn CD?
gcombust  (stefan)
How to burn on burn (eggi)?
rlogin burn -l root
cd /usr/cdr; source ./cdrenv; /usr/cdr/bin/SGI/cdrpub &
Show the remote admin what you type:
let him first issue:
% tty

$ script /dev/ttyq8
from now on the admin on /dev/ttyq8 sees all my commands 
 updated after every <return>
$HOME/.rhosts nick root
lion nick root

be also aware that .rhosts is disregarded if it is owned by another user or if its
permissions allow anyone who is not the owner to modify the file.
-->	chmod  600  .rhosts		!!! this can fool you if you forget !!!
sticky bit (1000)
chmod +t $HOME/tmp
ls -ld $HOME/tmp
drwxrwxrwt    3 nick     user         118 Aug  3 10:34 /usr/people/nick/tmp

man chmod ....
     If a directory is writable and the sticky bit, (t), is set on the
     directory, a process may remove or rename files within that directory
     only if one or more of the following is true (see unlink(2) and

          the effective user ID of the process is the same as that of the
          owner ID of the file

          the effective user ID of the process is the same as that of the
          owner ID of the directory

          the process is a superuser.

how to find these directories:	find . -type d -perm 1000 -print

setuid-bit setgid-bit
setuid (4000)  
setgid (2000)
how to find these files:
find / -local \( -perm 2000 -o -perm 4000 \) -exec ls -l {} \;
ls -lh	show size more human readable, specially for large files
ls -u 	Use time of last access instead of last modification
		"file " will change the access time of a file
		(useful for mailchecking)
open ftp in a browser:
Ex: 	ftp://nick:secret9@lion:/tmp/
lmdiag -c /usr/lib/SoftWindows/FLEXlm/license.dat
lmdiag -c /var/flexlm/license.dat
showprods -F <product> 
			shows from WHERE the software has been installed
Log of the Installation:

df --> in Human numbers --> df -h

Shows gigabytes instead of k

# df -h
Filesystem             Type  Size   use  avail  %use  Mounted on
/dev/root               xfs  4.1G  3.6G   442M   90%  /
/dev/xlv/volume1        xfs  4.2G  1.1G   3.2G   26%  /d1
/dev/xlv/volume2        xfs  4.2G  1.7G   2.5G   40%  /usr/vtr/clips

Backup utilities:
move trees from source_dir to target_dir:
cd source_dir
tar -cvf - . | (cd tartget_dir; tar -xpvf - )
	-p 	restores files to their original modes
		ignoring present umask. Setuid and sticky information 
		are also restored

cd /source/dir
tar -cvpBf - ./backup_dir | rsh root@<remhost> "(cd /target; tar -xpBf -)"

Just restore some directories from a tar archive:
tar -xvf sgiadm.tar sgiadm/bin sgiadm/configs
Note that this will restore the directory sgiadm/bin and sgiadm/configs
from the archive; also NOTE that there is NO terminating '/',
so the command "tar -xvf sgiadm.tar sgiadm/bin/" would not work
it would just restore the empry dir sgiadm/bin/ but none of the directories 

xfsdump -l0 - /source_dir | xfsrestore - /target_dir

cp : new features for   1) Direct IO 
                        2) realtime filesystems

cp -D
cp -tP -e ......

Also df can now show you the realtime usage 
portion of the filesystem with the df -r flag

List_tape	List content of a tape written by Backup(1), cpio(1), 
		tar(1), or bru(1)

dump / restore
dump 0Cu 2m /usr	must include the C option followed by the size of the tape
			for example 2m (2Mbytes) otherwise it is constantly asking 
			for another tape
Byte swap:
dd if=/dev/rmt/tapedevice bs=20b conv=swab | tar vxf -
 or first:
tar tvf /dev/rmt/tapedevicens

mkpart - Partition Configuration Tool for Origin

NUMA stuff
sn      - NUMA Memory Management Configuration Tool
gr_sn   - Graphical NUMA Memory Management Configuration Tool
nstats  - NUMA Memory Management Statistics
gr_nstats - NUMA Memory Management Statistics
dplace - a NUMA memory placement tool
ex.: dplace -data_pagesize 64k -stack_pagesize 64k a.out

dlook - a tool for showing memory and process placement
To show memory and thread placement for a  program called a.out that
     would normally be run by
        % a.out < in > out
     and place the resuls in a file called output one would simply
        % dlook -out output a.out < in > out 


bufview : file system buffer cache activity monitor
          the tool works like top or osview

Acces control lists / Capabilities

While this is documented in a Pipeline article
here is the list of the new commands.

attrinit - Set file attributes -> neat tool since 
           it can read a script file.
           Take a look at the file /etc/irix.cap 
           you will be surprised.

chacl - change the access control list of a file or directory
        use the ls -D to obtain the ACL

chlabel - change the label of a file

chcap - change file capability sets
        use the ls -P to get the cap set
        try ls -P /sbin YOU WILL be SURPRISED.


base command 
# ifconfig eg0 inet netmask 0xffffff00
# ifconfig eg0
        inet netmask 0xffffff00 broadcast

ifconfig : 2 new options 
                1) list of the interfaces with -a
                2) speed status ( 10/100 ) with -v

ifconfig -a
        inet netmask 0xffffff80 broadcast
        inet netmask 0xff000000 

ifconfig -v ec0
        inet netmask 0xffffff80 broadcast
        speed 10.00 Mbit/s half-duplex

IP aliases:
see insight: IRIX Admin: Networking and Mail Chapter 3
o make sure ipaliases is chkconfiged on
  # chkconfig |grep ipaliases
o edit /etc/config/ipaliases.options
 ef0 netmaks 0xffff0000 broadcast

Do it by hand:	# ifconfig ef0 alias

Gigabit Ethernet:	TIB 200390 	Patch 4291 or IRIX 6.5.13
/var/sysgen/master.d/if_eg for detailed tuning
# ifconfig eg0 sspace 262144 rspace 262144
 ->> ifconfig-X.options:
netmask 0xffffff00 sspace 262144 rspace 262144


prtvtoc : new feature : provides info for all the drives

prtvtoc -a
 pt# start    end      #blocks  type    owner
   7 4096     8888542  8884447  xlv     [/usr/vtr/clips]
  vh 0        4095     4096             
 vol 0        8888542  8888543          
 pt# start    end      #blocks  type    owner
  vh 0        63       64               
 vol 0        922667   922668           
 pt# start    end      #blocks  type    owner
   7 4096     8888542  8884447  xlv     [/d1]
  vh 0        4095     4096             
 vol 0        8888542  8888543          
 pt# start    end      #blocks  type    owner
   0 4968     8519902  8514935  xfs     /
   1 8519903  8888542  368640           
  vh 0        4967     4968             
 vol 0        8888542  8888543         
Roboinst : automatic software installation tool
roboinst, roboinst_start, roboinst_check

id : -P   Reports the capability set of the invoking process.

id -P
uid=16432(berlie) gid=20(user) capability=(all= CAP_DAC_WRITE+ep

/bin/id  -P
uid=998(guest) gid=998(guest) capability=(all=)


Checkpoint and Restart Processes : great for shutdowns
The CPR functionality has 2 commands : cpr, cview ( gui )

Applications have to be cpr-aware !!!!	An application out of the box
will normally not work with cpr

Stop a process:
cd /var/tmp/cpr
cpr -c <statfile> -p <proc_id>
Ex:	cpr -c ckpt05Feb2002 -p 53711
Restart it:
cpr [-j] -r ckpt05Feb2002

How to find out the PGID of the process named standard.x:
 ps -efj |egrep 'PGID|standard.x'
cd /scratch/cpr; cpr -c ckpt05Feb2002 -p 537245:GID

Live Installations !!
Yes finaly its here and its called Roboinst

roboinst, roboinst_start, roboinst_check - automatic software
installation tool

also new options to inst and swmgr

inst -V live_install:on

How to speed up inst at exit:
...after install is done
inst > set rqs_task rqsread
inst > quit

man inst ...
If set to "rqsread", then only the first rqs phase will be
performed (the rqs registry file is updated).

But I don't know how to properly call rqsall(1) at a later time

linkstat - a Craylink monitoring tool

     # linkstat /hw/module/1/slot/r2/router/mon
     Router: /hw/module/1/slot/r2/router/mon
      Port 3:  Utilization: bypass 0%  receive 2%  send 2%
       Retries 71847 (6/Min), SN errs 116395 (19/Min), CB errs 31196
      Port 5:  Utilization: bypass 9%  receive 13%  send 20%
       Retries 25087 (2/Min), SN errs 497298 (38/Min), CB errs 30417650
      Port 6:  Utilization: bypass 0%  receive 4%  send 3%
       Retries 46394 (4/Min), SN errs 6252865 (599/Min), CB errs 5557

xbstat - monitor Crossbow (Xbow) traffic
xbstat -d /hw/module/1/slot/n1/node/xtalk/0/mon -t 60

psifconfig - show and set packet scheduling interface configuration

psifconfig -i ec0
ec0 packet scheduling is OFF
reserved bandwidth                  0
max reservable bandwidth       625000
interface bandwidth           1250000
MTU                              1500
num_batch_pkts                      4
flags           0x100000
        packet scheduler has been disabled by administrator

rstat - show resource reservation status
The command top has changed a lot look it up 

IRIX smith 6.5 IP32            load averages: 0.00 0.00 0.00    15:49:04
66 processes:  62 sleeping, 3 zombie, 1 running
CPU: 98.0% idle,  0.5% usr,  1.0% ker,  0.0% wait,  0.0% xbrk,  0.5%
Memory: 128M max, 101M avail, 12M free, 180M swap, 124M free swap

43647      43647 berlie    20 2248K  824K run/0    0:00  0.5  1.09 top
10107      10107 root      20  155M   27M sleep  396:03  0.3  0.88 Xsgi
41465      41465 berlie    30   21M 1504K sleep    0:08  0.1  0.26 xwsh
26318      26666 berlie    20   23M 1320K sleep   14:44  0.1  0.13 pmgadge
40697      40622 berlie    20   29M 2224K sleep    3:12  0.0  0.03 cdplaye

Hardware inventory
A few things have changed here 
some new commands and options 

hinv -mv
Location: /hw/module/1/slot/n1/node
        MODULEID Board: barcode K0015226   part              rev   
       8P12_MPLN Board: barcode FXW293     part 013-1547-003 rev  E
            IP27 Board: barcode DGR051     part 030-1266-001 rev  C
Location: /hw/module/1/slot/n2/node
            IP27 Board: barcode DGR650     part 030-1266-001 rev  C

Machine topology information is extracted from the hardware graph.

Machine dist has 4 cpu's, 2 memory nodes, and 2 routers.

The cpus are:
cpu   0 is /hw/module/1/slot/n1/node/cpu/a
cpu   1 is /hw/module/1/slot/n1/node/cpu/b
cpu   2 is /hw/module/1/slot/n2/node/cpu/a
cpu   3 is /hw/module/1/slot/n2/node/cpu/b

ioconfig : onfigure I/O devices
Look up the /hw pseudo filesystem and 

uns - the Unified Name Service Architecture
Related commands and files:

nsadmin : Name Service Administration Utility
/etc/nsswitch.conf - name service configuration file
nsadmin restart

To remove a single cache file have a look at the man page and the option
remove for nsadmin, or just try:

/sbin/umount /ns;/usr/sbin/nsadmin remove ;/bin/rm /var/ns/cache/*
;/usr/sbin/nsadmin restart

The man page suggests that the removal of a single map is possible so I
would try this first. 

flush all the nsd maps and restart nsd:
# nsadmin flush; nsadmin restart

include LDAP services: see TIB 200396

XLV Logical Volumes
the lv subsystem is not supported anymore
/dev/dsk/xlv has moved to /dev/xlv


crontab(1) was enhanced to allow root to edit/list/remove other users'
System info:
uptime		show how long system has been up
who -r		who: display who is on the system
w		who is on and what they are doing
finger		user information lookup program

sn0 commands:
linkstat	a Craylink monitoring tool
		linkstat -a	Report on all links in the system

clear sn0log messages:
> At the prom command monitor promt, type 'pod',
> At the pod prompt, type 'clearalllogs, and then 'reset'

Or just from the unix prompt:
#sn0log -w -a > /var/adm/sn0log_date
this is to write the prom logs to a file

#sn0log -c -a
this is to clear the prom logs

comparison of OS command line / POD
sn0log -a -c 	= clearalllogs = Clear all log files. 
sn0log -a -i    = initalllogs = Initialize all PROM logs for all modules in the system;
		  resets PROM variables to factory defaults.

sn1 commands 
> I had a question from a customer about getting the temparature data
> on his SGI3000 from IRIX.
> We have this data in the L1, listet with the env command; but I have
> been unable to find a command to obtain this data from IRIX, unless
> you connect to the L1 via a serial connection.
> On the Everest systems we can get this type of data with the sysctlrd -p
> command, on the Origin 2K we can talk with the msc ( elsc ) with the
> command sn0msc, I haven't been able to find a similar command to for the
> SN1 to talk to an L1 from IRIX.

# uname -R
6.5 6.5.14f

# showfiles -- l1cmd
f 45690 160192 field_diags_sysco.sw.stand m usr/sbin/l1cmd
f 39545  1653 field_diags_sysco.sw.stand m

# showfiles -- l2cmd
f 34704 160192 field_diags_sysco.sw.stand m usr/sbin/l2cmd
f 58351  1794 field_diags_sysco.sw.stand m

# l1cmd env | grep TEMP | awk '{print $11$12}'

l1cmd only talks to C bricks,
l1cmd --scdev /hw/module/...c../L1/controller _l1_command_

Use l2cmd to target a non C brick.
# l2cmd 001i21 l1 env | grep TEMP | awk '{print $11$12}'
MMSC is connected to 2 or more MSC ports; MMSC only used with 2 or more

MMSC display keypad debounce problem (FYI 100882 100884 100737) 
	MMSC>r 1	MMSC>setenv DEBOUNCE_DELAY 200000

how to enter POD:	PROM -> command monitor > pod

1) 1A 000: POD IOC3 Dex>go cac
2) 1A 000: POD IOC3 CAC>initalllogs
3) 1A 000: POD IOC3 CAC>reset

see also TIB 200124: Problems with 400-MHz Node Board Upgrades
makewhatis	needed for "man -k" and "apropos"
man -k
relnotes patchSG0002278 1	(Chapter 1 of #2278 Relnotes)
grelnotes	graphical
Install System:

Here are the two commands for booting sash and fx
IRIX 6.4 CD put into local CDROM controller 0 SCSI ID=4

1) go to PROM
2) go to Command Monitor
do the commands 
hinv					(check for SCSI id of CDROM)
boot -f dksc(0,4,8)sash64		(sashARCS for older systems)
boot -f dksc0,4,7)stand/fx.64 --x	(fx.ARCS for older systems)

in fx to 
fx> label > create > all

fx> repartition > resize		(now you can adjust the swap part.)

fx -s "dksc(0,3,0)"	open disk with SCSI ctrl 0; SCSI ID 3; lun 0
# fx -x "dksc(0,3,0)"
Boot miniroot from disk:
| Is it possible to boot miniroot from local disk?
To boot miniroot you need the files sa and unix.IPXX (and sash in vh).

EX: To boot miniroot from disk:
# mkdir /disk/miniroot
# cp /CDROM/sa /disk/miniroot
# mkdir /disk/miniroot/miniroot
# cp /CDROM/miniroot/unix.IPXX  

Then you can boot miniroot from the prom menu
setting local directory /disk/miniroot


Description for inst:
  View:      distribution
  Status:    N=new, U=upgrade, S=same, D=downgrade, P=patch upgrade
  Patches:   A=installable patch, X=uninstallable (missing base product)
  Selection: i=install, r=remove, k=keep

  Subsystem Types [bdrpc]:  b=reBoot needed, d=Default, r=Required, p=patch,
             c=Client only

Usefull command
Inst > keep all
Inst > install A	(install all installable software, spec. for patches)
Inst > inst S		(install same)
Inst > inst I		Reinstallation of Software:
			Select all installed software for reinstallation:
Inst > admin

Admin> files nss_fasttrack		List all files belonging to nss_fasttrack

Admin> save /tmp/inst_save		Save selection to file /tmp/inst_save
       load /tmp/inst_save		load selection from the file

a) Inst > help		(help keep)
b) Inst ><ENTER>

Automatic installation:
inst -f /CDROM/dist -a -u upgrade
inst -f /CDROM/dist -a -I <selection>

		-I selection	install
		-R selection	remove
		-K selection	keep

Maintenance and feature stream / how to switch streams:
read all Overlay and Application CD's; might be possible that also 
the 6.5 core CD's have to be read
> keep *
> inst standard
> inst maint		#switch to maintenance stream
> inst feature		#switch to feature stream
How to downgrade overlay ?
> install downgrade
> set rulesoverride true
How to install new system with limited space ?
> install impr_print impr_base
> keep appletalk *.books.* netwr_client demos custlink cosmocreate Register
> keep *_dev		# get rid of all the _dev conflicts from overlay CD
extract single files from inst package by installing to other root directory:
idea: install that product to another target (-r) and get it from that directory
	PRB 200261  
     The PROM can be manually installed on systems not running 
     6.5.10+ by downloading one of the patch files (#4153 or #4154) and using the 
     following steps: 
     1. Install the patch in an alternate root tree. 
     % inst -a -r/var/tmp/patch -f<path to extracted patch files> \
     -Vrulesoverride:on -Iall
     NOTE: You will need to add '-mCPUBOARD=IP32' if you extract the   
           files on a system other than an O2 system. 
     2. Install flash image (you must be root to do this). 
     % su
     # /sbin/flashinst -T -y -q \
     3. Clean up the extracted files. 
     # rm -rf /var/tmp/patch

extract file io6prom.img

Using IRIX 6.5.11 Overlays [2 of 3] 812-0819-011

# grep usr/cpu/firmware/io6prom.img /CDROM/dist/eoe_6511f.idb
  f 0644 root sys usr/cpu/firmware/io6prom.img
  xlv54/6.5.11f/work/stand/arcs/IO6prom/SN0PROMio6prom.img eoe.sw.base sum(42196)
  size(367304) off(17655411) mach(CPUBOARD=IP27) cmpsize(0)
# inst -f /CDROM/dist/eoe_6511f -Y usr/cpu/firmware/io6prom.img -m
  CPUBOARD=IP27 -V rulesoverride:on -r /tmp -I default

;	 -r <target>;  -Y <file> Install only file during installations

Default distribution to install from: /CDROM/dist/eoe_6511f
.... proceed with inst dialog

# ls -R /tmp

extract ip27prom code (the next is all one line..)

% inst -f /CDROM/dist/eoe_6511f -Y usr/cpu/firmware/ip27prom.img -m
 CPUBOARD=IP27 -V rulesoverride:on -r /tmp -I default

 ->  When inst menu comes up type  'go'
 ->  When inst completes type      'quit'
%  ls -R /tmp   -> the prom image is in /tmp/usr/cpu/firmware

other example how to if_eg.o from 6.5.14:
inst -U -r /var/tmp/removethis -f eoe_6514m -I eoe.sw.base -K '*'
will extract all files from eoe.sw.base to /var/tmp/removethis

You can use showfiles:

cd /tmp
showfiles -f /CDROM_812-0818-014/dist/eoe_6514m -x
+ /tmp/if_eg.o

NOTE: To extract this file in IP27boot w/ showfiles, you have to be on a IP27 system.
xfs_growfs /mount_point	
		Info about a xfs filesystem (isize,block_size)
xfs_estimate	estimate the space that an XFS filesystem will take

xfs_db		debug xfs filesystem
        xfs_db -r /dev/dsk/XXXXX
        xfs_db> sb
        xfs_db> print

xfs_ncheck	generate pathnames from i-numbers for XFS
fsr_xfs		filesystem reorganizer for XFS
Access the volume header of a CDROM:
Assuming CD on controller 0 and SCSI id=4

# ls -l /dev/dsk/dks0d4*
brw-------    1 root     sys        4,  8 Mar 19 15:52 dks0d4s
brw-------    1 root     sys      128, 64 Jan 26 13:27 dks0d4s0
brw-------    1 root     sys      128, 65 Jan 26 13:27 dks0d4s1
brw-------    1 root     sys      128, 79 Jan 26 13:27 dks0d4s15
brw-------    1 root     sys      128, 70 Jan 26 13:27 dks0d4s6
brw-------    1 root     sys      128, 71 Jan 26 13:27 dks0d4s7

#install -F /dev/dsk -m 600 -u root -g sys -blk 128,72 dks0d4s8

ls -l /dev/dsk/dks0d4s8
brw-------    1 root     sys      128, 72 Mar 19 15:52 dks0d4s8

Current contents:
        File name        Length     Block #
        sgilabel            512          32
        io4prom         1029914          33
        mr             28672000        2045
        sash64           190904       58045
        sashARCS         283172       58418
        sashIP17         284720       58972

Disk information:
fx> label/show/parameters	list all parameters
fx> label/set/parameters
	Command Tag Queueing
	write buffering
XLV Logical volumes:
Repair a defective volume (eg overlapping)
o delete the logical volume "local"

        xlv_admin (delete object)
o delete the partition 15 on disk dks0d2

        fx   repartition > expert
             starting cyl =0
             number of cyl=0
o make a new logical volume

        > vol local
        > data
        > plex
        > ve /dev/dsk/dks0d2s6
o make a filesystem on this logical volume man mkfs
        mkfs_xfs -d name=/dev/dsk/xlv/local -l internal,size4m
o restore from backup

Useful XLV commands:
xlv_assemble -n	Scan all disks for logical volume labels, but don't save the
		logical volume configuration and don't activate the kernel with
		this configuration.
xlv_admin	(for IRIX 5.3) ( 41) 42) )
xlv_mgr		(for IRIX 6.X)
xlv_mgr -c "show -long all"
prtvtoc		(prtvtoc /dev/rdsk/dks<controller-id>d<SCSI-id>vh
				  dks0d1vh )
/usr/sbin/prtvtoc /dev/rdsk/*vh  !! always on raw device !!
xfs_copy	copy the contents of an XFS filesystem
dvhtool		modify and obtain disk volume header information
		ex: dvhtool -v list /dev/rdsk/dks0d3vh
		ex: dvhtool -v list   ( will take system disk)

extract sash from volume header:
dvhtool -v get sash /tmp/sash /dev/rdsk/dks0d1vh

cp ide to volume header:
ls -l /usr/stand/ide
-rwxr-xr-x    1 root     sys      2154692 Jan 26 13:23 /usr/stand/ide
---> dvhtool -v add /usr/stand/ide ide /dev/rdsk/dks0d1vh
assuming disk on controller 0 SCSIid=1

dvhtool <Enter>
Command? (read, vd, pt, dp, write, bootfile, or quit):
vd	Volume Directory
pt	Partition Table
dp	Device Parameters

dvhtool again:
a) list content of volhdr:	
	dvhtool -v list /dev/rdsk/dks0d1vh
b) extract file from volhdr:	
	dvhtool -v get sgilabel /tmp/sgilabel /dev/rdsk/dks0d1vh
c) write a file to volhdr:
	dvhtool -v add /tmp/sgilabel sgilabel /dev/rdsk/dks0d4vh

dvhtool -v list ${SOURCE}
dvhtool -v get sash /var/tmp/sash ${SOURCE}
dvhtool -v get ide /var/tmp/ide ${SOURCE}
dvhtool -v get sgilabel /var/tmp/sgilabel ${SOURCE}
dvhtool -v add /var/tmp/ide ide ${TARGET}
dvhtool -v add /var/tmp/sash sash ${TARGET}
dvhtool -v add /var/tmp/sgilabel sgilabel ${TARGET}
XVM commands:
xvm show -verbose *
xvm show *
xvm show -top vol
ab 6.5.16 existiert weitere Option '-extend'
diskalign	XLV Aligned Disk Striping Utility # useful to find out stripe_unit

% diskalign -n vol1 -r5m '/dev/dsk/dks12d8l[0-1]s7'  # request size 5m

# Number of devices     =       2
# Request alignment     =    4096 bytes
# Desired request size  = 5242880 bytes
# Aligned request size  = 5242880 bytes
# Alignment padding     =       0 bytes
# Padding I/O overhead  =    0.00 %
vol vol1
ve -stripe -stripe_unit 5120 \
/dev/dsk/dks12d8l0s7 \

Discussion about SWAP swap Swap:

swap -s ; swap -ln
virtual swap:
vlength=XXX		set virtual swap to  XXX * 512 bytes
could also be added to /etc/fstab (IRIX 6.5)
/vswap/vswap1 swap swap pri=5,vlength=524288000 0 0  # (268 GB !)

Start another Netscape thread (no new process)
netscape -remote "openURL ("
netscape -remote "openURL (file:/tmp/tes.html, new-window)"
alias nsm 'netscape -remote mailto'


	before 1997	TZ=MET-1MDT,M3.5.0/2,M10.5.0/3
	for    1997	TZ=MET-1MDT,89/2,299/3
	after  1997	TZ="MET-1MDT-2,M3.5.0/2:00,M10.5.0/3:00" (Sysadminclass)
	after  1997	TZ="MET-1MDT,M3.5.0/2:00,M10.5.0/3:00"	 (Chris)
			not sure if "-2" is needed or not
"...." can cause problems (date will show Thu Jan 27 17:14:26 "MET 2000)

untested hint:
1) the following works for Europe:
export TZ

2) Try reading comp.sys.sgi.* on oasis.  
TZ=CET-1CEST,M3.5.0/2,M10.5.0/3  <<<<<< the one to go for
which failed with Failsafe 1.2 and Informix so another choice:

It will set the time 1 hr forward on the lst sunday of the third month (
March) and change back to "normal" time on the last sunday of October.

date			show or set date
date +_%b%d_%y		_Jan21_98
date +_%b%d_%Y		_Jan21_1998
 -> use %d and NOT %e (%e will give a blank from the 1st until 9th)
/usr/etc/amtime1970	print current seconds since Jan. 1, 1970, or convert
			between local time and seconds since Jan. 1, 1970.
diff		differential file and directory comparator
gdiff		graphical diff
cmp		compare two files
sdiff		side-by-side difference program
/etc/init.d/cadmin [ start | stop | clean ]
called during system startup from /etc/rc2 to initialize the cadmin objectserver(1M) and directoryserver(1M)

if database is corrupted:
	/etc/init.d/cadmin clean
	or better:
/etc/init.d/mediad stop
/etc/init.d/cadmin stop
/etc/init.d/cadmin clean
/usr/lib/desktop/telldesktop quit
/etc/init.d/cadmin start
/etc/init.d/mediad start
fm -lrb &

more brutal method:
	# killall fm
	# mediad -k
	# killall objectserver
	# cp -pr /usr/Cadmin/classes /usr/Cadmin/classes.orig
	# rm /usr/Cadmin/classes/groupObject.op
	# rm /usr/Cadmin/classes/nisAccountObject.op
	# rm /usr/Cadmin/classes/peopleNISObject.op
	# rm /usr/Cadmin/classes/peopleObject.op
	# /usr/Cadmin/bin/parseclasses
	# /usr/Cadmin/bin/objectserver
	# ps -ef | grep obj
                --> when you see 2 objectserver processes running, do:
	if this fails:
	#par -siN open -l -SS /usr/Cadmin/bin/objectserver -d
	# mediad
	#fm -lrb&

check specially foranges in /etc/inittab and /etc/hosts (cat -v )
Debugging iso9660 mounts:
/etc/init.d/mediad stop
/usr/etc/mediad -f 	#start it in the foreground and write error message
			# to standard out
autoconfig	configure kernel

autoconfig -vf		
	-f forced
	-v verbose
cp /unix /
	at next system restart /unix.install will be automatically moved to /unix
mount / umount
umount -a	after issuing this command you have to do:
mount -t proc /proc /proc
		other wise ps won't work anymore
changes to etc/inetd.conf:

vi /etc/inetd.conf ; alter the file
to make it active:
killall -HUP inetd
 this will NOT restart the process , but the config will be reread
 can control with "par -sSSi -p <proc_id_of_inetd>" and then issue the kill command
ln -s existing_file link_file
ln <file1> <target>
Nice mechanisme to implement locking with hard links:
more than one processes should 
o check if a lock is set by creating a hard link

touch ./L.$$		# touch a tempfile with the own proc id
# try to link lockfile to L.$$:
ln ./L.$$ lockfile
# if successfull go on, do your tasks and at the end remove the file "lockfile"
# as long as this link is set, nobody else should be able to create such a link
# if not successfull stay in your loop and try again after a while
% touch L.1 L.2
% ln L.1 lockfile  	# successfully locked
% ln L.2 lockfile  	# lock will fail
May not unlink existing outplock  - Error 0
% rm lockfile		# release the lock
% ln L.2 lockfile	# successfully locked
% ls -li
63117 -rw-rw-r--    1 nick     user           0 Aug 13 10:53 L.1
63118 -rw-rw-r--    2 nick     user           0 Aug 13 10:53 L.2
63118 -rw-rw-r--    2 nick     user           0 Aug 13 10:53 lockfile
shutdown and startup:
wakeupat	Request that system power back on at a future time		
powerdown	stop all processes and halt the system

Automatically starting a system
O20??		MSC:	<Ctrl>t aut 1 
		PROM:	AutoLoad=Y 
		kernel:	reboot_on_panic = -1
Indy:		nvram -> rebound y

		autopower [y|n]
		AutoLoad [Yes | No]   (replaces "bootmode [m | c]
colorview	show available colors 
showrgb		uncompile an rgb color-name database
		show available colors
eurosign	see bug 785417 (I never got it to work) and bug 785478
Mail from Andy Heel:
"�" comes because your font does not support the euro symbol.

You need a iso8859-15 font (xlsfont | grep "iso8859-15" ),
and AFAIK you have to set LANG to your european Language.
(e.g. de_DE.ISO8859-15) (ls  /usr/lib/locale/)

If you need more fonts install x_eoe.sw.Xoptfonts.

Use cat euro.bin (attached) to test this.


1. winterm
2. setenv LANG de_DE.ISO8859-15
3. winterm -fn "-bitstream-*-medium-r-normal--15-70-*-*-*-*-iso8859-15"
4. cat euro.bin

euro.bin:	�
setenv TERM iris-tp
		set TERM at single mode
xfontsel	point & click interface for selecting X11 font names

usefule for exact xwsh:
xwsh --fn -sgi-haebfix-medium-r-normal--15-150-72-72-m-90-isoo8859-1
/usr/lib/X11/xdm -> ../../../var/X11/xdm
system wide xhost is set in:

Toolchest stuff:
$HOME/.chestrc	replace the system toolchest /usr/lib/X11/system.chestrc
$HOME/.auxchestrc	append to system toolchest
customize the popup menu that appears when the right mouse button
change the button bindings in /usr/lib/X11/system.4Dwmrc OR
override system defaults by creating a $HOME/.4Dwmrc file   -> man 4DWm

xev		print contents of X events
xmodmap -e "keycode 65 = Mode_switch Multi_key"
	After that <Shift> + <AltGr> ^ a 
	Won't work in tcsh

(disables pasting with the middle mouse button):
xmodmap -e "pointer = 1 5 3 4 2"

xlsfonts | grep 8859-1
xfd -fn -sgi-screen-medium-r-normal--15-150-72-72-m-80-iso8859-1
winterm -fn "-sgi-screen-medium-r-normal--15-150-72-72-m-80-iso8859-1"
winterm -fn "-sony-*-*-r-*-*-16-*-*-75-*-*-*-*"

xfontsel	choose your own font step by step
man ascii
xwininfo	window information utility for X
xprop		property displayer for X (get info about a specific window)
xlswins		server window list displayer for X

setxkeyamp fr_CH.xkm
xmodmap -e "keycode 65 = Mode_switch Multi_key" 
 -> then use <Shift> + <Right Alt> followed by a: -> will procuce adiaresis

The command being executed by the GUI is:
    /usr/bin/X11/setxkbmap -config
oxygen 21# cat //.desktop-oxygen/0.0/keyboard-cfg.xkb

you can put the setxkeymap command in
You can set the language via $HOME/.lang

LANG is defined systemwide in /etc/default/login
also PATH can be defined there (default path is taken from /usr/include/paths.h)
or in /etc/cshrc

setxkbmap de
setxkbmap us
setxkbmap de_CH		Umlaute only work in sh (not csh)
			see also /usr/lib/X11/xkb/symbols

xrm ressources:
xterm -xrm '*background: NavyBlue' -xrm '*foreground: yellow'
 for valid ressources check the definition files in /usr/lib/X11/app-defaults
 XTerm for xterm
 XWsh for winterm
winterm -xrm 'winterm.cursorTextColor: red'

Dual head:

I've been doing a little more investigation this morning and it looks like
the death grip interrupts the xdm parent process if you enter it on the
keyboard assigned to display 0. If you enter it on a different keyboard
that's assigned to another display, it interrupts only the child xdm
process that's assigned to that X display.

I also discovered that if I logout of X display 0's desktop, it also
terminates the other X display. I fixed this by changing the
DisplayManager._n.terminateServer:  statement to False in the
/var/X11/xdm/xdm-config file.

Put faces on the login desktop:
man clogin:	$HOME/.icons/login.icon

chkconfig noiconlogin	-> NO icons are displayed
			 instead /usr/Cadmin/images/cloginlogo.rgb is displayed
CONSOLE=/dev/console --> root connection is posible from console AND from xterm connections
CONSOLE=any_thing --> Nobody can connect as root directly. "su" must allways be used
CONSOLE=/dev/ttyd1 --> root connection is only posible from console in serial port 1. No xterm root
connections are posible.
  see also man xdm

CONSOLE=noXlogin effectively prevents ANY�direct root-logins on the system.
Users must login with normal user names.
To gain root access users will have to use the su command.

with CONSOLE=/dev/ttyd1 you will be able to login as root on the "console serial port".

Add certain programs that should be started ONCE when loging into the desktop:
cat $HOME/.sgisession
 xhost +
	see also 'Desktop User's Guide' in the book SGI_EndUser
Move window with numkeypad:
xmodmap -e "keysym Num_Lock = Num_Lock Pointer_EnableKeys"
then press <Shift>+<NumLock> (some times <CTRL>+<Shift>+<NumLock>)
-> now you can move the mouse with the num keypad

1,2,3,4,6,7,8,9		move the mouse
5       default pointer
0       locks default pointer button for dragging
.       unlocks
/       sets the default button to Button1
*       sets the default button to Button2
-       sets the default button to Button3

Unix Hints an Hacks/ Kirk Waingrow/ Ch 11.7
IMG		Indigo Magic Desktop  (man IMG)
toolchest	Menue
dirview		desktop manager
ov		desks overview tool
4Dwm		not invoked by end user

iconsmith	graphical interactive drawing program
colorview	An X11 program that displays a color patch and a list of
     color names from an X11 rgb database

man 4Dwm	The IRIS Extended Motif Window Manager

nm		print name list of an object file(s)
nm /usr/lib/libspaceball.a
typical linker error message:
ld:error 33: unresolved text symbol "dbtext" -- first referenced by usr/lib/
libspaceball.a (spaceball.o)
***error code 1 (BU21) 

elfdump		dumps selected parts of a 32-bit or a 64-bit ELF object file
elfdump -Dl <programm>	show used share objects
odump		dumps selected parts of an object file
file <executable> will show if it is a 32 N32 or 64 compiled image

Octal dump:
od - octal dump
od -x 		Interpret words in hex.
od -c		Interpret bytes as characters
Networking stuff:
par		system call tracer
par -s -SS -p <pid>
par -SS -s -i -l -n 
par -siN open -l -SS /usr/Cadmin/bin/objectserver -d
par -isSS -l -o /tmp/os1.par /usr/Cadmin/bin/objectserver -l 7 -d
par -s -SSS -i -N write -a 4096 -b 4096 -o /tmp/output-file -p PID
   will trace process #PID and all its subsequent children.
   The arguments to write() system calls will be logged, including up to
   4096 of ascii (a) or binary (b) data from the buffer given to write()
par -rsSSQQ -o inst
par -ilsASSQQQ -o /tmp/date_a date 10

traceroute	print the route packets take to a network host
ping		send ICMP ECHO_REQUEST packets to network hosts
		ping -c 1 -R <targethost_name>  show routes (-c counts)
netstat		show network status
		-r show routing
netstat 5	# show packet status every 5 seconds
		# first line shows the total, further lines show delta
		# perfect to watch if we have further collisions

		netstat -ia 2
		netstat -I ec0 2
		netstat -s -p tcp
		netstat -C  
     To match a socket to a process, the fuser(1M) command can be used.  For
     example, the command

          fuser 25/tcp

     will display information about any processes listening on TCP port 25.
     Note that fuser requires the numeric value for the port, not the name of
     the service.  The -n option will force netstat to display service
     information numerically.

route		manually manipulate the routing tables
route add default <IP-addres_gateway> 1 ????????
Ex: 	route add -net <destination> <gateway>
	route add -net 193.187.200
add it permanently to /etc/config/static-route.options

add default route to gateway
route add -net default

route -n monitor	# monitor any changes in the routing table
			# normally nothing happens

# Very useful when we want to know through which interface we go
# when connecting to a remote system:
route get <hostname>	# get info about the route to that host
route get <IP-address>

smtstat		show FDDI SMT status
smtstat -C	# check 5 for neighbourhood (or use fddiviz)
nslookup	query Internet name servers interactively
nslookup > ls -d		# dump the whole map
 nslookup -query=mx sgsc 
 nslookup > set querytype=MX
> preference = 10, mail exchanger =

Authoritative answers can be found from: nameserver = DNS.NETSTREAM.CH nameserver = DNS2.NETSTREAM.CH    internet address =
DNS.NETSTREAM.CH        internet address =
DNS2.NETSTREAM.CH       internet address =

netsnoop	capture and decode network traffic (like snoop on SUN)
/usr/sbin/netsnoop -vvv "(ip.src ==||ip.dst == ("

		IRIX 6.2 (PART 1 OF 2) eoe.sw.ipgate
snoop 		similar to netsnoop but for IRIX 6.3 and later (nfs.sw.nfs)

snoop -o snoopfile.out  <host> <host> rpc ypserv 	capture all rpc packets between the 2 hosts
snoop -v -i snoopfile.out	look at the file snoopfile.out
snoop -o /var/tmp/snoop.out arp		look at all arp broadcasts
snoop port 25	watch the mail port (defined in /etc/services)
snoop port 53	watch DNS queries (find out who is dnsserver)
snoop -d lo0 rpc nfs	watch nfs queries on loopback interface (also see /etc/rpc)
snoop rpc mountd	watch how partitions get mounted and umounted
snoop -o /tmp/snoopfile.out
	Truncate each packet after snaplen bytes -s <snaplen>
	save lot of disk space
	snoop -o /tmp/snoopfile.out -s 140

snoop -d eg1 "lion not mahagoni"	# watch traffic on interface eg1
					# snoop all packets from or to lion
					# disregard packets from or to mahagoni

snoop "not pinky not punky"		# snoop all packets except for pinky and punky

look at the captured snoop packages:
snoop -i /tmp/snoopfile.out			get overview
snoop -i /tmp/snoopfile.out -V			verbose overview
snoop -i /tmp/snoopfile.out -v -p 10,15		look at packets 10-15

rpcinfo -p <hostname>
rup		show host status of local machines (RPC version)
		rup -l <hostname>
proclaim	client for Dynamic Host Configuration Protocol (DHCP)
portmap		TCP,UDP port to RPC program number mapper
		(Not for ordinary users)
arp		address resolution display and control
		arp -a ( before issue a ping <broadcast.address>
		looked up by ifconfig ec0)
arp -av		show add. info such as the interface associated with entries and age of the entry
rup		show host status of local machines (RPC version)
ruptime		show host status of local machines
nfsstat		display Network File System statistics (/usr/etc/)
		-s (server) -c (client) -z (reset statistics)
ttcp		test TCP and UDP performance
ipfilterd	see also WebFORCE Firewall Admin Guide

ttcp usage:	one host will send, the other will listen
on the transmitter host:
# ttcp -t -s -fm <reciever-host>
on the reciever host:
# ttcp -r -s -fm
	-fm means result in the format (f) Mbit/sec (m)

basic network files:
/etc/sys_id, /etc/hosts, /etc/config/ifconfig-?.options (netmask)

/etc/protocols, /etc/services, /etc/networks, /etc/gateways
/var/yp/ypdomain (NIS) (if NIS domain != internet domain)
process related stuff:
man 5 signal:
    Name         Value   Default   Event
    SIGHUP       1       Exit      Hangup [see termio(7)]
    SIGINT       2       Exit      Interrupt [see termio(7)]
    SIGQUIT      3       Core      Quit [see termio(7)]
    SIGILL       4       Core      Illegal Instruction
    SIGTRAP      5       Core      Trace, Breakpoint, Range Error
                                   Divide by Zero, or Overflow Trap
    SIGABRT      6       Core      Abort
    SIGEMT       7       Core      Emulation Trap
    SIGFPE       8       Core      Arithmetic Exception
    SIGKILL      9       Exit      Killed
    SIGBUS       10      Core      Bus Error
    SIGSEGV      11      Core      Segmentation Fault
    SIGSYS       12      Core      Bad System Call
    SIGPIPE      13      Exit      Broken Pipe
    SIGALRM      14      Exit      Alarm Clock
    SIGTERM      15      Exit      Terminated
    SIGUSR1      16      Exit      User Signal 1
    SIGUSR2      17      Exit      User Signal 2
    SIGCHLD      18      Ignore    Child Status Changed
    SIGPWR       19      Ignore    Power Fail/Restart
    SIGWINCH     20      Ignore    Window Size Change
    SIGURG       21      Ignore    Urgent Socket Condition
    SIGPOLL      22      Exit      Pollable Event [see streamio(7)]
    SIGIO        22      Exit      input/output possible signal
    SIGSTOP      23      Stop      Stopped (signal)
    SIGTSTP      24      Stop      Stopped (user) [see termio(7)]
    SIGCONT      25      Ignore    Continued
    SIGTTIN      26      Stop      Stopped (tty input) [see termio(7)]
    SIGTTOU      27      Stop      Stopped (tty output) [see termio(7)]
    SIGVTALRM    28      Exit      Virtual Timer Expired
    SIGPROF      29      Exit      Profiling Timer Expired
    SIGXCPU      30      Core      CPU time limit exceeded [see getrlimit(2)]
    SIGXFSZ      31      Core      File size limit exceeded [see getrlimit(2)]
    SIGCKPT      33      Ignore    Checkpoint warning [see cpr(1)]
    SIGRESTART   34      Ignore    Restart warning [see cpr(1)]
    SIGRTMIN     49      Exit      POSIX 1003.1b SIGRTMIN
    SIGRTMAX     64      Exit      POSIX 1003.1b SIGRTMAX
xman		X11 manual pages
Print man pages:
man -c ppp >ppp_man.txt ; lp -d<printername> ppp_man.txt
Put it into a file for access with vi
man -c ppp | col -b > ppp_man.txt
pcat csh.z | imprint -l
man -p <command>	show commands that would be executed for formatting
man 4 passwd	Show section 4 of passwd
apropos		locate commands by keyword lookup (~man -p
Compress and uncompress:
pack,pcat,unpack	compress and expand files (Huffman coding)
gzip, gunzip		compress and uncompress files
			Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP
compress		(LZW-algorithm)
zip,unzip         usr/freeware/bin/zip
			works fine for archives compressed on NT

tar cf - nsmail | gzip -c | crypt my_secret_password > nsmail.packed

cat 		-v 	print non ASCII Charachters

File Transfer via email:
-make package with tar (cd /source/dir ; tar -cvf source.tar ./dir_or_file)
-compress source.tar  (will create source.tar.Z)
-make a ASCII version out of it
 uuencode source.tar.Z source.tar.Z > source.tar.Z.uu
- this can be sent as an attachment via email
   ex: mailx -v -s "sending source.tar.Z.uu" < source.tar.Z.uu

to unpack :
-save attachement as /any/dir/source.tar.Z.uu
-uudecode source.tar.Z.uu
-uncompress source.tar.Z ( ->source.tar)
-tar -xvf source.tar

tr		translate characters
		Ex: tr -d "[\200-\777]" < filename > filename2
		delete all control characters in "filename"
		cat xx | tr -s "[a-z]" "[A-Z]"  (convert all lower to upper)
get rid of the ^M in a file (saved with Netscape)
cat -v file.txt | tr -d /^M/ > cleanfile.txt
or better:	cat file.txt| tr -d '\015' > cleanfile.txt
do the same job in vi:
  :g/^M/s///g		(^M has to typed as '<ctrl><v><m>')
	and another solution:
sed 's/^V^M//g' foo >

  convert from Macintosh file to Unix Ascii (Mac files contain lots of ^M)
	#Octal: \015 (^M CR Carriage Return) ; \012\ (^J LF Line Feed) 
  cat file.txt | tr -s "\015" "\012"	

show each directory of PATH on seperate directory:
alias pa 'echo $PATH | tr -s "[:]" "\n"'

cut -d<delimiter> -f<field>
cut -d":" -f3 /etc/passwd	print all UID's of /etc/passwd
cut -d":" -f3 /etc/passwd | sort -n | uniq
cut -d":" -f3,1 /etc/passwd	also show the username

cut -c0-20 <file>	print character 0 until 20 of each line in <file>
			first character is 0
1.) /usr/etc/netstat -ia | grep 08:00 | sed 's/ *//;s/://g' | head -1 | tr '[a-f]' '[A-F]'

2.) nvram | grep eaddr | cut -d= -f2 | sed -e s/://g | tr '[a-f]' '[A-F]'

3.) sysinfo | grep -v System | sed 's/00//g' | sed 's/ //g;2s/^/0800/' | tr '[a-f]' '[A-F]'

paste	merge same lines of several files or subsequent lines of one file

4.) replace in /etc/fstab the word vol_usr with vol_usr_plex:

 sed 's/'vol_usr'/'vol_usr_plex'/g' /etc/fstab > /tmp/fstab.cloned
the serach patterns can also be replaced by variables:
sed 's/'$xlv_usr'/'$d3_xlv_usr[$nxlv]'/g' /etc/fstab  > $tmpmnt/etc/fstab

same function can be implemented with perl see also UGU:
perl -p -i -e 's/original text string/replacementstring/g' <filename>

list perm, size and name:
ls -lt | tr -s " " | cut -d " " -f1,5,9
drwxrwxr-x 103 develop
-rw-rw-r-- 6639 examples.html

sed replace string:
echo "hallo world" | sed -e s/world/$VARIABLE/g
  hallo nick

set VARIABLE = nick
echo "hallo world" | sed -e s/world/$VARIABLE/g
 hallo nick

guenstig um das in einer Schlaufe zu verwenden
/usr/etc/macconfig	ha.sw.base

man ascii	map of ASCII character set /show ASCII Table
Trouble to remove a special file:
ls -i		list file by inode
clri		clear inode (elete file by inode)
		should only be used for efs filesystems
		for xfs filesystems use xfs_check and xfs_repair(repeatedly)

Filesystem repair:
/usr/sbin/xfs_repair	(comes with patch1422 in IRIX 6.2)
xfs_repair  /dev/rdsk/dks0d2s0     do it on the raw device


Memmory and processes:
pmem		report per-process memory usage (/usr/sbin/pmem)
		belongs to package "pcp.sw.monitor /Performance Co-Pilot for IRIX 6.2, 1.2"
ps 		report process status
gmemusage	graphical memory usage viewer
gr_osview	graphical system monitor
osview		ASCII system monitor
gr_top		display processes having highest CPU usage in a window
top		display processes having highest CPU usage
top -o mem	sort processes by size of memory used
xload		CPU load with history

# sar -f /var/adm/sa/sa01	What was the system activity at the first of this month ? only for root
# sar -d -f /var/adm/sa/sa21 -s 07:30 -e 09:30
  show disk activity (-d) on 21st of this month between 07:30 and 09:30

Sar data is collected by crontab of user sys with script /usr/lib/sa/sa1 (every hour)

more about sar:
best to watch system for a certain period and save all data into a file
sar -A -o /var/tmp/sar.log 10 5
 -A all options combined
 10 delay of 10 seconds
 5  take 5 samples

then look at all the details by reading from that log:
sar -U -f /var/tmp/sar.log	# per CPU utilization, similar to -u
sar -D -f /var/tmp/sar.log	# Disk
sar -w -f /var/tmp/sar.log	# swap

more about top:
use the option '?' within top; Ex press 'o' and type 'res'
 this will sort the processes by RES memory size
 can also be achieved with command:
top -o res
par:		process activity reporter / truss-like system call tracer

Example:	#par -s -i -N open  -o filename -l -SS /usr/Cadmin/bin/objectserver -d

see also padc

ifconfig ec0 debug	Turn on Network debugging
ifconfig ec0 -debug	Turn off Network debugging

nm		print name list of an object file(s)  (compiler_dev.sw.util)
stat		display stat attributes of named files
		stat $HOME/xx
file		determine file type
		see also /etc/magic for the various types
		looking for a speacial type of file in the filesystem
		for exapmple type "Arena"
find . -local -type f -print -exec file {} \; |grep Arena
find . -local -type f -print -exec grep <search_pattern> {} \;
	List only the files which contain a certain search pattern:
	find . -type f -exec grep -il <search_pattern> {} \;
List the search pattern proceeded by the filename:
# good one:
!!! # find . -type f -exec grep "string or options" /dev/null {} \;

fgrep TZ `find /etc -type f -print` search for strin "TZ" in all files in /etc
cd some/dir; grep "pattern" */*
find / -local -type f -size +20000 -print
		Print all files which are larger than 10MB
find / -local -type f \( -name core -o -name dead.letter \) -atime +7 -mtime +7 -

Henk:	find . -name \*\['\126',a\]\* -print
	find all files which contain the tilede (~) and an "a" in their name

lists all set-UID files owned specifically by root
find / -user root -perm -4000 -exec ls -l {} \;
find / -local -perm -4000 -exec ls -l {} \;		# list ALL SUID files

a nice one:####################################
Find all the files which were modified on 24.June:
 touch -t 06251012 /tmp/june25
 touch -t 06231012 /tmp/june23
 find / -local -newer /tmp/june23 ! -newer /tmp/june25 -exec ls -l {} \;

If you would like finer granularity than a day, then you might try this:
touch 07040330 first_time
touch 07040415 last_time
find . \( -newer first_time ! -newer last_time \) -print

Find all files which are NOT named index* :
find . -type f ! -name "index*" -print
clean up /tmp and /var/tmp but don't remove sockets:
| 30      0       *       *       *       find /tmp /var/tmp -depth \ 
| -atime +7 -print 2> /var/tmp/clean_tmp.log | xargs rm -f
find /tmp /var/tmp -type f ... 
That way, no symlink/socket/directory/pipe will be removed

filetype	determine filetype of specified file or files (only IRIX ?)
strings		find printable strings in an object file or binary

Crash analysis:
icrash		IRIX system crash analysis utility
	icrash unix.43 vmcore.43.comp
	corefile = vmcore.43.comp, namelist = unix.43, outfile = stdout

echo t -a -w <filename> | icrash
# icrash -e "trace -a" -w /tmp/trace_output

indee02 8# ls -l core
-rw-r--r--    1 root     sys      6673948 Oct 24 11:05 core
indee02 9# file core
core:           IRIX core dump of 'swmgr'
indee02 10# dbx /usr/sbin/swmgr core
dbx version 7.2 Aug 29 1997 03:27:55
Core from signal SIGSEGV: Segmentation violation
(dbx) t
>  0 <Unknown>() [< unknown >, 0x5f2e70b4]
(dbx) wi
 [???, 0x5f2e70a0]      addiu   sp,sp,-48
 [???, 0x5f2e70a4]      sw      ra,28(sp)
 [???, 0x5f2e70a8]      sw      gp,24(sp)
 [???, 0x5f2e70ac]      move    a3,a0
 [???, 0x5f2e70b0]      move    a2,a1
*[???, 0x5f2e70b4]      lw      t6,0(a3)
 [???, 0x5f2e70b8]      beq     t6,zero,0x5f2e70c8
 [???, 0x5f2e70bc]      nop
 [???, 0x5f2e70c0]      bne     a3,zero,0x5f2e70d0
 [???, 0x5f2e70c4]      nop
(dbx) q
in order to use dbx the object file has to be compiled with the option '-g' 
(which is the "not stripped" versions)
dbx [options] [object_file [corefile]]

elfdump, odump			dumps selected parts of an object file
elfdump -Dl /usr/etc/mediad	Dumps library list in dynamic shared objects
mpadmin         control and report processor status
-s		A summary of the unrestricted, restricted, isolated, preemptive
		and clock processor is printed to the standard output

fuser	identify processes using a file or file structure
     -u	  give process id AND username
     -c   may be used with files that are mount points for file systems.  With
          that option the report is for use of the mount point and any files
          within that mounted file system.
fuser -c /CDROM		which processes still using files 
			useful for umounting 
fuser 25/tcp	which process is using port 25 via tcp ?
sysconf		get configurable system variables (POSIX)
sysconf | grep PAGE	get pagesize of the system
pathconf	get configurable pathname variables (POSIX)
mkfile		create a file 
ex: mkfile 5m bigfile	create a file called "bigfile" with the size 5MB
sum		print checksum and block count of a file
		sum -r <file>
Backup commands:
Moving trees:
cd /source/dir
find . -depth -print | cpio -o | rsh <remhost> "cd /target/dir; \
cpio -ipdm"

cd /source/dir
find . -depth -print | cpio -ovBc -O /dev/tape

cd /source/dir
tar -cvBf - ./docu | rsh guest@burn "cd /space1/nick; tar -xpBf -"

how to find out WHICH file has a bad block on the disk
(cpio will terminate at read error !)
find . -print | cpio -ovBc -O /dev/null > /var/tmp/log1 2>/var/tmp/err1
(find . -print | cpio -ovBc -O /dev/null > /var/tmp/log1 ) >& /var/tmp/err1
an then:
find . -print | tee /var/tmp/log2
	last entry in /var/tmp/log1 is the name of the last file which is ok
	so we have to look for the NEXT file in log2

xfsdump -f guest@ocracoke:/dev/tape -l 0 -L Backup_lion_nick -s nick /d2
means:		-f <device>
		-l <level>
		-L <session_label>
		-s subtree
xfsdump -J  -f /dev/tape -l 0 -o -M chita -L chita_MyLib /MyLib
		-J inhibits the normal update of the inventory
		-o Overwrite the tape
		-M <media label>

xfsdump over network (not tested):
xfsdump -l0 - /source_dir | rsh root@remotesys "xfsrestore - /target_dir"

Primus ID: 3.0.9096944.2817482
To copy /usr/people/fred to the network host magnolia's /usr/tmp directory:
# xfsdump -J -s people/fred - /usr | rsh magnolia  xfsrestore - /usr/tmp
This creates the directory /usr/tmp/people/fred on magnolia.
Note: The superuser account on the local system must be able to rsh to the remote system without a password. For more information, see hosts.equiv(4). 

call xfsdump from within a script and restore from tape --> use -F
-F	Inhibit interactive operator prompts
# xfsrestrore -F -f /dev/tape /tartget_file_system  >&! /var/tmp/restorelog

Be aware that if there is already data on the tape written by xfsdump, another xfsdump
will append after the previous dumpprevious. If not desired use the option:
	-o 	Overwrite the tape
full backup used by graphical 'Backup & Restore Manager' :
Backup :   /sbin/cpio -KWovO $TPDEV 

IRIX 6.5.12:   cpio -o -K -W -v -C 131072 -M MediaFull -O /d2/backup.cpio
Restore : cpio -iudvk -I $TPDEV $RDIR
 Take care with -W option of Backup : see bugg 752381, call FF30652

get a specific directory save with System Backup:
# cd /
# cpio -iuvdk -C 131072 -I guest@zkir40:/dev/tape disk1/wang/\* >&! /var/tmp/restorelog
!!!! don't use "./disk1/wang" and don't use "/disk1/wang" neither of them will work !!!

How was this tape drive written ? ->try List_tape
lion 21% List_tape -h speedy

Tape listing started.  Please wait...
Backup is a tar archive

rwxrwxr-x 12831/20 dir           Oct 26 13:12 2000 tmp/
Recovering from an Unbootable Kernel: 
Enter Command  Monitor from PROM:
>> sash
>> ls dksc(0,1,0)/
>> boot -f /
when system is up:
cp / /unix
PROM Variables:
fastfan		set speed of fan for Octane[not set or |1]
ec0mode		Ethernet mode for O2
resetenv	reset variables to factory settings
rebound y	restart system after crash (Indy,..)
find & grep
find . -type f -print -exec grep <search_pattern> {} \; |more
find . -i <inode_nr> -print
grep -n . <filename> 	Precede each line by its line number in the file
			(first line is 1)
grep "^<pattern>"	search pattern that starts at the beginning of line
grep -v '^\#' /etc/fstab  search for all lines which don't begin with #
egrep		egrep 'pattern1|pattern2' <file>
egrep -v ^awf:.*unknown|^Broken pipe 

grep -v ^$ <filename>		get rid of all the empty lines in a file
grep -l <pattern> <file>	only list filenames containing the <pattern>
diskpatch	prevent stiction problems with some disk drives
		is run by cron 
nwrecover	/usr/etc recover from Backup
nsrcap -v	(if trouble with license; editing license.dat)
see also ~nick/info/applications/networker/commands
at 0815am Jan 24

that works:
lion 3% at 1015am Apr 16
mailx -s "9GB Disk fuer Nick nicht vergessen" </usr/people/nick/template/remind_hans
       warning: commands will be executed using /bin/sh
job 924250500.a at Fri Apr 16 10:15:00 1999

that works: :--))
% at 0900am Aug 2 
echo "Auf sgsc /service/nsr loeschen\nGruss Nick" >/tmp/$$
mailx -s "your subject" </tmp/$$
rm /tmp/$$

for different formats of months or weekdays consult:
Printing stuff:
System V:
lp , cancel
lptest		generate lineprinter ripple pattern
enable <printername> ; disable <printername>
/usr/lib/lpadmin -x<queuename>		Delete this queue
/usr/lib/lpadmin -d<queuename>		Make this the new default printer
lpstat -t
lpstat -o	all open jobs
addclient	allow remote printing clients to connect

get more details in /var/spool/lp/log:
lp -d phaser850 -o"verbose" /tmp/tesfile

Unsupported printers in impressario:
/var/spool/lp/PPD_untested/<vendor>/	impr_print.sw.ppd_unsupported
have to be copied to /var/spool/lp/PPD_model

Test files (impr_dev)

HP Laserjet 2100 supported ?
	If it's a postscript printer and you have a winNT/95/98
	driver for it, then extract the .ppd file from the driver
	and put it into /usr/spool/lp/PPD_MODEL
	If its PCL I don't know. 

Print man pages:
man -c ppp >ppp_man.txt ; lp -d<printername> ppp_man.txt
pcat csh.z | imprint -l

Fun  with Printers

/var/spool/lp/log	log file since last reboot
			interface script (BANNER=0  <- no banner page)
			more variables: raw, CONVTYPE
/usr/spool/lp/.rhosts	access to printer OR
addclient -a		put a "+" in /usr/spool/lp/.rhosts

mknetpr			add a network printer
Special options:
lp -o landscape		Print landscape; 
			see /var/spool/lp/interface/<yourprinter>
			for more options
location of global and personal printer seetings:

Print from NT to Unix:
Samba printing does not work as smooth as expected. 
To print on SGI paper on the hp4050 do the following:
On NT:
o print document, but use 'print to file'
o save the file on UNIX

Now put in the desired paper in TRAY 1
on UNIX:
o lp -d hp4050_tray1 -o raw <your_filename>

Printing troubleshooting guide:
I. Uninstall and then reinstall all of the print.sw stuff

II. Enable debug in the interface script, look in the directory 
/var/spool/lp/interface, you should see files that are named the same as 
any printers you created.

	1. Edit the file in question.  At the top of the file you will see 
         a line that looks like this:


	   Change it to look like this:

		#!/bin/sh -x

	   Save the change and exit the editor.

	2. Try to print something short and simple:

		cat <filename> |lp -d<printer_name>

		cat /etc/hosts |lp -dsgiprinter

	3. The debug output should end up in the /var/spool/lp/log file and 
         look like the script commands executed.

	4. Print with the debug option 'verbose'
		lptest >/tmp/testfile
		lp -d<printer_name> -o"verbose" /tmp/testfile

III. Make sure you have the following subsystems install.
	1. do a versions |grep impr_   
		output should  show -  impr_print.sw.laserjetPS,,, impr_base.sw.impr, impr_base.books.Impr_UG, plus any others you may want to include.  
	2. Check out the Impressario release note for more info  
         (grelnotes impressario).

      To test connection for a IP addressable printer check out the following:

IV. One test to try is telnet to the IP address and port number of the 
		Exp: telnet 9100  ( or 515 -std bsd port)

		where is the IP address and 9100/515 is the 
		port number.  If that succeeds w/o error messages. You should 
  		see something like:

			$ telnet 9100  -OR-  telnet 515
			Connected to
			Escape character is '^]'.           # this indicates a 

			^]                                 # type 'Ctrl ]' to break the 

			telnet> quit                       # then 'quit' to exit
			Connection closed.

	Check the printer documentation to make sure which network port the printer
	is listening on.  If necessary either change the configuration inside the
	printer to conform, or modify /var/spool/lp/interface/<prtrname> to use a
	port that matches the printer as in the following excerpt from one of the
	networkable model files:

		# Network port to write to.  9100 is HP Jetdirect card and EX.
		# The JetDirect 3Plus EX uses 9100, 9101, and 9102 for ports 1, 2, and 3.
		# Many other vendors use same port as HP.  OUTSOCK is port to write to.
		# INSOCK is socket to read for status (for future use -- status
		# now read from same socket address as specified a by OUTSOCK).


The good general test is to take a file that should be printable by the printer, 
ie: /usr/lib/print/data/ for a postscript printer and 
then: "cat /usr/lib/print/ > /dev/plp".  This will bypass all the printing 
spooling stuff and blow the file right out the parallel port to the postscript 
printer, and if the basic hardware is ok it should print it.

# quick script to redirect the output of lpr to the default printer
# under the local lp spooler.
# to change the destination of the lp, add -d<printername> to the end
# use this script with a printcap entry of the form:
# fake|fake printer:\
#       :lp=/dev/null:of=/etc/lpr2lp:
cat - | lp
Add page break to a ASCII file in vi:
type in insert mode:	hold down <ctrl> and press <V> then <L>
vi will then show ^L (as one character)
Convert Hexadezimal to Binary
lion 13% bc                     ibase is Input Base
obase=2                         obase is Output Base


!! Die Buchstaben [A-F] muessen gross geschrieben sein
        --> else syntax error

1) Hex  -->     Bin
ibase=16        obase=2

2) Hex  -->     Dez
ibase=16        obase=10

3) Dez  -->     Hex
ibase=10        obase=16


2			  1
4			  2
8			  3
16			  4
32			  5
64			  6
128			  7
256			  8
512			  9
1024		1k	 10
2048			 11
32768			 15
1048576		1m	 20
2097152			 21
4194304			 22
8388608			 23
16777216		 24
33554432		 25
1073741824	1GB	 30
34359738368		 35
1099511627776		 40
140737488355328		 50
Calculate (csh):
@ a = 10
@ b = 5
expr $a / $b
 -> 2
expr 88893360 / 1024

increment a:
a=`expr $a + 1`

Error messages:
/var/adm/SYSLOG		(also see /usr/sbin/sysmon ; graphical SYSLOG filter)
/usr/lib/sysmon/notifier.config	config file for GUI messages

sysmon		System Log Viewer (graphical)
syserr		System Error Notification Broker

xconfirm	general purpose dialog box	
xconfirm -header "Hey you" -t "Ready to talk to me?  --Nick" -b No -B Yes
/usr/bin/X11/xconfirm -display :0.0 -header Confirm -icon question -B No -b Yes
xconfirm -c -B yes -header "hey you!" -t "call Jean Louis" -icon info \
	-geometry 300x200
xconfirm -t "Modem funktioniert" -t "Gruss Nick Wildi / SGI " &

/etc/issue	Message (will be displayed BEFORE login)
/etc/motd	Message of today (will be displayed after succesfull login)
Digital Media:
dmconvert	digital media file conversion utility
/usr/sbin/soundplayer -nodisplay <filename>
Media Base backup tool:
videopanel  (same as vcp) video control panel (graphical tool)
		settings are stored in /usr/etc/video/videod.defaults
vlinfo		Video Library path, node and control info tool
mediaplayer (movieplayer)
dmplay		play movie
dmconvert	convert from different formats
 Ex: extract 'frames' from a MPEG1 file named filename.mpg
dmconvert -f jfif -p video -n out#.jpg filename.mpg out#.jpg      OR
dmconvert -v -f rgb -p video,rate=24.0000,il=none,size=orig -n \
  ./outfile#.rgb,start=0,step=1 /disk2/filename.mpg ./outfile#.rgb

If anyone wants to use the GUI tools, there is yet another way.
I find this helpful to visually find a specific frame in the mpg file.
Open the file in  moviemaker (open read only)
  In moviemaker view as filmstrip
  Find the frame you want to extract and click.
  Copy this to the clipboard (edit->copy / right click on frame->copy)
  File->Export As (select format and filename)



DIVO diagnostics:

Sirius test tools

A color television standard or timing format encoding all of the color, brightness, 
and synchronizing information in one signal. NTSC uses a total of 525 horizontal lines 
per frame, with two fields per frame of 262.5 lines each. Each field refreshes at 60 Hz 
(actually 59.94 Hz). (from O2: Silicon Graphics 1600SW Flat Panel Inst Instruct)

from Sirius release notes
NTSC (640x486_301) or PAL (768x576_25i)
apanel		graphical Audio Panel
audiopanel -nodisplay -nofork -outlevels 10	(set low audio level)
soundplayer	graphical Sound Player
soundplayer -nodisplay	01.african.thumb.inst.aifc
cdman		graphical CD player
datman		graphical DAT player
soundfilter	IRIX 5.3
mediaconvert	IRIX 6.2
xset		set volume of keyboard bell (xset b off ; xset b 45)
/etc/nvram volume <XX>		0 < XX < 255	(Volume of bootup sound)
xset b off;xset b on	after Windd has changes the sound off the bell
xset q		check the current settings

	auto-repeat speed of keyboard (-art [timeout] -ari [interval])
xset -art 25 -ari 1	# fast

most of that is defined in ~/.desktop-<hostname>/panelsession

midikeys	start a midi keyboard



echo "\07"	ring the bell (csh,sh)
echo $'\a'	ring the bell (sh)
How to resize your window to a certain size (xwsh):
 echo "\033[203;3;80/y"		# resize it to 3 lines 80 coloumns
 echo "\033[203;80;100/y"	# 80 lines 100 coloumns

more explained in detail:
>From the manual page xwsh
     CSI Pv m

     describes a sequence that begins with CSI ("control sequence introducer")
     followed by zero or more semicolon separated numbers followed by the
     character "m".  ESC ("escape") expands to "\033".  CSI expands to either
     "ESC [" (escape left-bracket) or to "\233".  DCS ("device control
     string") expands to either "ESC P" (escape capital-P) or to "\220".  ST
     ("string terminator") expands to either "ESC \\" (escape backslash) or to

So the CSI is documented to be "ESC [".  To resize the window:

      CSI Pv / y  xwsh command.  The first parameter to this escape sequence
                  is the particular command described in the table that
                  follows.  Each command has different numbers of arguments
                  which are described below.

           203  Set the window size by row and column.  This sequence takes
                three parameters.  The first is 203.  The second parameter is
                the number of rows to use.  The third parameter is the number
                of columns to use.

So to resize to 60 columns and 30 rows, you'd do

        echo '^[[203;30;60/y'

Here '^[' is the rendition of the ASCII escape character.  It depends a bit
on your shell how you can access it.  Control-V ESC is a good bet with many
again echo combined with different *-terms
Perhaps this little trick to set the title/decoration of 
wsh will help illuminate the man page.

$ cat title1 

case $TERM in
                /bin/echo "\033]0;$1\007"
                /bin/echo "\033&f0k${#1}D${1}\033&f-1k${#1}D${1}\c"
                /bin/echo '\033P1.y'$1'\033\\\033P3.y'$1'\033\\\c'

echo magics of echo
change the title in a xwsh:
echo "\033P1.yyourTitle\033\\"
change the iconname of the a window:
echo -n "\033P3.yhallo\033\\"

script from my .cshrc which changes the title of my xwsh to
what ever directory I'm in:

if ($?TERM) then
    if ($TERM == iris-ansi || $TERM == iris-ansi-net) then
        alias update    '/bin/echo "\033P1.y`hostname`:${cwd}\033\\\c\033P3.y`hostname`\033\\\c"'
        alias pupdate   '/bin/echo "\033P1.y"\!*"\033\\\c\033P3.y"\!*"\033\\\c"'
        alias pushd     'pushd \!*; update'
        alias popd      'popd \!*; update'
        alias rlogin    'pupdate \!*; /usr/bsd/rlogin \!*; update' 
        alias rl        'pupdate guest@\!*; /usr/bsd/rlogin \!* -l guest; update'
        alias cd        'cd \!*; update'
Here's another script that is a bit more general; supports both xterm
and winterm

# usage: title "text here in $1"
## for xterms:
#ESC ] Ps ; Pt BEL
#Ps = 0        -> Change Icon Name and Window Title to Pt
#Ps = 1        -> Change Icon Name to Pt
#Ps = 2        -> Change Window Title to Pt
#Ps = 46       -> Change Log File to Pt (now normally disabled by a 
#                 compile-time option although not the case in the past; it's
#                 a security hole that allows people to overwrite arbitrary 
#                 files accessible to the person running xterm)
#Ps = 50       -> Set Font to Pt
## echo "\033]2;This is the new title\007"

## \033 = ^[
## \007 = ^G

case $TERM in
                echo -n "\033]2;$1\007"
                echo -n "\033P1.y$1\033\\"
                echo "unknown term type $TERM"
Below is my little perlscript that runs after every cd command I issue:
I call it 'wintitle' and keep it in my ~/bin directory
Mind the escape characters.. This is all extracted from the manpage of xwsh

This is how I set it up in my .cshrc file (based on csh, but it also
works great in tcsh, which is my now-favorite)

if ( $?prompt) then
        alias cd 'set old=$cwd; chdir \!*; setprompt; wintitle ${host}:$cwd'
        #setprompt alias here...

Good luck

# wintitle changes the icon and title words of a winterm sessions to the argument(s) given
print "P1.y$ARGV[0]\\";
print "P3.y$ARGV[0]\\";
set prompt for Csh:
set prompt = "%n%U%m%u %C% "		# username @ hostname (underline) Trailing component of cwd
set prompt = "%?" 			#return code of previous command
bitmap		Bitmap editor
ImageVision Tools:
imgview ,imgworks,imgformats,imginfo,imgcopy
imgworks:       visual tool for enhancing image files (graphical user interface)

% imgformats

The following formats are supported by the ImageVision Tools:
    Kodak PhotoCD overview (PCDO) (read only)
    IL TCL script image (ilTCL)
    FIT image (FIT)
    Classic SGI image (SGI)
    JFIF/JPEG image (JFIF)
    Raw image (Raw)
    TIFF image (TIFF)		(Tag Image File Format)
    PNG image (PNG)
    PPM image (PPM)
    YUV image (YUV)
    Alias image (Alias)
    GIF image (GIF)                             *.gif
    Kodak PhotoCD image (PCD) (read only)

Other tools:
acroread		read *.pdf files (no *.eps nor *.tiff files)
vstiff			read *.tiff files
ghostview, ghostscript
psrip			/usr/lib/print/psrip convert Postscript file to
			raster data format (--> *.tiff file)
xv			dist.engr:/sgi/hacks/xv

convert a jpeg or sgi/rgb file to acrobat pdf:
use XV to convert the image into a postscript file
xpsview will view an image that has been converted to EPS

snapshot		save a portion of the screen in an image file
scrsave			save a part of the screen in an image file
imprint			converts text files to PostScript, similar to Adobe 
			-r rotate 90 degrees; -B header on each page
			114 impr_base.sw.impr       usr/sbin/imprint
			untested Ex: imprint -G  -h -r -fCourier7
/usr/sbin/imprint -r -f Courier7 yourfile.txt
/usr/sbin/imprint -2rG yourfile.txt

mag		/usr/sbin/mag	magnify (check if dirty spots are in frame buffer or not)

dmconvert	digital media file conversion utility (command line)
mediaconvert	graphical tool to dmconvert
to_dos,to_unix	convert text files between MSDOS and UNIX
		DOS -> Unix by hand
		1)	vi:	:%s/^V^M//g
		2)	sed:	% sed 's/^V^M//g' foo >
			(NOTE:  ^V is control V and ^M is control M or Enter)
ps2ascii	PS -> ASCII
		usr/freeware/bin/ps2ascii (CD freeware 2.0  module	usr/freeware/lib/ghost/ (
f2ps (1)                - Fig to Postscript translator
ax2ps (1)              - convert a TIFF facsimile to compressed PostScript
html2ps (1)             - convert HTML to PostScript
pdf2ps (1)              - Aladdin Ghostscript PDF to PostScript translator
rgb2ps (1)              - Convert an SGI image to PostScript
sgi2ps (1)              - convert an SGI image file to PostScript
stiff2ps (1)            - convert a Stream TIFF (STIFF)image file to PostScript
text2ps (1)             - convert text files (ASCII) to PostScript
                                like enscript on earlier UNIX
/usr/lib/print/lptops	convert a text file into a PostScript file
/usr/lib/print/lptops -H -U -M 2 -P 7.5pt -G -W !* | lp -d <queuname>
ps2pdf PS to PDF converter

/usr/lib/print/text2ps -p /tmp/ /tmp/xx

3D Translator
from 		to .iv
see 		$HOME_nick/info/tools/converters/info

sendmail		send network mail
mailq			show mailqueue status
vacation		send mail to users or read mail
mailbox			mail notification
xbiff			mailbox flag for X

after you modify the, you should do the following:
/etc/init.d/mail stop
/usr/lib/sendmail -bz
/etc/init.d/mail start

how to delete mails which can not be delivered:
	# /etc/init.d/mail stop
	# rm /var/spool/mqueue/r.... /var/spool/mqueue/d....
	# /etc/init.d/mail start

check for /etc/aliases the line:
#+:+     if you are using NIS

after changing /etc/aliases issue:	newaliases

versions of sendmail:
telnet localhost 25
220- Sendmail 950413.SGI.8.6.12
-->version 8.6.12

configmail list		sendmail autoconfiguration script

Vacation message setup (from Peter's help page)

Traveling & Vacation Messages This tutorial tells you how to set up vacation 
messaging for your email. This way when people send you email and you are out 
of town they will get a message to that effect. 

1. In your home directory create a file .vacation.msg that has your vac. mesg. 

    From: ...
    Subject: I'm on vacation
    Precedence: bulk

2. In your home directory create a file .forward containing the following line: 
     \username, "|/usr/sbin/vacation username" 
     Note: replace username in the above example with your login name 
3. To activate this message, in a shell window type: 
     vacation -i -r 1 
     (this is the number "1" for 1 message per day) 
4.To deactivate, when you return, move .forward to another location to save it 
     mv .forward 
5. To reactivate (next trip) edit .vacation.msg and move the .forward file back 
     mv .forward 
6. To test, send yourself an email and see if the vacation program replies correctly
7. For more information, read the man page on vacation 

How to add logging for certain mail aliases
add the alias in /etc/aliases (/etc/aliases.yp)
# grep "^support^ /etc/aliases.yp
support:michi, "|/usr/local/bin/savesupport"
# cat /usr/local/bin/savesupport

#!/bin/csh -f
cat >> /usr/local/savemail/support

# ls -l /usr/local/savemail/support
-rw-r--r--    1 guest    guest .....	# should belong to guest 
					# under 6.2 it did not work otherwise

How to redirect Mail to null ?
in /etc/aliases (or /etc/aliases.yp for NIS)
keak: /dev/null

dont forget to issue 'newaliases' afterwards !!

How to send mail to more than one person:
cat $HOME/nick/.forward

# don't use the back slash \ as suggested in the 
# description for vacation

Mail test to Switch, test outgoing and incoming email
% mailx -v -s "test_subject"

Send email by hand on port 25:
telnet <somehost> 25
  MAIL From:<>
  RCPT To:<>
  blah blah and other content
Send email by hand (or by script)
/usr/lib/sendmail -f << END
Subject: Mail test

some text

AntiSpam (like Speed)
o read
o increase loglevel to 12 (goes to SYSLOG)	(sendmail 8.8.8)

procmail does user-level filtering, using .forward (like vacation).
fw_procmail	freeware page
Mail on NT:
Allow relaying:	Start > Control Panel > Admin Tools > Internet Service Manager
  tree: Default SMTP Virtual Server
	right click - Properties
		Access > relay restrictions: grant access to all

SMTP has to be started in 'services'
Mail -> SMS Gateway:
% mailx -v -s "Gruezi SMS Test"
test an --N
 funktioniert leider nicht wenn Absender von SGI
passwd file on Master server:	rpc.passwd.options  AND /etc/config/ypmaster.options
rpc.passwd.options:		/etc/passwd.yp
/etc/config/ypmaster.options:	PWFILE=/etc/passwd.yp

ypwhich		print the NIS server or map master hostname
		(to which server is this client bound?)
ypset 		point ypbind at a particular NIS server
Test Proxy Server with:
Can the customer telnet the proxy system on the proxy port?, for
echo "GET"|telnet their_proxy 8080

Serial Devices:
setup a terminal:
HW:  connect serial line 2 of workstation to server serial line 1
SW:  on workstation change /etc/uucp/Devices
     uncomment the line with "Direct ttyd2 - 9600 direct"
CMD: to connect to server do a "cu -l ttyd2" on the workstation
of course eoe.sw.uucp has to be installed

Info about devices:
man [keyboard | serial | mouse | pcmouse | pckeyboard ]
mkfp	is a formatting/partitioning utility that can be used to create DOS
	and HFS file systems on devices such as floppies, flopticals, SyQuest,
	Jaz, PC Cards, Zip and hard-drives.
User and accounts:
man xdm

check /etc/passwd and /etc/group if setup correct:
al pwck

/etc/capability		user capability database (check with id -P)

Standart files (skeleton)
starting with IRIX 6.5 new location
old location (pre 6.5)

To add a user with a command use
/usr/sysadm/privbin/addUserAccount		see man page which explains which
	other scripts are run and what skeleton files are copied to that home dir
PATH path variable:
csh tcsh:
 add in .login the path to (better to set it in .cshrc because .login
  will not be sourced when only executing rsh)
 set path = ($path /usr/ssm/bin /usr/ssm/lib)
 set path = (. $path)		# add . to path; sec hole

sh, ksh
 add in .profile
 PATH=:$PATH			# add . to PATH; sec hole

acctcom -u <user>	eoe.sw.acct  (chkconfig acct on)
eoe.{man.sw}.audit	(Audit trail software)
quot /d2		summarize filesystem ownership ; disk utilization by user
quot -a
crypt <key> <xx >xx.encrypted
		encript xx with the key abc and write it to file xx.encrypted
Ex:		crypt abc <xx >xx.encrypted
		To decode the encrypted file:
		crypt abc <xx.encrypted	
SSH scp
/usr/freeware/bin/scp -v sgi@ /tmp/SYSLOG
/usr/freeware/bin/scp -v nick@chita:/var/adm/SYSLOG /tmp/SYSLOG

different Mail tools to send mail:

mailx -s "" -v license		This tool will NOT take the 

Modify the sender's address:
mail <<EOF
? From: verysecret
? Subject: anothertest
? now content

NFS automount and autofs

autofs	master map /etc/auto_master	(man autofsd | autofs)

	Do not kill autofsd to change the AutoFS configuration. 
	Run the autofs command to cause changes in the configuration 
	maps to take affect. 
Shellscript stuff / Editor
dirname /var/adm/SYSLOG		-> /var/adm
basename /var/adm/SYSLOG	-> SYSLOG

basename string [ suffix ]
basename .Z	->
basename .ps.Z	-> filename
basename '.ps.Z'	-> filename

printf 		print formatted output
read		Read from a file
Ex:	printf "\aPlease fill in the following: \nName: " 
	read name
	printf "Phone number: "
	read phone
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc
# foreach f ( `showprods -nD1 | grep patchSG | awk '{print $2}'` )
? echo $f
? end

Sort /etc/passwd by ascending UID:
awk -F: '{print $3,$1}' /etc/passwd | sort -k2 -n
awk '{ FS=":" ; OFS="\t\t"; print $1,$3}' /etc/passwd | sort -k2 -n
cat /etc/passwd |awk -F: '{printf ("%8s\t%13s\t%3s\n",$3,$1,$5)}' |sort -k1 -n
sort -t: +2n -3 /etc/passwd

archive only regular files in a directory, ommitting subdirectories and hidden files:
ls -al | awk '$0!~/^d/ {print $9}' | xargs tar cvf archive_name.tar
	      ^^^^^^^ means ignore lines where the entire line ($0) starts with a "d"

versions -nb |grep patchSG |awk '{print $2}' |cut -c11-14
compare directories after copying a tree:
	cd /source_dir; ls -lR | awk '{print $5,$9}' > /tmp/list_source
	cd /dest_dir; ls -lR | awk '{print $5,$9}' > /tmp/list_dest
	then compare the 2 files /tmp/list_source /tmp/list_dest

Print size and name of file with a preceeding "o"
% ls -l | awk '{print "o",$5,$9}'
o 10390 MotOGLDump.c
o 61246 v_indy.txt

select all emerg(0) alert(1) and crit(2) messages from  /var/adm/SYSLOG
awk '$4~/[0-2][A-X]:/ ' /var/adm/SYSLOG
awk '$4~/[0-2][A-X]:/ ' /var/adm/oSYSLOG
 awk 'pattern { action }'   #if there is no action defined then the whole line is printed
 in above example we do pattern matching with the fourth element and check if
 it contains the digit 0-2 [emerg(0) alert(1) crit(2)] followed by any letter
 (representing the facility) followed by a ":"
 a typical line in SYSLOG looks like this:
Aug 16 09:59:26 1T:lion nick: another logger_test

delete empty lines in a text file:
awk 'NF>0' <text_file>
sed '/^$/d' <text_file>

print line 20 to line 30 of a file:
sed -n '20,30p' <textfile>
Join files together:
task:	join the 2 files together
% cat x
% cat y
glXCreateGLXPixmap function call generates a BadAlloc
Networker does not write tapes to full capacity

% cat -n x > xn ; cat -n y > yn		
	#this will add number for each line
% join -1 1 -2 1 -o 1.2,2.2 -t : xn yn
	# join file xn and yn comparing by the first field of each file 
	# field one from file 1  (-1 1)
	# field one from file 2  (-2 1)
	# write to stdout field 2 of file one (1.2) and field 2 of file 2 (2.2)
	# as field separator take the ':' sign
the command will result in:
2178557:        glXCreateGLXPixmap function call generates a BadAlloc error
2179065:        Networker does not write tapes to full capacity

timex redirect output into a file:
the following will not work:
   14% timex date > /tmp/log
The output of timex is sent to stderr, not stdout!

15% sh
$ timex date 2>/tmp/log
Tue Mar 25 11:44:48 PST 1997
$ cat /tmp/log

real        0.02
user        0.01
sys         0.01


sh -c "timex date 2> /tmp/log"
Logs normally stored under:
access IRISconsole by command line
Ringier:	ictelnet admin-indy 5000
general:	ictelnet <IRISconsole_host> 5000
~!	escape to interactive shell on loca systemi; get back with <exit>
~%put from [ to ]
~%take from [ to ]
~t	prints the values of the termio structure
O2 uppgrade to 5200 CPUs

Upgrade prom before replacing the CPU!
Remember diskcloning newer flashes the proms.

Check Prom version: 
On booted system use: 
strings /usr/cpu/firmware/ip32prom.image | grep VERSION 
(must be 4.12 or higher, this image is copied when cloning) 
This checks the version of the PROM image at: 
If incorrect Run following command: 
/sbin/flashinst -T -y /usr/cpu/firmware/ip32prom.image 
If system will not boot, you will have to swap the customers old 
CPU back onto Systemboard. Then boot the system up and do the above command.

If customer does not have the Old CPU, try replacing the Systemboard. 
Newer Systemboards are supposed to be using Prom Version: 4.11 or 
higher and this should let you at least get to miniroot. 
amreport	full screen ASCII report tool (replaced in 6.5.5 with ESP)


Info and Tips from HANS:

- /etc/ >>> actually
- mv /etc/ 	   /etc/
- cp /etc/ /etc/
- ./configmail list
- /etc/init.d/mail stop
- /etc/init.d/mail start
- Test: ./Mail -s test root >>> blablabla >>> cntl c

- cd /var/adm/avail
- ./amregister: autoemail > nur letzte Zeile besetzt mit
- ./amconfig:   alle flags on
- /etc/hosts:   zb: als domain eingerichtet
- email muss aufgesezt
- reboot

  email aufsetzen
- /etc/init.d/mail start
- /usr/etc/configmail setup

Buffersize for a shell:
- xwsh -name winterm -sl 65535 (ein neues shell oeffnen)
- cd /usr/lib/X11/app-defaults
- jot XWsh
- winterm.retainLimit:            60000	(hinzufuegen)

Call an other unix:	zg:connecting 2 indys via serial ports
- eoe2.sw.uucp >>> laden und konfigurieren
- chown uucp /dev/ttyd2 
  (/etc/uucp/Devices) >>> #ttyd2 auskommentieren
- cu -l /dev/ttyd2

crontab editieren:
- login as hans user in a window
- crontab -l > tmp.crontab (when there is something in it)
- jot tmp.crontab
  #min    hour    daymo   month   daywk cmd
  30      7       *       *       *	cp /usr/people/hans/support/field/RMA /usr/people/hans/RMA.saved	editieren des Eintrages
  35      7       *       *       *	cp /usr/people/hans/support/field/installations /usr/people/hans/installations.saved	editieren des Eintrages
- crontab -l
  30      7       *       *       *	cp /usr/people/hans/support/field/RMA /usr/people/hans/RMA.saved
- crontab tmp.crontab
- rm tmp.crontab (or not)

Core file austesten:
- edge core (sagt aus von welcher apps das core kreiert wurde)

Diverse Unixbefehle:
- timex -t mkfile -v 800m /tmp/test
- tail -f /usr/adm/SYSLOG
- tar	c record
	x extract
	t listen
	v verbose
- tar -xvf will extract a file from dir
- Backup /    > befehl im unix shell
- backup:     >	cd /usr/lib/vadmin
	      >	ls
	      >	backup_restore*      backup_restore.hlp
	      > ./backup_restore &
- banner      >>> to exploid the writting
- confidence
- find . -type f -print | xargs grep -i string
- cat RMA.saved|grep -i ps|wc -l
- df -k|awk '{printf "%-45s\t%s\t%s\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5,$6,$7}'

mkdir /.AA
mount /dev/dsk/dks1d2s0 /.AA
cd /; tar cBf - . | (cd /.AA; tar xBf -)
cd /tmp; dvhtool -v g sash sash -v g ide ide
dvhtool -v c sash sash -v c ide ide -v l /dev/rdsk/dks1d2vh

- mt -f /dev/rmt/tps2d6nrsvc status
- tar cvf /dev/rmt/tps2d6nrsvc /etc
- mt -f /dev/rmt/tps2d6nrsvc rewind
- tar tvf /dev/rmt/tps2d6nrsvc
- ls -l /dev/rmt/tps2d6
- more /var/sysgen/master.d/scsi
- stacker -c /dev/scsi/sc2d6l0
- stacker -u 0
- stacker -u 1

[para:hans] 24 /usr/people/hans % rlogin guest@ocracoke
IRIX Release 6.2 IP22 ocracoke
Copyright 1987-1996 Silicon Graphics, Inc. All Rights Reserved.
Last login: Sat Jun  1 12:17:01 MDT 1996 by
ocracoke 2% cd ~meyer 
ocracoke 3% cd bin
ocracoke 4% more lp1

/usr/lib/print/lptops -U -W -G -P 10pt $* 
ocracoke 5% /usr/lib/print/lptops -U -W -P 10pt |lp

(enter und cntr d)
request id is lexmark-125 (standard input)


IBM Stiction:
- 120194 bis 021095

- /var/netls# more nodelock

- finger:	user information lookup program
  z.b: finger theo@sgzh
- rcp -r guest@artus:/usr/people/stephan/.zmailrc /usr/people/hans/tmp/.mailrc
- last:		zeigt an, wer in der vergangenheit alles eingeloggt hat
- rup:		zeigt alle user im netz an
- /etc/config/netif.options	zeigt primary interface
- /etc/config/ifconfig-1.options	zeigt netmask (
- netstat -ia	zeigt 0800690... Adresse
- netstat -C	zeigt collisions
- /etc/init.d/network stop
                 "    start	

Network setup:
- /etc/hosts >>>	iris1
- /etc/sys_id >> iris1
- igconfig ef0 >>> netmask 0xffffff80
- cd /etc/config
- vi ifconfig-1.options
  netmask  0xffffff80
- files exportieren: 	vi exports
			exports -va
- remote files mounten:	vi fstab
			host:/disk2 /disk2 nfs bg intr 0 0
			mount -a

- setenv showconfig istrue (more verbose)(tested drivers)

- more RMA.saved |grep -i doa|lptops -h |lp -dTIMicroWriter
  Querformat printen          ---------	

PROM flashen:
- flashio -v
- flashio -s 3 /usr/cpu/firmware/io4prom.bin

Command Monitor:
- flash -s 3 dksc(x,x,8)io4prom   from CDROM drive

System Informationen:
- sysinfo:	eadresse
- nvram:	eadresse
- sys_id:	hostname
- sysctlr:	all infos from frontpanel and sysctlr prom version
- flashio:	ioprom version

Patches downloaden:
- sgzh >>> /usr/tmp >>> customized patches onyx & sirius
- patchserver in cortaillod >>> rlogin  patches@patches.neu >>> type: getpatch
- deliver, IZU-3060, xvf *		patches@hercules.neu
- R - RCP tar file with patch
- tar -xvf patch_1478.tar (jedes tar.file einzeln entpacken)

- login to
- cu voegele
- logout: type >>> ~. and carriage return

XLV einricheten
1.Neues Label einrichten:
fx -x
fx version 5.3, Oct 18, 1994
fx: "device-name" = (dksc) 
fx: ctlr# = (0) 
fx: drive# = (1) 
...opening dksc(0,1,)
fx: Warning:  this disk appears to have mounted filesystems.
         Don't do anything destructive, unless you are sure
         nothing is really mounted on this disk.

...controller test...OK
Scsi drive type == SGI     SEAGATE ST31230N0112

----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> l

----- please choose one (? for help, .. to quit this menu)-----
[sh]ow/         [sy]nc          [se]t/          [c]reate/
fx/label> c

2.Partitionen einrichten
fx -x
fx version 5.3, Oct 18, 1994
fx: "device-name" = (dksc) 
fx: ctlr# = (0) 
fx: drive# = (1) 
...opening dksc(0,1,)
fx: Warning:  this disk appears to have mounted filesystems.
         Don't do anything destructive, unless you are sure
         nothing is really mounted on this disk.

...controller test...OK
Scsi drive type == SGI     SEAGATE ST31230N0112

----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> r

----- partitions-----
part  type       cyls             blocks          Megabytes   (base+size)
  0: efs        5 + 3617       2575 + 1862860       1 + 910  
  1: raw     3622 + 396     1865435 + 204350      911 + 100  
  8: volhdr     0 + 5             0 + 2575          0 + 1    
 10: volume     0 + 4019          0 + 2069785       0 + 1011 
(Dies ist nur ein Beispiel)

capacity is 2070235 blocks

----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive           [o]ptiondrive         [e]xpert
[u]srrootdrive        [re]size

Im epert Mode k�nnen Sie efs nach xfs �ndern

3.XLV0 einrichten
xlv_make>vol xlv0
xlv_make>ve dksxdxsx
xlv_make>ve dksxdxsx

4.mkfs mit XLV0 erstellen
mkfs -b size=1k -l internal,size=4m /dev/dsk/xlv/xlv0

5.XLV0 mounten
mkdir /vol1
mount /dev/dsk/xlv/xlv0 /vol1

6.Restore auf XLV0
Ich neheme an Sie werden tar ben�tzen

Disk stripping
 - Stripping:
   xlv_make <<EOT
   vol xlv0
   ve -force -stripe -stripe_unit 256 dks2d2s7 dks2d3s7 dks2d4s7

 - MKFS:
   mkfs -t xfs -d name=/dev/dsk/xlv/xlv0 -l internal,size=4096b

mkfs Script
- ksh
# while true
> do
> mkfile 1000m /d2/test
> echo "file erstellt"
> rm /d2/test
> done

Share your opinion