Monday, November 7, 2011

Don't allow other computer to PING your server - Unix

The default is 0 means anyone can ping the machine

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

Thursday, October 27, 2011

How to Install GIT on Red Hat Enterprise Linux 6?

Download all the files that you required for git installation.

 rayarn@erp: wget http://git-core.googlecode.com/files/git-1.7.7.1.tar.gz
 rayarn@erp: wget -O git-manpages-1.7.7.1.tar.gz http://code.google.com/p/git-core/downloads/detail?name=git-manpages-1.7.7.1.tar.gz&can=2&q=

Install all required library before you continue building git if you haven't done this before or if your RHEL 6 is a fresh install.
  rayarn@erp: sudo yum install zlib-devel
  rayarn@erp: sudo yum install perl-CPAN
  rayarn@erp: sudo yum install gettext

Now let's make this a straightforward approach because the reason why you're reading this blog is to know how to install GIT to Red Hat Enterprise Linux 6 (RHEL 6) and I hope I am not required to explain all the command.

  rayarn@erp: tar xvfz git-1.7.7.1.tar.gz
  rayarn@erp: cd git-1.7.7.1
  rayarn@erp: ./configure
  rayarn@erp: make
  rayarn@erp: sudo make prefix=/usr install
  rayarn@erp: git --version

Expected output should be: git version 1.7.7.1

 



Thursday, October 20, 2011

Ubuntu 11.10 Internet stop working after upgrading from 11.04 desktop

After upgrading my Ubuntu 11.04 to 11.10, my internet browser (ie: firefox, chrome, etc) and I can't even ping google.com to check if I have a connection to the internet. But, I can ping my other machine.

The fix that I did was very simple:

If you're currently on your desktop please switch to a terminal

Step 1: CTRL + ALT + F1
Step 2: Enter your username and password
Step 3: Enter the following command

   sudo -i
   service network-manager stop
   dhclient eth0
   dpkg --configure -a


Then try to ping google.com and that should work. Don't forget to reboot or you can switch back to your desktop by pressing CTRL + ALT + F7

Friday, June 3, 2011

Installing DB2 Express C V9.7 Ubuntu 11.04 64 bit

Before installing the DB2 express C, install the Java first.

Step how to install Java 6
1. Open the file /etc/apt/source.list.
    sudo nano /etc/apt/sources.list

2. Search the following two lines and uncomment it and then save the file.
Tip:
    To SEARCH a context using nano editor press [CTRL W] then type the text [archive.canonical] then press enter and you will see the cursor pointing to one of the result.
    To SAVE a file press using nano editor press [CTRL X] then press Y for yes
 

    deb http://archive.canonical.com/ubuntu/ natty partner
    deb-src http://archive.canonical.com/ubuntu/ natty partner

3. Issue the following command
    sudo apt-get update
    sudo apt-get install sun-java6-jdk
Note: This will take several minutes depends on your bandwidth.

4. Execute the command to check if the java is really installed
    java -version
        java version "1.6.0_24"
        Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
        Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
 

5. Now your done for Java installation.

Steps on how to Install DB2 Express C to Ubuntu 11.04

1. Download the DB2 Express C 9.7 from IBM website
 

2. Extract the file using command "sudo tar -zxvf "
 

3. Execute the command to check if db2 have the required library
      "sudo ./db2prereqcheck"

4. If there is an warning or error like the message below, go to step 5 else go to to step 6
WARNING:
   The 32 bit library file libstdc++.so.6 is not found on the system.
   32-bit applications may be affected. 
ERROR:
   The required library file libaio.so.1 is not found on the system.
   Check the following web site for the up-to-date system requirements
   of IBM DB2 9.7
   http://www.ibm.com/software/data/db2/udb/sysreqs.html
   http://www.software.ibm.com/data/db2/linux/validate 

5. You only need to execute the command below if you see similar message from step 4
    Command to fix step 4: sudo apt-get install libaio1

6. Now lets force to install the DB2 even if there is a warning message
    sudo ./db2install -f sysreq

7. After installing the DB2 express C core on the default directory "/opt/ibm/db2/V9.7" we still need to configure the installed DB2.

Steps for configuring the installed DB2
1. We need to login as a root using the command "su"

2. Add the following user db2inst1, db2fenc1 and db2das1
    useradd -m db2inst1
    passwd db2inst1

    useradd -m db2fenc1
    passwd db2fenc1

    useradd -m db2das1
    passwd db2das1
Note:     db2das1 user is for administration server instance
    db2inst1 user is a single instance DB user
   
3. Execute the command below to assign db2das1 for administrative role in DB2
    [your DB2 directory]/instance/dascrt -u db2das1

4. Now, lets create a db2 instance user
    [your DB2 directory]/instance/db2icrt -a server -u db2fenc1 db2inst1

5. Next lets create a link
    [your DB2 directory]/cfg/db2ln

Next Steps is to enable the TCP access to DB2

1. sudo nano /etc/services
        db2c_db2inst1 10100/tcp # DB2 connection service port

2. logout and login as db2inst1 user

3. Stop and start the db2
    db2stop [enter]
    db2start [enter]

4. Update the manager config
    db2 [enter]
            type "update database manager configuration using svcename db2c_db2inst1" then [enter]

3. Stop and start the db2
    db2stop [enter]
    db2start [enter]

5. Verify the config
    db2 [enter]
            type "get database manager config" then [enter]

6. Quit the db2 CLP by entering "quit"

7. Set the DB2COMM
    db2set DB2COMM=tcpip [enter]

8. Stop and start the db2
    db2stop [enter]
    db2start [enter]

9. Check if the TCP IP is open netstat -lnt | grep 10100
        tcp        0      0 0.0.0.0:10100           0.0.0.0:*               LISTEN

10. Now you're done and the DB2 is read to use.

If you want to have an automatic startup of your DB2 please follow the steps below:

1. Create a file in /etc/init.d/db2
    sudo nano /etc/init.d/db2

2. Copy and paste all the content below to the "db2" file and save it "CTRL X" then "Y"
#! /bin/sh
        set -e
        case "$1" in
          start)
                sudo su - db2inst1 -c 'db2start' >> /tmp/db2initd.log
                sudo su - db2das1 -c 'db2admin start' >> /tmp/db2initd.log
                ;;
          stop)
                sudo su - db2das1 -c 'db2admin stop' >> /tmp/db2initd.log
                sudo su - db2inst1 -c 'db2stop' >> /tmp/db2initd.log
                ;;
          *)
                exit 1
        esac
        exit 0

3. Change the mod of the file with +x
    sudo chmod +x /etc/init.d/db2

4. Add the the "/etc/init.d/db2 start" before exit 0 to /etc/rc.local
    sudo nano /etc/rc.local

    .....
    /etc/init.d/db2 start
    .....
    exit 0
 
For more information just post your comments. By i101

Thursday, May 26, 2011

How to start automaticaly the Synergy Client using Ubuntu 11.04 Desktop connecting to a Sysnergy Server



Note: This instruction is for GDM

Step 1: Edit the file Default

sudo nano /etc/gdm/Init/Default

Step 2: Add the following lines to Default before the "sysmodmap=etc/X11/Xmodmap"

MYSYNCLIENT='gdmwhich synergyc'
if [ x$MYSYNCLIENT != x ] ; then
        $MYSYNCLIENT
fi

example:
MYSYNCLIENT='gdmwhich synergyc'
if [ x$MYSYNCLIENT != x ] ; then
        $MYSYNCLIENT 192.168.1.200
fi


Step 3: Press CTRL + X to save the file then press [Y]

Where not done yet. The instruction above is only for the session before login. Next instruction is for after login. The problem above is when the user successfully login, the session of the sysnergy will lost so we will need to start the synergy client again after login. Just follow the steps

Step 1: Edit the PreSession Default file.

sudo nano /etc/gdm/PreSession/Default

Step 2: Add the following code before the "XSETROOT='gdmwhich xsetroot'" line.

MYSYNCLIENT='gdmwhich synergyc'
if [ x$MYSYNCLIENT != x ] ; then
        $MYSYNCLIENT 
fi
 
example:
MYSYNCLIENT='gdmwhich synergyc'
if [ x$MYSYNCLIENT != x ] ; then
        $MYSYNCLIENT 192.168.1.200
fi
  

Step 3: Reboot your Ubuntu Machine i.e. sudo reboot