Thursday, November 22, 2007

Mule the leading open source ESB and integration platform

Mule is a messaging platform based on ideas from Enterprise Service Bus (ESB) architectures. An ESB works by acting as a sort of transit system for carrying data between applications within or outside your Intranet. The ESB defines a series of stops, or "endpoints", through which applications can send or receive data onto or from the system. The heart of the system, the messaging bus, is what routes messages between endpoints. The messaging backbone of the ESB is usually implemented using JMS, but any other message server implementation could be used, such as MSMQ, IBM MQ Series or Tibco Rendevouz.

Mule, in fact, goes beyond the typical definition of an ESB. We prefer to define Mule as a light-weight messaging framework that contains a distributable object broker for managing communication between applications. The point of the object broker is to manage service components. These components are called Universal Message Objects or UMOs, and are basically just plain old java objects (POJO). UMOs can exist in the same VM or can be scattered around your network and the Internet. The object broker itself follows a Staged Event Driven Architecture or SEDA design pattern. All communication between UMOs and other applications is made through message endpoints. These endpoints provide a simple and consistent interface to vastly disparate technologies such as JMS, SMTP, JDBC, TCP, HTTP, XMPP, file, etc.

Refer : http://mule.mulesource.org/display/MULE/Home

Start Using it, then you will feel the diffirence

Thursday, October 25, 2007

How to convert CHM file to HTML format

This command only used with Windows platform.

hh.exe -decompile extracted filename.chm

eg:
hh.exe -decompile ss7_html_ebook ss7_ebook.chm

Thursday, September 27, 2007

Get the ethenet details - Linux

Open the /etc/sysconfig/network-scripts/ifcfg-eth0 file and it consists of all the details.
eg:

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:16:35:0C:63:D4
ONBOOT=yes
TYPE=Ethernet
DHCP_HOSTNAME=thilina
USERCTL=no
PEERDNS=yes
IPV6INIT=no
IPADDR=192.168.0.57
NETMASK=255.255.255.0
GATEWAY=192.168.0.201

Monday, September 3, 2007

Installing Mplayer in Fedore

1) Download the rpm (Achitecture independant rpm package) and install
http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/4/freshrpms-release/

shell>rpm -ivh
freshrpms-release-1.1-1.fc.noarch.rpm

2) Run following command
yum install mplayer mplayer-skins mplayer-fonts mplayerplug-in mplayer-gui

Monday, August 20, 2007

In Unix, how can I uncompress *.Z or *.tar.Z files?

Use zcat *.Z | tar -xvf -

For more info refer http://kb.iu.edu/data/acsy.html

Tuesday, August 7, 2007

Display lost after changing the resolution in Linux

I have change the resolution from 800x600 to 1024x768 and restarted the computer. Then the display didn't come out and could not able to do anything.

Have you ever encounter this problem?

So to get the display back with previous settings (ie. 800x600) follow the following steps.
1) Open /etc/X11/xorg.conf
2) Edit the following section as nessary.
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
Modes "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Wednesday, July 18, 2007

Search Engine Optimization techniques

Pls go through this site http://www.iprcom.com/papers/pagerank/

And check example 3 and 13.

The following few things which I found important for site.

Say your going to enhance rank in http://hsenid.com site.

1. Need to get more referral to hsenid site from other external sites. It can be forum site or any posting sites.
2. In above referral sites, number links should be kept minimum value to get more rank.
3. Powered by text should refer hsenid.com from customer sites, any other hsenid sites such beyondm,net, hsenid.lk,…..
4. Keep all main key words in main page – such as “mobile banking”. Those texts prefer to be headings and bold. If those texts are not relevant to page contents. Those texts can kept as same as background color of page.



Here forum site about google, ranking and tools..
http://webproworld.com/viewforum.php?f=7




With Google Sitemaps you get:

  • Better crawl coverage to help people find more of your web pages
  • Fresher search results
  • A smarter crawl because you can provide specific information about all your web pages, such as when a page was last modified or how frequently a page changes


http://www.xml-sitemaps.com,

Tuesday, July 17, 2007

Usefull MySQL commands

1) Get the Mysql version
mysql> SELECT VERSION();

+-----------------+

| VERSION() |

+-----------------+

| 5.0.10-beta-log |

+-----------------+

2) Describe a table (ie to get the table schema)

mysql> DESCRIBE City;

+-------------+----------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra |

+-------------+----------+------+-----+---------+----------------+

| ID | int(11) | NO | PRI | NULL | auto_increment |

| Name | char(35) | NO | | | |

| CountryCode | char(3) | NO | | | |

| District | char(20) | NO | | | |

| Population | int(11) | NO | | 0 | |

+-------------+----------+------+-----+---------+----------------+


3) As an alternative to specifying options on the command line, you can place them in an option file /etc/my.cnf
The standard MySQL client programs look for option files at startup time and use any appropriate options they find there. Putting an option in a file saves you time and effort because you need not specify the option on the command line each time you invoke a program.

4) i. Many operational characteristics of MySQL Server can be configured by setting the SQL mode.
mysql>SET sql_mode = ANSI_QUOTES;
mysql>SET sql_mode = 'STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';

ii. To check the current sql_mode setting.
mysql> SELECT @@sql_mode;

+----------------------------------------------+

| @@sql_mode |

+----------------------------------------------+

| STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO |

+----------------------------------------------+

iii. ANSI - || to be treated as the string concatenation operator rather than as logical OR.
mysql>SET sql_mode=ANSI;
mysql> select 'hello' || 'world';
+--------------------+
| 'hello' || 'world' |
+--------------------+
| helloworld |
+--------------------+
1 row in set (0.00 sec)

iv. ERROR_FOR_DIVISION_BY_ZERO - By default, division by zero produces a result of NULL and is not treated specially. Enabling this mode causes division by zero in the context of inserting data into tables to produce a warning, or an error in strict mode.

mysql> SET @@sql_mode=ERROR_FOR_DIVISION_BY_ZERO;

mysql> select (5/0);
+-------+
| (5/0) |
+-------+
| NULL |
+-------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+-------+------+---------------+
| Level | Code | Message |
+-------+------+---------------+
| Error | 1365 | Division by 0 |
+-------+------+---------------+
1 row in set (0.00 sec)


v. IGNORE_SPACE - This allows spaces to appear between the name and the parenthesis.

mysql> select concat('hello', 'world');
+--------------------------+
| concat('hello', 'world') |
+--------------------------+
| helloworld |
+--------------------------+
1 row in set (0.00 sec)

mysql> select concat ('hello', 'world');
ERROR 1046 (3D000): No database selected

After setting the sql_mode to IGNORE_SPACE -

mysql> SET @@sql_mode=IGNORE_SPACE;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql> select concat ('hello', 'world');
+---------------------------+
| concat ('hello', 'world') |
+---------------------------+
| helloworld |
+---------------------------+
1 row in set (0.00 sec)



5) Select the currently used database.
mysql> SELECT DATABASE();

+------------+

| DATABASE() |

+------------+

| world |

+------------+


6) Check the create table script

mysql> show create table aa;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| aa | CREATE TABLE `aa` (
`id` double(5,2) default NULL,
`id2` double default NULL,
`name` varchar(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


7) Check the create database script

mysql> show create database xx;
+----------+---------------------------------------------------------------+
| Database | Create Database |
+----------+---------------------------------------------------------------+
| xx | CREATE DATABASE `xx` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+---------------------------------------------------------------+
1 row in set (0.00 sec)

8) Get the collations list
mysql> SHOW COLLATION LIKE 'latin1%';
+-------------------+---------+----+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+-------------------+---------+----+---------+----------+---------+
| latin1_german1_ci | latin1 | 5 | | | 0 |
| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 |
| latin1_danish_ci | latin1 | 15 | | | 0 |
| latin1_german2_ci | latin1 | 31 | | Yes | 2 |
| latin1_bin | latin1 | 47 | | Yes | 1 |
| latin1_general_ci | latin1 | 48 | | | 0 |
| latin1_general_cs | latin1 | 49 | | | 0 |
| latin1_spanish_ci | latin1 | 94 | | | 0 |
+-------------------+---------+----+---------+----------+---------+


9) Convert to uppercase

mysql> select upper('abc');
+--------------+
| upper('abc') |
+--------------+
| ABC |
+--------------+


10) Get the all character set

mysql> show CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| dec8 | DEC West European | dec8_swedish_ci | 1 |
| cp850 | DOS West European | cp850_general_ci | 1 |
| hp8 | HP West European | hp8_english_ci | 1 |
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 |
| latin1 | cp1252 West European | latin1_swedish_ci | 1 |
| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |
| swe7 | 7bit Swedish | swe7_swedish_ci | 1 |
| ascii | US ASCII | ascii_general_ci | 1 |
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 |
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |
| hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 |
| tis620 | TIS620 Thai | tis620_thai_ci | 1 |
| euckr | EUC-KR Korean | euckr_korean_ci | 2 |
| koi8u | KOI8-U Ukrainian | koi8u_general_ci | 1 |
| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 |
| greek | ISO 8859-7 Greek | greek_general_ci | 1 |
| cp1250 | Windows Central European | cp1250_general_ci | 1 |
| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 |
| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |
| armscii8 | ARMSCII-8 Armenian | armscii8_general_ci | 1 |
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 |
| cp866 | DOS Russian | cp866_general_ci | 1 |
| keybcs2 | DOS Kamenicky Czech-Slovak | keybcs2_general_ci | 1 |
| macce | Mac Central European | macce_general_ci | 1 |
| macroman | Mac West European | macroman_general_ci | 1 |
| cp852 | DOS Central European | cp852_general_ci | 1 |
| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |
| cp1251 | Windows Cyrillic | cp1251_general_ci | 1 |
| cp1256 | Windows Arabic | cp1256_general_ci | 1 |
| cp1257 | Windows Baltic | cp1257_general_ci | 1 |
| binary | Binary pseudo charset | binary | 1 |
| geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 |
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |
+----------+-----------------------------+---------------------+--------+


11) Create a database with character set
mysql> create database xxx charset ucs2;

mysql> show create database xxx;
+----------+--------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------+
| xxx | CREATE DATABASE `xxx` /*!40100 DEFAULT CHARACTER SET ucs2 */ |
+----------+--------------------------------------------------------------+

12) Create a table with character set and collate

mysql> create table foot(id int) character set latin1 collate latin1_general_cs;

mysql> show create table foot;
+-------+--------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------------+
| foot | CREATE TABLE `foot` (
`id` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs |
+-------+--------------------------------------------------------------------------------------------------------------------+


13) Creata table field with character set and collate

mysql> create table aaa(id int, name varchar(12) character set latin1 collate latin1_general_cs);

mysql> show create table aaa;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| aaa | CREATE TABLE `aaa` (
`id` int(11) default NULL,
`name` varchar(12) character set latin1 collate latin1_general_cs default NULL
) ENGINE=MyISAM DEFAULT CHARSET=ucs2 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


14) Enumeration data type

CREATE TABLE booleans

(

yesno ENUM('yes','no'),

truefalse ENUM('true','false')

);

15) Set data type

CREATE TABLE allergy

(

symptom SET('sneezing','runny nose','stuffy head','red eyes')

);

16) The global and session time zone settings can be retrieved with the following statement:

mysql> SELECT @@global.time_zone, @@session.time_zone;

+--------------------+---------------------+

| @@global.time_zone | @@session.time_zone |

+--------------------+---------------------+

| SYSTEM | SYSTEM |

+--------------------+---------------------+

17) Get the last inserted id

mysql> select last_insert_id();
+------------------+
| last_insert_id() |
+------------------+
| 1 |
+------------------+


See more use full commands later

Thursday, July 12, 2007

MySQL Query Optimization tips

1) Edit /etc/my.cnf change following parameters as nessary

# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

2) Use indexes (Will see more on indexes later.....)

Thursday, July 5, 2007

Get machine details - Linux

1) To get CPU details
cat /proc/cpuinfo

2) To get the RAM - check the Mem Total
top

3) To get partition details (Linux, ntfs etc..)
fdisk -l

Wednesday, June 27, 2007

Disabling the SeLinux security

Have you ever encounter an issue conncting to mysql server through JDBC connection. eg: SocketException Check the /etc/selinux/config file and change the SELINUX=disabled.

sample entries...

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

Monday, June 18, 2007

Usefull Oracle commands

1) Creating table space
ssh -X -Y oracle@host
oemapp dbastudio

then use the GUI to create the table space

2) Create database
ssh -X -Y oracle@host
dbca

then use the GUI to create the database

Note: -X -Y options needed for get the GUI

Sunday, June 17, 2007

Upload results of a SQl to a CSV file

1) Method 1 - in the shell

mysql -B -u -p -e 'SELECT foo FROM bar ' | \

perl -F"\t" -lane 'print join ",", map {s/"/""/g; /^[\d.]+$/ ? $_ : qq("$_")} @F ' >> output.csv

2) Method 2 - in mysql promp
SELECT * from Dealers INTO OUTFILE 'orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

Thursday, May 24, 2007

Usefull Shell commands

Replacing a parameter

x=/home/beyondm/account
src="/"
dis="\/"
result=`echo $x | sed s\}$src\}$dis\}\g`

echo $result will result
/home/beyondm/account

Thursday, May 10, 2007

Exciting Open Source ETL - Pentaho Data Integration: KETTLE

Pentaho Data Integration delivers powerful Extraction, Transformation and Loading (ETL) capabilities using an innovative, metadata-driven approach. The intuitive, drag-and-drop design of Pentaho Data Integration increases productivity and it’s extensible, standards-based architecture ensures that you will never be forced to adopt proprietary methodologies in your ETL solutions.

What is Kellte, spoon, pan and Kitchen?

Kettle is an acronym for “Kettle E.T.T.L. Environment”. This means it has been designed to help you with
your ETTL needs: the Extraction, Transformation, Transportation and Loading of data.

Spoon is a graphical user interface that allows you to design transformations and jobs that can be run with the Kettle tools Pan (transformations) and Kitchen(jobs). Pan is a data transformation engine that is capable of performing a multitude of functions such as reading, manipulating and writing data to and from various data sources. Kitchen is a program that can execute jobs designed by Chef in XML or in a database repository. Usually jobs are scheduled in batch mode to be run automatically at regular intervals.

Pentaho Data Integration 2.5 Now Available!

This exciting new release features ehanced MySQL support, advanced error handling, support for the Apache Virtual File System, and numerous usability improvements.

Project URL : http://www.pentaho.com/index.phpDownload : https://sourceforge.net/project/showfiles.php?group_id=140317&package_id=186321

Friday, May 4, 2007

Important MySQL commands

Restoring MySQL dump

Option 1 - Having a DB Dump with insert into statements
* Go to the corresponding directory and run following commad
* mysql -u user -ppassword -D dst_temp -h 192.168.0.57 -e "source LAP_BONUS_EVENT";


Option2 - Having backup with comma-separated format
* Copy the file to Mysql data directory (eg: /usr/local/mysql/data/dst_temp)
* Go to the Mysql data directory and loggin to the mysql prompt (mysql -uuser -ppassword) and run the following command
* LOAD DATA INFILE 'filename' INTO TABLE VOICE_CALL_EVENT FIELDS TERMINATED BY ',';



Change the MySQL grant privileges
* GRANT ALL PRIVILEGES ON *.* TO user@"%" IDENTIFIED BY 'password' WITH GRANT OPTION;


Get a MySQL dump
* Go to MySQL home (eg: /usr/local/mysql)
* execute ./bin/mysqldump -u user -ppassword dst_report > dst_report_08_04_2007.txt


To get no of mysql connections acquired
* mysql> show processlist; (in mysql prompt)

Did you ever encounter a java.lang.OutOfMemoryError: PermGen

Did you ever encounter a java.lang.OutOfMemoryError: PermGen space error when you redeployed your application to an application server?

What is PermGen space anyways? The memory in the Virtual Machine is divided into a number of regions. One of these regions is PermGen. It's an area of memory that is used to (among other things) load class files. The size of this memory region is fixed, i.e. it does not change when the VM is running.

You can specify the size of this region with a commandline switch: -XX:MaxPermSize . The default is 64 Mb on the Sun VMs.

Check interesting link : http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java