Saturday, March 28, 2009

Import/Export mediawiki

wiki exp:
http://www.chieftain.idv.tw/archives/2008/01/25/1337.html

wiki imp:
http://code.oogami.name/2008/08/mediawiki-importexport.html

exp:
cd ~/Oldwiki/Directory/maintenance
php dumpBackup.php --current > ~/tmp/export.xml

imp:
cd ~/Newwiki/Directory/maintenance
php importDump.php ~/tmp/export.xml
php rebuilrecentchanges.php

imp images:
cd ~/Newwiki/Directory/maintenance/
php importImages.php ~/tmp/images

update stat:
php initStats.php --update

Friday, March 27, 2009

AIX change device

AIX:
Available -> defined
rmdev -l ovpass0
defined -> available
mkdev -l smc0

Tuesday, March 24, 2009

Steps to increase SAN storage for AIX

umount /filesystem
varyoffvg vgname
chvg -g vgname
varyonvg vgname
mount /filesystem

then
LVM > LV > FS

Monday, March 23, 2009

Check info of LPAR

lparstat -i

Node Name : ux13
Partition Name : ux13
Partition Number : 1
Type : Dedicated-SMT
Mode : Capped
Entitled Capacity : 2.00
Partition Group-ID : 32769
Shared Pool ID : -
Online Virtual CPUs : 2
Maximum Virtual CPUs : 2
Minimum Virtual CPUs : 1
Online Memory : 22528 MB
Maximum Memory : 22528 MB
Minimum Memory : 4096 MB
Variable Capacity Weight : -
Minimum Capacity : 1.00
Maximum Capacity : 2.00
Capacity Increment : 1.00
Maximum Physical CPUs in system : 4
Active Physical CPUs in system : 4
Active CPUs in Pool : -
Shared Physical CPUs in system : -
Maximum Capacity of Pool : -
Entitled Capacity of Pool : -
Unallocated Capacity : -
Physical CPU Percentage : 100.00%
Unallocated Weight : -

Tuesday, March 17, 2009

HP-UX: Disk and Filesystem tasks

Search for attached disk:
ioscan -fnC disk

Initialize a disk for use with LVM:
pvcreate -f /dev/rdsk/c0t1d0

Create the device structure needed for a new volume group:
cd /dev
mkdir vgdata
cd vgdata
mknod group c 64 0x010000

Create volume group vgdata:
vgcreate vgdata /dev/dsk/c0t1d0
{ if your expecting to use more than 16 physical disks use the -p option, range from 1 to 256 disks. }

Display volume group vgdata:
vgdisplay -v vg01

Add another disk to volume group:
pvcreate -f /dev/rdsk/c0t4d0
vgextend vg01 /dev/dsk/c0t4d0

Remove disk from volume group:
vgreduce vg01 /dev/dsk/c0t4d0

Create a 100 MB logical volume lvdata:
lvcreate -L 100 -n lvdata vgdata
newfs -F vxfs /dev/vgdata/rlvdata

Extend logical volume to 200 MB:
lvextend -L 200 /dev/vgdata/lvdata

Extend file system to 200 MB:
{ if you don't have Online JFS installed volumes must be unmounted before you can extend the file system. }
fuser -ku /dev/vgdata/lvdata { kill all process that has open files on this volume. }
umount /dev/vgdata/lvdata
extendfs /data
{ for Online JFS, 200 MB / 4 MB = 50 LE; 50 x 1024 = 51200 blocks }
fsadm -F vxfs -b 51200 /data

Set largefiles to support files greater than 2GB:
fsadm -F vxfs -o largefiles /data


Exporting and Importing disks across system:
1. make the volume group unavailable
vgchange -a n /dev/vgdata
2. Export the the disk while creating a logical volume map file.
vgexport -v -m data_map vgdata
3. Disconnect the drives and move to new system.
4. Move the data_map file to the new system.
5. On the new system recreate the volume group directory
mkdir /dev/vgdata
mknod /dev/vgdata/group c 64 0x02000
6. Import the disks to the new system
vgimport -v -m data_map /dev/vgdata /dev/dsk/c2t1d0 /dev/dsk/c2t2d0
7. Enable the new volume group
vgchange -a y /dev/vgdata

Renaming a logical volume:
/dev/vgdata/lvol1 -> /dev/vgdata/data_lv
umount /dev/vgdata/lvol1
ll /dev/vgdata/lvol1 take note of the minor ( e.g 0x010001 )
brw-r----- 1 root root 64 0x010001 Dec 31 17:59 lvol1
mknod /dev/vgdata/data_lv b 64 0x010001 create new logical volume name
mknod /dev/vgdata/rdata_lv c 64 0x010001
vi /etc/fstab { reflect the new logical volume }
mount -a
rmsf /dev/vgdata/lvol1
rmsf /dev/vgdata/rlvol1

http://www.unixguide.net/hp/hplvmtasks.shtml

HP-UX mknod

ll /dev/*/group
crw-r----- 1 root sys 64 0x000000 Dec 24 11:18 /dev/vg00/group
crw-r--r-- 1 root sys 64 0x010000 Feb 10 15:31 /dev/vg01/group

next available 0x020000

Thursday, March 12, 2009

Netbackup MANPATH

/etc/MANPATH
# MANPATH=$MANPATH:/usr/openv/man
# export MANPATH

Tuesday, March 10, 2009

grep OR

grep -e 10 -e JobID

Monday, March 9, 2009

Portable applications!

http://portableapps.com/

Thursday, March 5, 2009

exit status

exit 113 # Will return 113 to shell.
# To verify this, type "echo $?" after script terminates.