Wednesday, September 12, 2012

RedHat Server IP Address configuration

In RedHat Linux, following steps can be used for configuring IP address of the machine. For modifying files, you must be logged as root user.

1) Log as root
2) Change directory to "/etc/sysconfig/network-scripts"
3) vi ifcfg-eth0 file & add following parameters

    IPADDR =192.168.102.10
    NETMASK=192.168.102.1

4) Restart network adapter using following command.

    /etc/init.d/network restart

5) Check IP address using ifconfig command.


Change file permission for execution

In Linux, it can be used chmod command to change permission of the file.

Simply, this can be done using as follows.

 chmod +x application.bin

Above +x means, file is grated for execution.

Tuesday, September 11, 2012

Linux crontab Command

crontab is used for executing scheduled processes. For example, you can run database backup everyday using schell script.

crontab -l 

Above command list the all available crontab command.

crontab -e

This command can be used to edit crontab command fro your preference.

Sample crontab command is shown below. This script.sh script is executed every day at midnight.
0 0 means zero minute at zero hours(midnight).

0 0 * * * /home/sujith/script.sh

Wednesday, September 5, 2012

MySQL days between SQL Syntax (Between Days)

In MySQL, there is a special ways to get data between two days.

select * from ret_bonus where DATE(start_time) between date_sub(curdate(), interval 5 day) and CURDATE()

Above SQL returns data between today and 5days before today. 

date_sub(curdate(), interval 5 day)

This MySQL command returns 5days before today. 

Tuesday, August 21, 2012

SQL Joins Graphical Illustration



http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

Oracle Toad database configuration

# tnsnames.ora Network Configuration File: C:\Oracle\product\11.2.0\client_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

CONFIGNAME=
  (DESCRIPTION=
    (ADDRESS_LIST=
      (ADDRESS=
        (PROTOCOL=TCP)
        (HOST=192.162.129.141)
        (PORT=1521)
      )
      (ADDRESS=
        (PROTOCOL=TCP)
        (HOST=192.165.119.161)
        (PORT=1521)
      )
    )
    (CONNECT_DATA=
      (SERVICE_NAME=ServiceName)
    )
  )

In Oracle Toad, it needs to configure Toad to connect to Oracle database. Store "tnsnames.ora" file at "C:\Oracle\product\11.2.0\client_1\network\admin\" directory. Then connect via Oracle Toad.

Wednesday, August 8, 2012

Jasper subreport duplicate values

When you printing a collection of data, you have to use a subreport to print data.

There are parameters, that you can use to customize your printing.

But, default parameters set subreport to print duplicate values. To avoid that change following parameters as mentioned below.

In subreport component,

Print When Detail Overflows true
Stretch Type Relative to Tallest Object

In the components inside the subreport,

Print Repeated Values true
Remove Line When Blank  false
Print In First Whole Band         false
Print When Detail Overflows false
Blank When Null    true
Stretch With Overflow true
Stretch Type Relative to Tallest Object

This changes works fine in both iReport 3.5 & 3.7 versions.