configuration postgresql & phpPgAdmin Januari 29, 2009
Posted by setijoagus in Linux, postgresql.Tags: phpPgAdmin, postgresql
add a comment
1. download
http://transact.dl.sourceforge.net/sourceforge/phppgadmin/phpPgAdmin-4.2.2.tar.gz
2. extract
[root@bb ~]# tar xvf /home/admin/-4.2.2.tar.gz -C /var/www/html/
[root@bb ~]# cd /var/www/html/
[root@bb html]# mv phpPgAdmin-4.2.2 phpPgAdmin
3. edit config
[root@bb html]# cd phpPgAdmin/
[root@bb phpPgAdmin]# vim conf/config.inc.php
$conf['servers'][0]['host'] = ‘172.20.88.88′;
4. testing
[root@bb phpPgAdmin]# firefox http://172.20.88.88/phpPgAdmin
Your PHP installation does not support PostgreSQL. You need to recompile PHP using the –with-pgsql configure option.
5. check package
[root@bb php.d]# rpm -qa | grep php
php-common-5.1.6-5.el5
php-cli-5.1.6-5.el5
php-5.1.6-5.el5
php-ldap-5.1.6-5.el5
[root@bb php.d]# rpm -ivh php-pgsql-5.1.6-5.el5.i386.rpm php-pdo-5.1.6-5.el5.i386.rpm
[root@bb php.d]# service httpd restart
6. testing
[root@bb phpPgAdmin]# firefox http://172.20.88.88/phpPgAdmin
myubuntu Januari 28, 2009
Posted by setijoagus in Linux.Tags: mc, oracle, wine
add a comment
1. update ubuntu
sudo apt-get update
2. powers tools : mc
sudo apt-get install mc
3. network service ssh, ftp, vnc, samba & tool neighberhood
sudo apt-get install ssh
sudo apt-get install vsftpd
sudo apt-get install x11vnc vnc-common
sudo apt-get install samba smbfs
sudo apt-get install pyneighborhood
4. zip, rar & ntfs tools
sudo apt-get install unrar unzip
sudo apt-get install ntfs-3g
5. effect 3d open office
sudo apt-get install openoffice.org-ogltrans
6. play video
sudo apt-get install vlc
sudo apt-get install w32codecs vlc gxine
7. config ftp
sudo vim /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
ubs@ubs:~$ sudo /etc/init.d/vsftpd restart
* Stopping FTP server: vsftpd [ OK ]
* Starting FTP server: vsftpd [ OK ]
8. wine
wine –version
winecfg
wine regedit
a. edit regedit software
HKEY_LOCAL_MACHINE > Software > New > Key > Oracle
New > string value > label : ORACLE_HOME
Value data > C:\ORA
b. edit regedit Environment
HKEY_LOCAL_MACHINE > System > CurrentControlSet > Control > SessionManager
> Environment : add to PATH C:\ORA;C:\ORA\BIN
c. Creating directories for instant client
cd ~
cd .wine
cd drive_c
mkdir -p ORA/BIN
mkdir -p ORA/NETWORK/ADMIN
d. Decompress contents from instant client archive
unzip instantclient-basic-win32-10.2.0.3-20061115.zip
cp ~/instantclient_10_2/* ~/.wine/drive_c/ORA/BIN/
e. Create/Get copy of tnsnames.ora
vim ~/.wine/drive_c/ORA/NETWORK/ADMIN/tnsnames.ora
ppc =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.141.25)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ppc)
(INSTANCE_NAME = ppc)
)
)
Remote GUI Linux with Forwarding in SSH Clients (putty) Januari 27, 2009
Posted by setijoagus in Linux, Network.Tags: putty, xming
add a comment
Remote GUI Linux with Forwarding in SSH Clients (putty)
1. download Xming-mesa-6-9-0-31-setup.exe
http://sourceforge.net/project/downloading.php?group_id=156984&filename=Xming-mesa-6-9-0-31-setup.exe
2. download putty.exe
http://the.earth.li/~sgtatham/putty/0.60/x86/putty.exe
3. In the PuTTY configuration window, select “Connection->SSH->X11″ and make sure the “Enable X11 forwarding box is checked
4. edit /etc/ssh/sshd_config
[root@bb ~]# vi /etc/ssh/sshd_config
# X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
5. reload SSH
[root@bb ~]# service sshd reload
Reloading sshd: [ OK ]
6. running xming
7. running putty
8. test konqueror

Mengenal postgresql Januari 27, 2009
Posted by setijoagus in Linux, postgresql.Tags: postgresql
2 comments
1. start, shutdown postgresql
[root@bb bb]# service postgresql start
Initializing database: [ OK ]
Starting postgresql service: [ OK ]
[root@bb bb]# chkconfig postgresql on
[root@bb bb]# su potsgres
su: user potsgres does not exist
[root@bb bb]# su – postgres
2. createdb, dropdb
-bash-3.1$ createdb test
CREATE DATABASE
-bash-3.1$ psql test
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
test=# \q
-bash-3.1$ dropdb test
DROP DATABASE
3. createuser, dropuser
-bash-3.1$ createuser bb
Shall the new role be a superuser? (y/n) y
CREATE ROLE
-bash-3.1$ dropuser bb
DROP ROLE
4. createuser & createdb
-bash-3.1$ createuser bb -P
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
CREATE ROLE
-bash-3.1$ createdb bb
CREATE DATABASE
-bash-3.1$ exit
logout
[root@bb ~]# su – bb
[bb@bb ~]$ psql
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
-bash-3.1$ createuser admin -P
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
CREATE ROLE
5. edit configuration
error : postgresql fatal: ident authentication failed for user
[bb@bb ~]$ su – root
Password:
[root@bb ~]# vi /var/lib/pgsql/data/pg_hba.conf
# “local” is for Unix domain socket connections only
local all all password
host all all 127.0.0.1/32 password
host all all 172.20.0.0/16 password
host all all ::1/128 trust
[root@bb ~]# vi /var/lib/pgsql/data/postgresql.conf
listen_addresses = ‘*’
[root@bb ~]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
[root@bb ~]# exit
6. general command in PostgreSQL
\l :List databases
\c database-name :List databases
\d :List tables in database
\d table-name
escribe table
select * from table-name :List table contents
[bb@bb ~]$ psql -U bb -d bb -W
Password for user bb:
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
bb=# \l
List of databases
Name | Owner | Encoding
———-+———-+———-
bb | postgres | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
test2 | bb | UTF8
(5 rows)
bb=# \c
Password:
You are now connected to database “bb” as user “bb”.
bb=# \d
No relations found.
7. select database
bb=# \c test2
Password for user bb:
You are now connected to database “test2″.
test2=# \d
List of relations
Schema | Name | Type | Owner
——–+——————-+———-+——-
public | barang | table | bb
public | barang_id_seq | sequence | bb
test2=# \q
[bb@bb ~]$
8. test connection
[admin@bb ~]$ psql -U admin -d test2 -W
Password for user admin:
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
test2=# \q
9. test connection from ip
[admin@bb ~]$ psql -U admin -d test2 -h 172.20.88.88 -W
Password for user admin:
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
test2=# \q
Remote GUI Linux with XDMCP protocol from windows Januari 27, 2009
Posted by setijoagus in Linux, Network.Tags: remote gui, xdmcp
2 comments
XDMCP (X Display Manager Control Protocol)
1. edit /etc/gdm/custom.conf and add
[root@bb ~]# vi /etc/gdm/custom.conf
[xdmcp]
Enable=true
2. Edit /etc/rc.d/init.d/xfs
[root@bb gdm]# vi /etc/rc.d/init.d/xfs
from :
daemon xfs –droppriv –daemon –port -1
to :
daemon xfs –droppriv –daemon –port 7000
3. Reboot Linux
4. download xmanager software from http://www.netsarang.com
5. enjoy Remote GUI Linux with XDMCP protocol from windows
scp vs rsync Januari 23, 2009
Posted by setijoagus in Linux.Tags: rsync, scp
add a comment
1. scp
a. source
[root@rac3 ~]# ls -la /home/oracle/start.sql
-rw-r–r– 1 oracle oinstall 16 Dec 30 07:44 /home/oracle/start.sql
[root@rac3 ~]# scp /home/oracle/start.sql root@172.20.140.11:/home/setijo
start.sql 100% 16 0.0KB/s 00:00
b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 root root 16 Jan 23 08:35 /home/setijo/start.sql
2. scp with preserve
a. source
[root@rac3 ~]# scp -p /home/oracle/start.sql root@172.20.140.11:/home/setijo
root@172.20.140.11’s password:
start.sql 100% 16 0.0KB/s 00:00
b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 root root 16 Dec 30 07:44 /home/setijo/start.sql
3. rsync
a. source
[root@rac3 ~]# rsync -avz /home/oracle/start.sql root@172.20.140.11:/home/setijo
root@172.20.140.11’s password:
building file list … done
sent 80 bytes received 16 bytes 4.68 bytes/sec
total size is 16 speedup is 0.17
[root@rac3 ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin)
b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 agus agus 16 Dec 30 07:44 /home/setijo/start.sql
[root@ptubs root]# id agus
uid=500(agus) gid=500(agus) groups=500(agus)
conculsion
use rsync for copy without change owner and mode file
Anti Virus for Linux : Panda Antivirus Linux Januari 21, 2009
Posted by setijoagus in Linux.Tags: antivirus, Linux
add a comment
1. download From: http://shareware.pandasoftware.com/shareware/pavcl_linux_i386.rpm
Size: 5.5 MB (5,734,578 bytes)
2. download virus database From: http://fs1.soft82.com/files/27ad25da3df2548a6adffd20c7fd4ee0-29030/pav.zip
Size: 12.1 MB (12,680,799 bytes)
3. install
[root@rdsvr ~]# rpm -ivh pavcl_linux_i386.rpm
4. update virus database
[root@rdsvr ~]# unzip pav.zip
Archive: pav.zip
inflating: pav.sig
[root@rdsvr ~]# mv pav.sig /usr/lib/panda/
mv: overwrite `/usr/lib/panda/pav.sig’? y
5. command panda anti virus command line
[root@rdsvr ~]# pavcl
Panda Antivirus Linux, (c) Panda Software 2004
Syntax: pavcl <path> [Parameters]
Example: pavcl /mnt/DOS -aex -clv
Possible parameters:
-nbr Does not allow interrupting the program with Ctrl-C.
-clv Remove the viruses found.
-del Delete infected files.
-ren Rename infected files.
-sav Saves the parameters to a file for its use the next time it is run.
-nsb Do not scan nested subdirectories.
-heu Activate heuristic detection method.
-cmp Search for viruses into compressed files.
-nso Deactivate sounds.
-nor Do not generate a result file.
-aex Scan all files, independently of their extension.
-aut Scan without user intervention.
-mbr Scan boot sectors.
-tsr Run in resident mode.
-ulr Finish resident mode.
-esp Change to SPANISH language.
-eng Change to ENGLISH language.
-nojoke Do not detect jokes.
-nodial Do not detect dialers.
-nohackt Do not detect hacking tools.
-nospyw Do not detect spyware.
-pth Scan the directories specified in the path environment variable.
-xbit Analyze all executable files.
-info Show configuration status information.
-help Show this help screens.
6. test scan
[root@rdsvr ~]# pavcl /dt03/sketsa2 -clv -aut
Panda Antivirus Linux, (c) Panda Software 2004
Number of detectable viruses and mutations .: 451044
Last revision of the virus file …………: 13/01/2009
Panda Antivirus Linux, (c) Panda Software 2004
Time employed for scan ………….: 00:00:12
Number of files scanned …………: 108
Number of files infected ………..: 0
Copyright Panda Software
copy dengan mode dan hak akses tidak berubah Januari 17, 2009
Posted by setijoagus in Linux.Tags: cp, hak akses, Linux, preserve
add a comment
Kadang kala ada suatu kebutuhna untuk melakukan clone harddisk karena misalnya harddisk penuh / rusak, jika dipindah secara manual pakai perintah cp, maka akibatnya mode dan hak akses berubah. Tetapi untungnya di linux ada perintah preserve
a. file yang akan dicopy
[root@linux ~]# ls -la /u04/lh/staff/OYONG.lnk
-rwxrw-r– 1 SITO lh_staff 758 Aug 20 2007 /u04/lh/staff/OYONG.lnk
b. perintah copy tanpa tambahan
[root@linux ~]# cp /u04/lh/staff/OYONG.lnk /root
c. hasil copy berubah hak aksesnya
[root@linux ~]# ls -la /root/OYONG.lnk
-rwxr–r– 1 root root 758 Jan 17 09:53 /root/OYONG.lnk
d. ulangi dengan tambahan perintah preserve
[root@linux ~]# cp /u04/lh/staff/OYONG.lnk /root –preserve
cp: overwrite `/root/OYONG.lnk’? y
e. hasil copy tidak berubah hak aksesnya
[root@linux ~]# ls -la /root/OYONG.lnk
-rwxrw-r– 1 SITO lh_staff 758 Aug 20 2007 /root/OYONG.lnk
Install Oracle 11g RAC 64 bit Januari 2, 2009
Posted by setijoagus in Oracle Install, oracle.Tags: 64 bit, oracle 11g, RAC
2 comments
Oracle : database 11g 64 bit
clusterware 11g 64 bit
O/S : Linux Centos 5.2 64 bit
Desktop : intel pentium dual core x 4

SAN : Hitachi Tagma Store
SAN switch : Brocade 200E
HBA Card : Emulex Card
HUB : hub switch 16 port prolink
KVM : manual

download rpm : redhat-release-5-1.0.el5.centos.1.i386
http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle11gRAC/Install11gR1RACOnCentOS51/RPMS/redhat-release-5-1.0.el5.centos.1.i386.rpm
New Install Oracle – Basic init.ora Januari 2, 2009
Posted by setijoagus in Oracle Install, oracle.Tags: init.ora, oracle
add a comment
Karena terlalu seringnya install oracle database server, maka juga sering juga (lho kok) lupa setting apa saja yang perlu diperhatikan agar oracle database dapat digunakan secara optimal menurut pengalaman saya, paling tidak adalah :
a. sessions
SQL> alter system set sessions = 335 scope=spfile;
b. open_cursors
SQL> alter system set open_cursors = 600 scope=spfile;
c. processes
SQL> alter system set processes = 300 scope=spfile;
d. archive
SQL> alter database archivelog;
SQL> alter system set log_archive_dest_1=’location=/u03′;
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u03
Oldest online log sequence 1124
Next log sequence to archive 1125
Current log sequence 1125
e. memory
SQL> alter system set memory_max_target=3G scope=spfile;
SQL> alter system set memory_target=3G scope=spfile;
SQL> alter system set sga_max_size=3G scope=spfile;
SQL> alter system set sga_target=0 scope=spfile;
f. schedulle backup dmp
$ crontab -e
0 0 * * 1,3,5 /backup/script/back01b
30 0 * * 1,3,5 /backup/script/back01c
0 0 * * 2,4,6 /backup/script/back02b
30 0 * * 2,4,6 /backup/script/back02c
0 0 * * 7 /backup/script/back03b
30 0 * * 7 /backup/script/back03c



