iyerland-blog
iyerland-blog
@iyerland
8 posts
Don't wanna be here? Send us removal request.
iyerland-blog · 12 years ago
Text
MySQL : How to see the queries executed (log)
login to mysql
SET GLOBAL general_log = 'ON'
show variables like "%GENERAL%";
+----------------------+------------------------------------------+
| Variable_name    | Value                                            |
+----------------------+--------------- --------------------------+
| general_log          | ON                                                |
| general_log_file    | /usr/local/var/mysql/macbox.log  |
+-----------------------+------------------------------------------+
0 notes
iyerland-blog · 12 years ago
Text
Mac OS X Mountain Lion JAVA_HOME
export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
0 notes
iyerland-blog · 12 years ago
Text
Debugging with SBT & Intellij/Eclipse
1. Set your breakpoints.
2. Within your IDE create a new REMOTE configuration.
3. Start this configuration in DEBUG mode.
4. Clone your sbt script, call it sbtd (sbt debug) and create symlinks.
5. Modify sbtd, put this before ${SBT_OPTS}:
-Xdebug -Xrunjdwp:transport=dt_socket,
server=y,suspend=n,address=127.0.0.1:5005 
6. Go to your scala project and run (This should attach sbt to 5005 port): 
sbtd 
7. Once inside sbt prompt, start your server:
run 
8. Now send requests to your scala server through postman client or web
    app client.
9. You should now hit your breakpoints! Enjoy!
1 note · View note
iyerland-blog · 12 years ago
Text
grails run-app : error
If you get the following error when doing: grails run-app 
Configuring Tomcat Plugin for virtual directory...
2013-04-18 08:34:59,242 [main] ERROR org.codehaus.groovy.grails.web.context.GrailsContextLoader  - Error executing bootstraps: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; 
Solution:
grails upgrade
0 notes
iyerland-blog · 12 years ago
Text
Copy MySQL tables from one host to other
On host A, do:
$ mysqldump -u 'username' -p 'password' 'table-name' > 'output-file'
Secure copy (or use FileZilla) to copy 'output-file' to host B
$ mysql -u 'username' -p 'password' 'table-name' < 'output-file'
0 notes
iyerland-blog · 12 years ago
Text
Modify Xms Xmx in Tomcat 7
Create a file setenv.sh in the same directory as catalina.sh and add the following:
$ JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC"
or whatever value you want!
0 notes
iyerland-blog · 12 years ago
Text
Kill a process by name
Unix/Linux script to automatically kill a process by name:
$ kill -9 `ps -eaf | grep | awk ‘{print $2}’` Example: Kill tomcat process: $ kill -9 `ps -eaf | grep tomcat | awk ‘{print $2}’`
Please note: In order for this to work on Linux, you may have to change to: “print $1″, basically the position of the process id, when you do a ps -eaf or ps -aux!
0 notes
iyerland-blog · 12 years ago
Text
Refresh a command at some interval
Unix/Linux script to refresh a command at some interval:
$ while :; do clear; sleep ; done Example: Watch how many sockets are used up: $ while :; do clear; netstat -np tcp | grep 8080 | wc -l; sleep 3; done
0 notes