mount server reported tcp not available, falling back to udp

If your nfs client has this:
# mount /usr/sap/trans
mount server reported tcp not available, falling back to udp
mount: RPC: Program not registered
and this:
# rpcinfo -p nfsserver
No remote programs registered.
you may have tcpwrappers in the nfs server, so, in the nfs server edit /etc/hosts.allow and add:
portmap : usdaapp151,10.21.40.100 : ALLOW
portmap : ALL : DENY
nfs-server : 10.21.40.100 : ALLOW
nfs-server: ALL : DENY
do not restart anything, just mount your filesystem in the client
Thanks to Alfredo Rioja
54/433

stream a webcam, using highly compressed h264 instead of typical mpg

Got a logitech webcam c300, it uses the “uvcvideo” kernel module.
Typically you would grab video using “motion” and stream it on mpeg, well that’s rubbish if you want better
compression, so let’s do it using the best of the best: h264.
#!/bin/ksh
DEV=/dev/logitechcam
ps -ef | grep -i vlc | grep -v grep |grep -i logitechcam | awk ‘{ print $2 }’| while read P;do
kill -9 $P
done
VLC=”/usr/local/bin/cvlc v4l2://$DEV :input=2 :input-slave=alsa://hw:2,0 –alsa-samplerate=32000
–v4l2-controls-reset –v4l2-auto-white-balance=1 –v4l2-do-white-balance=1 –v4l2-autogain=1 –sout ”
21/433
CAM=”transcode{vcodec=h264,acodec=mp4a,width=320,height=240,vb=64,ab=24,channels=1,venc=x264}:standard{access=http,dst=0.0.0.0:8090/stream.flv}”
22/433
23/433
#CAM=”transcode{vcodec=mjpg,width=320,height=240}:duplicate{dst=std{access=http{mime=multipart/x-mixed-replace;boundary=–7b3cc56e5f51db803f790dad720ed50a}.mux=mpjpeg,dst=0.0.0.0:8090/m.mjpg}}”
${VLC} “#$CAM”
this produces a very decent quality stream at around 100kbps, audio also included!
Enjoy!
24/433

no lsof?

cd /proc
 pfiles * | egrep "^[0-9]|sockname" | more
 Or use PCP, found at http://www.unix.ms/pcp/
 #!/usr/bin/ksh
 #
 # PCP (PID con Port)
 # v1.07 20/05/2008 sam@unix.ms
 #
 # If you have a Solaris 8, 9 or 10 box and you can't
 # install lsof, try this. It maps PIDS to ports and vice versa.
 # It also shows you which peers are connected on which port.
 # Wildcards are accepted for -p and -P options.
 #
 # The script borrows from Eric Steed's excellent "getport.sh" script.
 #
 #
 if [ $# -lt 1 ]
 then
 echo >&2 "usage: $0 [-p PORT] [-P PID] [-a ALL ] (Wildcards OK)"
 exit 1
 fi
 while getopts :p:P:a opt
 do
 case "${opt}" in
 p ) port=${OPTARG};;
 P ) pid=${OPTARG};;
 a ) all=all;;
 [?]) # unknown flag
 echo >&2 "usage: $0 [-p PORT] [-P PID] [-a ALL ] (Wildcards OK) "
 exit 1;;
 esac
 done
 shift `expr $OPTIND - 1`
 if [ $port ]
 then
 # Enter the port number, get the PID
 #
 port=${OPTARG}
 echo "PIDtProcess Name and Port"
 echo "_______________________________________________________"
 for proc in `ptree -a | grep -v ptree | awk '{print $1};'`
 do
 263/433
 result=`pfiles $proc 2> /dev/null| grep "port: $port"`
 if [ ! -z "$result" ]
 then
 program=`ps -fo comm -p $proc | tail -1`
 echo "$proct$programt$portn$result"
 echo "_______________________________________________________"
 fi
 done
 elif [ $pid ]
 then
 # Enter the PID, get the port
 #
 pid=$OPTARG
 # Print out the information
 echo "PIDtProcess Name and Port"
 echo "_______________________________________________________"
 for proc in `ptree -a | grep -v ptree | grep $pid| awk '{print $1};'`
 do
 result=`pfiles $proc 2> /dev/null| grep port:`
 if [ ! -z "$result" ]
 then
 program=`ps -fo comm -p $pid | tail -1`
 echo "$proct$programn$result"
 echo "_______________________________________________________"
 fi
 done
 elif [ $all ]
 then
 # Show all PIDs, Ports and Peers
 #
 echo "PIDtProcess Name and Port"
 echo "_______________________________________________________"
 for pid in `ptree -a | grep -v ptree |sort -n | awk '{print $1};'`
 do
 out=`pfiles $pid 2>/dev/null| grep "port:"`
 if [ ! -z "$out" ]
 then
 name=`ps -fo comm -p $pid | tail -1`
 echo "$pidt$namen$out"
 echo "_______________________________________________________"
 fi
 done
 fi
 exit 0

change ip on created zone

zonecfg:z> select net address=<old-ip>
zonecfg:z:net> set address=<new-ip>
zonecfg:z:net> end
zonecfg:z> commit
copy dvd on solaris10 to an image
I’ve copied and used a DVD image from the eiscd DVD (enterprise installation standards), to add it to my remote
JET(jumpstart enterprise toolkit) servers using:
1- insert the dvd in the drive
2- observe the mountpoint (cxtxdx)
# df -k | grep cdrom
/vol/dev/dsk/c0t1d0/eis-dvd 2290588 2290588 0 100% /cdrom/eis-dvd
3- Stop volume management, because it prevents from reading from the raw device
# /etc/init.d/volmgt stop
4- Use dd on slice 2
# dd if=/dev/dsk/c0t1d0s2 of=/eisdvd.iso
5- transfer eisdvd.iso to other machine, and test:
# mkdir /eis
# mount -F hsfs `lofiadm -a /eisdvd.iso` /eis
Success!
279/433

Use hpasmcli to diagnose your HP hardware

To check your hardware for failures, if you have hpasm installed:
# hpasmcli -s “help show”
USAGE: SHOW [ ASR | BOOT | DIMM | F1 | FANS | HT | IML | IPL | NAME | PORTMAP | POWERSUPPLY |
PXE | SERIAL | SERVER | TEMP | UID | WOL ]
# hpasmcli -s “show dimm”
# hpasmcli -s “show fans”
# hpasmcli -s “show iml”
# hpasmcli -s “show powersupply”
# hpasmcli -s “show server”
# hpasmcli -s “show temp”
If you want to use the web interface use http://thehost:2301
Thanks to Justin Lim
Using OMSA cli to diagnose DELL Hardware
If you have omsa installed in your OS, you can do:
# omreport system -?
# omreport system alertlog
# omreport system events
# omreport system alertaction
# omreport system postlog
# omreport system shutdown
# omreport system summary
# omreport system pedestinations
# omreport system recovery
# omreport system platformevents
# omreport system esmlog
87/433
You may use the web interface by browsing https://hostname:1311
OMSA can be obtained by browsing http://ftp.us.dell.com/sysman/
to start it you can run:
srvadmin-services.sh start
Thanks to Justin Lim
88/433