This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | To download souce, | |
| mvn dependency:sources | |
| To start spring boot app: | |
| mvn spring-boot:run | |
| To run single test: | |
| mvn -Dtest=TestCircle test | |
| To remote debug maven test case, run with below option, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | To troubleshoot memory leak related issues in java based application, we are in need of analyzing the JVM heap dump to understand potential objects that are causing the problem. | |
| To take the heap dump below command helps, | |
| jmap -dump:format=b,file=jvm_heap_dump.hprof {PID} | |
| This will create file with name - jvm_heap_dump.hprof | |
| Then, we can use eclipse Memory Analyzer(MAT) to analyze the dump. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | NET START postgresql-x64-9.3 (64-bit windows) | |
| NET STOP postgresql-x64-9.3 (64-bit windows) | |
| NET START postgresql-9.3 (32-bit windows) | |
| NET STOP postgresql-9.3 (32-bit windows) | |
| Note: This is for Windows 7. Replace 9.3 with your version of PostgreSQL version. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | some times, you are in need of doing DML operation that involves strings with & sign in it. | |
| Oracle sql clients treats this as a substitution variables and prompts you to enter value. | |
| For example when you run below select statement; it prompts you to enter value for "T". | |
| select 'A&T' from dual; | |
| To disable this you can disable substitution variables for your session using "SET DEFINE OFF" | |
| Note: & is the default value for DEFINE. | |
| SET DEFINE OFF | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Find files that are older than 1 day with file name 'LOGFILE', and delete them. | |
| find /var/log/ -type f -mtime +1 -name '*LOGFILE*' -exec rm {} \; | |
| We can put this delete command in a script say deleteOldLogs.sh and add it in cron entry to run every day, | |
| crontab -l | |
| 0 0 * * * /usr/sathish/Scripts/deleteOldLogs.sh | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | How to check high response HTTP calls from JBoss access log file | |
| Response time is last field in the access log, and below command will show calls that took more than 5 seconds. | |
| cat access.log | awk -F " " '{ if ($NF > '5') {print $0}}' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Here is the command to find out the process # that is listening at the givne port(say 8080) in on Mac OS X, | |
| lsof -n -i4TCP:8080 | grep LISTEN | |
| this will return below sample o/p, | |
| java 41038 user1 54u IPv6 0x68e4c014dcuy8y0 0t0 TCP *:http-alt (LISTEN) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | MySQL Table names in Linux is case sensitive. | |
| To disable it, set property lower_case_table_names=1 in /etc/my.cnf file under "[mysqld]" section, as shown below, | |
| ================== | |
| [mysqld] | |
| datadir=/var/lib/mysql | |
| socket=/var/lib/mysql/mysql.sock | |
| user=mysql | |
| # Disabling symbolic-links is recommended to prevent assorted security risks | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Enterprise Spring Best Practices | |
| http://gordondickens.com/wordpress/2012/07/03/enterprise-spring-best-practices-part-1-project-config/ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | To print the html page content in the console, instead of creating in file, use | |
| wget -qO- www.google.com |