Kurinchi Blogger Scribbles …


Mar 17
2013

When we began creating an application using Struts2 framework with Hibernate and MySQL, we ran into a problem which was related to MySQL timing out its connection after a span of 8 hours when left unused. It conceived a lot of time at our end but we were able to nail down the issue at the end.

Steps that we had taken to correct the issue related to Hibernate MySql connection timeout problem are listed below

- Download Hibernate C3P0 and copy .jar files
- Set c3p0.properties
- Make changes to hibernate.cfg.xml
- Test MySQL connection timeout
- Hibernate, MySQL connection timeout related error messages

Read more »


Feb 27
2013

PEAR setup in WAMP in simple steps

Last updated: February 27th, 2013

* After WAMP is installed go to the folder where the web server related PHP bin directory is present. Search for the batch file pear.bat in it. Double click the file to start the PEAR installation. Go with the defaults and complete the installation

* Search for PEAR_ENV.reg. Double click that file to register the PEAR settings as environment variable

* Go to the command prompt and type “pear list” to see what packages are installed and if PEAR is correctly installed. If PEAR cannot be accessed via the command line, it means the PATH setting is not set correctly. Environment PATH variable should include the path to where pear.bat is present


Feb 01
2013

PEAR should be already installed in the system before configuring the phpseclib channel.

PHPSecLib installation is very simple.

PHPSecLib is a library of optional PHP extensions which comes in handy if the application were to be packaged as a solution for deployment to the end user.

Step 1: Register the channel

c:\> pear channel-discover phpseclib.sourceforge.net

Read more »


Jan 10
2013

Files created in windows when moved to linux will have ^M character at the end of lines when you open the files in Vi editor.

To remove the strange characters open the file in Vi editor and type

:%s/.$// 


Read more »


Dec 06
2012

How to determine the file system type in Linux?

Last updated: February 6th, 2013

Linux supports many file system types like Ext2, Ext3, Ext4, NFS, FAT16, FAT32, NTFS etc. To find out what type of file systems are mounted in your system, issue the command

$ df -T

Output from the command

Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda1     ext4    94088076   9090252  80218356  11% /
udev      devtmpfs     1023536         4   1023532   1% /dev

Nov 24
2012

How to find the port used by mysql?

Last updated: November 24th, 2012

List the listening ports and check if mysql is listed on it.

$ netstat -tln | grep mysql

If you cannot find the port number for mysql view my.cnf file to see if you can find the port number. If you see a line “skip-networking” try commenting out the line and then restart mysql daemon.

$ vi /etc/my.cnf

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

$ service mysqld restart


Nov 15
2012

How to setup Apache Tomcat, Java on CentOS?

Last updated: November 13th, 2012

Below set of steps involve setting up Tomcat 6 on CentOS 5 with Java 1.6

Download Apache Tomcat

$ wget http://apache.parentingamerica.com/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz

Go to opt/ folder and extract Tomcat

$ cd /opt

$ tar -xzf apache-tomcat-6.0.36.tar.gz

Create a tomcat user

$ useradd -d /opt/apache-tomcat-6.0.36/ tomcatuser

Change user permission on tomcat folder

$ chown -R tomcatuser:tomcatuser apache-tomcat-6.0.36

Read more »


Nov 14
2012

At the time of writing this article Java 6 (update 37) was available at http://www.java.com/en/download/manual_v6.jsp

First set up a folder where you want to install java

$ cd /opt

$ wget http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-x64-rpm.bin

$ chmod +x jdk-6u37-linux-x64-rpm.bin

$ ./jdk-6u37-linux-x64-rpm.bin

Read more »


Nov 13
2012

How to check, remove JRE, JDK, OPENJDK installation?

Last updated: November 12th, 2012

To check the current installation of java

$ rpm -qa | grep jre

$ rpm -qa | grep jdk

$ rpm -qa | grep openjdk

To remove the java installs

$ yum erase jre jdk openjdk


Nov 12
2012

How to install and setup Fail2ban on CentOS?

Last updated: November 12th, 2012

Fail2ban is a software used to ban IP’s which shows strange behavior. It can be configured to reject IP’s for a certain amount of time.

To install Fail2ban we need to download the application from the source. Login as the root user and go to /opt

$ cd /opt

$ wget http://downloads.sourceforge.net/project/fail2ban/fail2ban-stable/fail2ban-0.8.4/fail2ban-0.8.4.tar.bz2?use_mirror=transact

Next unzip the downloaded file

$ tar -xf fail2ban-0.8.4.tar.bz2

$ cd fail2ban-0.8.4

Read more »



Valid HTML 4.01 Strict  Valid HTML 4.01 Strict