Wednesday, January 30, 2008

Ubuntu as nis client for Solaris

Since YP reports map files from Solaris to have dots like auto.master instead of underscores like auto_master; /etc/init.d/autofs must be changed to replace underscores with dot just like REDHAT.


a varible UNDERSCORETODOT=1 is added under the debian section and when the value is checked I replceed the below statement

map=`basename $map | sed -e s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/`

with

map=`basename $map | sed -e s/auto_/auto./g`

now all underscores are converted into dots.

Monday, January 28, 2008

oracle 9 default alret log

$ORACLE_HOME/rdbms/log

Monday, January 07, 2008

ethernet conenction bonding RHEL

This one works
http://www.howtoforge.com/network_card_bonding_centos

Sunday, January 06, 2008

linux create iso

dd if=/dev/cdrom of=/root/my_cd1.iso

Saturday, January 05, 2008

Solaris Automount NFS with linux clients

Solaris Box:
0. /et/defaultdomain :: Put NIS domain name here

1. vi /etc/dfs/dfstab
share -F nfs -o rw /apps1
share -F nfs -o rw /home1
share -F nfs -o rw /data

2. vi /etc/auto_master
/apps1 auto_apps -nosuid,nobrowse

3. vi /etc/auto_apps
oracle -ro s2:/apps1/oracle
gf_admin -rw s2:/apps1/gf_admin

4. vi /var/yp/Makefile
Copy the section auto_home and auto.home and create corresponding auto_apps and auto.apps sections

5. make

6. *TO DO*: to prevent the NIS server from automounting its own directories and consecutively not seeing the contents of those - falsely automounted - directories I removed the "files nis" tags in front of automount in /etc/nssswitch.conf

Linux Box:
7. /etc/sysconfig/network :: put NISDOMAIN=$nisdomainname

8. /etc/yp.bind :: specify server and NIS Domain name

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

Tuesday, November 27, 2007

Oracle minimal client installation

1. Oracle basic client/or basic lite in case you need only English language. (oracle litebasic for windows is only 8 megs, how beautiful is that!)

2. These environment variables are to be set:

$ENV{'ORACLE_HOME'} = "d:/oracle";
$ENV{'TNS_ADMIN'} = "d:/oracle";
$ENV{'LD_LIBRARY_PATH'} = "d:/oracle";

3. Put tnsnames.ora in the path specified by $ENV{'TNS_ADMIN'}

Sunday, November 25, 2007

DBD::Oracle Activestate Perl on Windows

1. Oracle 9 oci.dll has problems with the function calls within oralce.dll by Activestate

2. Do not use the Graphical Perl Package Manager use ppm install/uninstall command prompt tool instead

3. Download the Oracle instant client avaiable from Activestate. (agree to the oracle disclaimer at the end of the ppm install DBD-oracle)

4. If after complete installation of DBD-Oracle still you got messages like procedure entry point not found, replace the oralce client oci.dll with the ones provided by activestate.

You are good to go

Monday, November 19, 2007

Oracle Sort Paging

Oracle does not have the keyword limit like mysql, you have to select couple of rows and limit them by rownumbers, this may cause problems when sorting because you may only sort the set that you have selected, so first select and sort all then limit by rownums

select * from
    (select p.*, rownum r from
        (select * from all_objects order by object_name) p
    where rownum < 20)
where r > 10;

THANKS ASKTOM

Friday, November 16, 2007

bash echo problem with filenames with whitespaces

taken from http://textsnippets.com/posts/show/1105 --thanks so much guys

Bash Internal field seperator has to be changed to $'\n' like this

export IFS=$'\n'

now when u do
for i in `ls`;echo $i;done

spaces will not be treated as field seperators and consequently the whole filename is displayed completely.

Sunday, November 11, 2007

ORACLE 9 installation document error

ALTHOUGH oracle 9 installation document tells you that ORACLE_BASE does not have to be set prior to installation of oracle, THIS IS TOTAL BULLSHIT!!!!! YOU HAVE TO SET ORACLE_BASE.