Thursday, June 12, 2008

iptables Packet Route

This picture will show how packet processed on firewall



Source :
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables

Thursday, May 22, 2008

[OOT] Speedy

Quiet amaze with speedy, this afternoon my speedy connection was down. Then I log in to router console, disconnect my speedy and then reconnect.

My office using speedy (Office package 384 Kbps). I was shocked seeing download rate on web interface, it show 1029 Kbps. And then I tested the connection through www.speedtest.net and I was amaze to see this ;)

Friday, May 16, 2008

Recompile Kernel on CentOS 4.6

1. Download the latest kernel source from kernel.org

2. Copy kernel source to /usr/src/kernel/ and unpack it
[root@appdev kernels]tar jxvf linux-2.6.25.3.tar.bz2

3. Copy config files from original kernel
[root@appdev kernels]# cd linux-2.6.25.3
[root@appdev linux-2.6.25.3]# cp /boot/config-2.6.9-67.0.15.ELsmp .config
[root@appdev linux-2.6.25.3]# make menuconfig

and then exit

4. Rebuild RPM package
[root@appdev linux-2.6.25.3]# make rpm

5. You will find src rpm and rpm package on /usr/src/redhat/RPMS and /usr/src/redhat/ SRPMS

6. Install the new rpm package
[root@appdev]#rpm -ivh --nodeps /usr/src/redhat/RPMS/i386/kernel-2.6.25.3-1.i386.rpm

7. Make init files
[root@appdev]#mkinitrd /boot/initrd-kernel-2.6.25.3.img 2.6.25.3

8. Edit boot loader and add the new kernel
[root@appdev]#vi /boot/grub/grub.conf

9. Reboot the system
[root@appdev]#shutdown now -r

This article taken from
http://www.howtoforge.com/kernel_compilation_centos

Wednesday, May 7, 2008

Masquerade on sendmail and SMTP Route

add this line to /etc/mail/sendmail.mc for masquerading
# vi /etc/mail/sendmail.mc

MASQUERADE_AS(gudangsms.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(
gudangsms.com)dnl

add this line to /etc/mail/sendmail.mc for SMTP Route
define(`SMART_HOST',`smtp.gudangsms.com')

compile configuration files
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

restart sendmail
# /etc/init.d/sendmail restart

Tuesday, May 6, 2008

Recreate TEMP tablespace

1. Create another temp tablespace
SQL> CREATE TEMPORARY TABLESPACE temp2
2 TEMPFILE '/u02/oradata/TESTDB/temp2_01.dbf' SIZE 5M REUSE
3 AUTOEXTEND ON NEXT 1M MAXSIZE unlimited
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

2. Move default temporary tablespace on every user
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

3. Drop default tablespace
SQL> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

4. Create default temp tablespace
SQL> CREATE TEMPORARY TABLESPACE temp
2 TEMPFILE '/u02/oradata/TESTDB/temp01.dbf' SIZE 500M REUSE
3 AUTOEXTEND ON NEXT 100M MAXSIZE unlimited
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

5. Re-move again default temp tablespace
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

6. Drop second temp tablespace

SQL> DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;

Monday, April 28, 2008

Installing perl modules using CPAN on Linux

Go to terminal console as root

#perl -MCPAN -e 'shell'

cpan> install Net::DNS

That's all ;)

Wednesday, April 2, 2008

Make Self signed certificate

We can make self signed certificate for development or UAT env:

1. Create server key
umask 77
/usr/bin/openssl genrsa -des3 1024 > server.key

This will ask you passphrase, and this passphrase will be asked each time apache restarted. If you dont want this passphrase being asked, use this command instead.

umask 77
/usr/bin/openssl genrsa 1024 > server.key

2. Create server certificate
/usr/bin/openssl req -new -key server.key -x509 -days 365 -out server.crt

You will be askes some question
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:ID
State or Province Name (full name) [Berkshire]:DKI Jakarta
Locality Name (eg, city) [Newbury]:Jakarta
Organization Name (eg, company) [My Company Ltd]:PT GudangSMS
Organizational Unit Name (eg, section) []:Operation
Common Name (eg, your name or your server's hostname) []:secure.gudangsms.com
Email Address []:admin@gudangsms.com