Posts Under 'Tutorials'

pop3: refused connect from ipadress

I have already posted sshd problem. This problem is also related to this only. I googled lot about this problem but no solution. So i tried adding pop3: ipaddress: ALLOW in hosts.allow. Bingo it worked.

Read more »


sshd: refused connect from ::ffff

Hello friends, I faced this problem before 2 days. I did some research and found on google that, to solve this problem you have to see hosts.deny and hosts.allow files under /etc/ directory. So you have to add your ISP or Local ip address in hosts.allow files as sshd sshd1 sshd2 : ipaddress : ALLOW […]

Read more »


Replace Single Quote in Java using str.replaceAll()

Replace Single Quote in Java using str.replaceAll() To replace single quote in java you have to escape four times the single quote in replaceall string method. String input = "Replace Single Quote's in Java"; String output = input.replaceAll(" ' ", "\\\\' "); System.out.println(output);

Read more »


PHP Script to Optimize All Tables In A MySQL Database

In MYSQL OPTIMIZE TABLE should be used if you have deleted a large part of a table or if you have made many changes to a table with variable-length rows. Deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions. You can use OPTIMIZE TABLE to reclaim the unused […]

Read more »


How to calculate the difference between two dates in java

long diffInMilleseconds = end.getTime() – start.getTime(); // end and start are timestamps long noofdays=diffInMilleseconds/86400000; long diffInSeconds = diffInMilleseconds/1000; long diffInMinutes = diffInSeconds/60; long diffInHours = diffInMinutes/60; long diffInDays = diffInHours/24;

Read more »