Friday, January 30, 2009

Arithmetic

Normal:
a=`expr $a + 1`

Faster!
let a=a+1

Thursday, January 29, 2009

X window

@vnc server
xhost +clientserver

@client server
export DISPLAY=vncserver:port

Tuesday, January 13, 2009

HP-UX Patch

swverify -d \* @ /tmp/temporary_depot/depot
swlist -d @ /tmp/temporary_depot/depot
swinstall -s /tmp/temporary_depot/depot -x autoreboot=true -x patch_match_target=true

swinstall -s /tmp/temporary_depot/depot
invoke sam > select patch, tab>action>install

tar

Unix
How do I create, extract, and view tar files?

To create a tar file:
tar cfv [filename.tar] [directory/file to tar]

To append into a tar file:
tar rfv [filename.tar] [directory/file to tar]

To extract files from a tar file:
tar xfv [filename.tar] [directory to extract to]

To view the contents of a tar file:
tar tfv [filename.tar]

Boot sequence, init files

HP-UX:
/sbin/rc0.d
/sbin/rc1.d
/sbin/rc2.d
:
:
/sbin/rc8.d

point to sbin/init.d/*


AIX:
/etc/rc.d/rc0.d
/etc/rc.d/rc1.d
/etc/rc.d/rc2.d
:
:
/etc/rc.d/rc9.d

Wednesday, January 7, 2009

chmod

Set home directory
chmod g+s (chmod 2755)

s mean SUID(set-user-ID-on-execution)
or SGID(set-group-ID-on-execution)

While user execute those file, his rights same as user/group.
Example passwd:
#ls -l /usr/bin/passwd
-r-sr-xr-x 5 root bin 49152 May 24 2001 /usr/bin/passwd

Only root can change password, which this setting, user can change their own password.

Remark: X-term experience.