Wednesday, December 26, 2007

Password proetct pages in Apache

create a password encoded .httaccess file with

http://www.4webhelp.net/us/password.php
http://shop.alterlinks.com/htpasswd/htpasswd.php
http://www.htmlite.com/HTA006a.php

in form of user:encoded_password

then add the following to corerct section in httpd.conf file

AuthUserFile /full/path/to/.htaccess
AuthType Basic
AuthName "Authorization Required"
Require valid-user

restart apache

Monday, December 24, 2007

Cacti on Windows

The following have to be set in the cacti->settings

PATH
spine path is to be set
rrdtool font is to be set like c:/cacti/arial.ttf

GENERAL
RRDTOOL version must match the installed rrdtool

Saturday, December 15, 2007

NIS AUTOMOUNT

1. server: /etc/exports, define exportable directories

/users *(rw,no_root_squash,no_all_squash,sync)
/apps *(ro,sync)

2. server: service nfs restart

3. server: /var/yp/Makefile, edit to include auto.* in make all
(YP server is to be installed first)

4. server: /etc/auto.master :: <--- REMEMBER NO /etc in front of auto.*
/users auto.home --ghost
/apps auto.local --ghost

5. server: /etc/auto.home ::
* -rw dcssrv4:/users/&

6. server: /etc/auto.local ::
oracle -ro dcssrv4:/apps/oracle
gf_admin -ro dcssrv4:/apps/gf_admin

7. server: cd /var/yp;make

8. server: service ypserv restart

9. client: edit /etc/nsswitch.conf :: automount nis files

10. client /etc/sysconfig/network :: put NISDOMAIN=xxxxxxx

11. client /etc/yp.conf :: put domain NISDOMAIN server XXXX

12. client: service ypbind restart & service autofs restart

look at http://penguin.triumf.ca/recipes/nis-auto/index.html
(it has an error, check the instrucion #4 above)

Wednesday, December 12, 2007

geoframe document errors

1. gf_admin must be of group dba
2. chmod 775 /home/oracle

Tuesday, December 11, 2007

qemu resize image file

1. qemu-img convert system.qcow -O raw system.raw
2. dd if=/dev/zero of=system.raw seek=N obs=1GB count=0 (N=final size)
3. qemu-img convert system.raw -O qcow growed-system.qcow

Monday, December 10, 2007

QEMU change cdrom

1. start qemu with -monitor stdio option along with other options
2. press CTRL+ALT+2 to enter CLI mode and CTRL+ALT+1 to exit
3. enter command "change cdrom isofilename.iso"

Sunday, December 09, 2007

remember you stupid that

files that start with . (dot) in linux will be hidden from plain ls, Gnome deskop,...

Wednesday, December 05, 2007

Oracle SNMP for Cacti monitoring

from http://forums.cacti.net/about6209.html
Step 0 : Enverionment

OS : SunOS dbateam 5.8
Oracle Version: 8.1.6

Step 1 : Stop Sun's snmpdx process.

login as root account:
1-0
%ps -ef | grep snmp | grep -v grep
root 6438 1 0 Sep 10 ? 0:01 /usr/lib/dmi/snmpXdmid -s bscss02d
root 6427 1 0 Sep 10 ? 0:20 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
%
%kill -9 6438 6427

1-2
# ps -ef | grep mib
root 6405 1 0 Nov 01 ? 0:24 mibiisa -r -p 32934
root 2373 1 0 Oct 21 ? 3:23 mibiisa -r -p 32882
root 6512 1 0 Nov 01 ? 0:25 mibiisa -r -p 32956
root 6578 1 0 Nov 01 ? 0:26 mibiisa -r -p 32977
root 6620 1 0 Nov 01 ? 0:01 mibiisa -r -p 32998
root 6558 1 0 Nov 01 ? 0:24 mibiisa -r -p 32972
root 6434 1 0 Nov 01 ? 0:30 mibiisa -r -p 32941
root 7284 7280 0 19:03:46 ? 0:00 mibiisa -r -p 40714
# kill -9 6405 2373 6512 6578 6620 6434 7284

1-3
check process of oracle snmp
%ps -ef | grep peer
root 6607 1 0 Nov 01 ? 0:06 ./encap_peer -t 1162 -s 1160 -c CONFIG.encap
root 6605 1 0 Nov 01 ? 0:13 ./master_peer CONFIG.master NOV
%kill -9 6607 6605


Step 2 : Start Oracle Snmp

2-0: check $ORACLE_HOME/network/snmp/peer/CONFIG.master
COMMUNITY public
ALLOW ALL OPERATIONS
USE NO ENCRYPTION
MANAGER xxx.xxx.xxx.xxx
SEND ALL TRAPS

2-1: check $ORACLE_HOME/network/snmp/peer/CONFIG.encap
AGENT AT PORT 1161 WITH COMMUNITY public
SUBTREES 1.3.6.1.2.1.1,
1.3.6.1.2.1.2,
1.3.6.1.2.1.3,
1.3.6.1.2.1.4,
1.3.6.1.2.1.5,
1.3.6.1.2.1.6,
1.3.6.1.2.1.7,
1.3.6.1.2.1.8,
1.3.6.1.4.1.11.2
FORWARD ALL TRAPS;

2-3: check start_peer
SNMPD=/usr/lib/snmp/snmpdx
SNMPD_CONFIG=/etc/snmp/conf
SNMPD_OPTIONS=-y


2-4: loging as root

%/bin/ksh
%export ORACLE_HOME=/oracle/816/product/8.1.6
%cd $ORACLE_HOME/network/snmp/peer/
%./start_peer -a
Starting master_peer ...
./master_peer CONFIG.master NOV >master_peer.out 2>&1 &
Done!

Starting encap_peer ...
./encap_peer -t 1162 -s 1160 -c CONFIG.encap >encap_peer.out 2>&1 &
Done!

Starting /usr/lib/snmp/snmpdx ...
/usr/lib/snmp/snmpdx -y -c /etc/snmp/conf -p 1161 >snmpd.out 2>&1 &
Done!

check files ( master_peer.out,encap_peer.out,snmpd.out )
there will be no content,if start oracle snmp success,like ..
%ls -ltr *.out
-rw-r--r-- 1 root other 0 nov 2 19:11 master_peer.out
-rw-r--r-- 1 root other 0 nov 2 19:11 encap_peer.out
-rw-r--r-- 1 root other 0 nov 2 19:11 snmpd.out

startup oracle listener for dbsnmp
su - oracle account
agentctl start
%snmpwalk -Os -v 1 -c public 172.16.28.223 1.3.6.1.4.1.111

Tuesday, December 04, 2007

Windows: computer cannot connect to some sites

Windows: Computer cannot connect to some websites to which other have absolutely no problems connecting:

ipconfig /flushdns

can help A LOT!!!

Thanks to my brother Moslem Saleh

Monday, December 03, 2007