Tuesday, September 13, 2011
Windows firewall blocks access to Apache Tomcat service from remote computer
Tuesday, August 30, 2011
JNI Refreshment
- Delare your native methods in a normal Java class, for example, HelloJNI.java.
- javac the java file(HelloJNI.java).
- javah -jni HelloJNI to generate the .h file(s).
- Write your native code, using the .h file generated in step 3; copy the function prototye from the .h file into your .c file.
- compile by using Visual Studio 2005 command shell(cl command).
- Modify your java class to load the library; recompile it; ready to run it!!!
- http://java.sun.com/docs/books/jni/html/jniTOC.html
- http://patriot.net/~tvalesky/jninative.html
- http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html#comp
- command to compile your c file: c:\test\jnitest>cl /I"C:\Program Files (x86)\Java\jdk1.6.0_24\include" /I"C:\Program Files (x86)\Java\jdk1.6.0_24\include\win32" -LD HelloJNI.c -Felibnative.dll
- JNI in package
Thursday, July 07, 2011
Decoding IBM DB2 error message
SELECT C.TABSCHEMA, C.TABNAME,
C.COLNAME
FROM SYSCAT.TABLES AS T,
SYSCAT.COLUMNS AS C
WHERE T.TBSPACEID = n1
AND T.TABLEID = n2
AND C.COLNO = n3
AND C.TABSCHEMA = T.TABSCHEMA
AND C.TABNAME = T.TABNAME
Wednesday, January 05, 2011
Install Oracle Developer Suite 10g on Windows 7 (64bit)
- extract the setup files (version 101202) downloaded from otn.
- right click the install\setup.exe property, set compatibility to Windows XP SP2
- edit the virtual memory size to custom size from 1024m to 8000m, restart it
- run the install\setup.exe
Saturday, December 04, 2010
Oracle 11g alert log location
Connect to the database with SQL*Plus or another query tool, such as SQL Developer.
Query the
V$DIAG_INFOview as shown in "Viewing ADR Locations with the V$DIAG_INFO View".To view the text-only alert log, without the XML tags, complete these steps:
In the
V$DIAG_INFOquery results, note the path that corresponds to theDiagTraceentry, and change directory to that path.Open file alert_SID.log with a text editor.
To view the XML-formatted alert log, complete these steps:
In the
V$DIAG_INFOquery results, note the path that corresponds to theDiagAlertentry, and change directory to that path.Open the file log.xml with a text editor.
Monday, September 06, 2010
How to use Android Market on Android Emulator 2.2
- Start SDK Setup.exe and create an AVD - android-2.2
- Copy system.img coming with the SDK platform to the newly created AVD.
copy c:\labs\android-sdk-windows\platforms\android-8\images\system.img .
- Start the emulator by using command line:
- Pull build.prop from the emulator for editing:
- Comment out ro.config.nocheckin=yes line from the build.prop file just pulled out from the emulator.
- Push back the updated build.prop file to the emuloator
C:\labs\android-sdk-windows\tools>adb.exe push build.prop /system/build.prop
- Grab the MoDaCo Custom ROM for Nexus
- Push GoogleServicesFramework.apk, Vending.apk to emulotor, and remove SdkSetup.apk
C:\labs\android-sdk-windows\tools>adb.exe push c:\labs\r21-update-nexusone-modacocustomcustomrom-withadditions-chinese-signed\system\app\Vending.apk /
system/app
C:\labs\android-sdk-windows\tools>adb shell rm /system/app/SdkSetup.apk
- Stop the emulator and delete the files: userdata-qemu.img, userdata.img, cache.img
- start the emulator by using command line again, you should get the Android Market in your emulator.
Sunday, April 25, 2010
SAP IDES 4.7
- Client ID: 800
- Login user/pwd: sap*/06071992
- Login user/pwd: ddic/19920706
Saturday, April 10, 2010
How to remote debug Tomcat server code?
- Start tomcat server with remote debug enabled with JVM parameters: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y and make sure you setting suspend=y to let the tomcat server suspend and wait for debugger to attach to it.
- Start your debugger, I am using Intellij Remote Debug, and here is the settings: Host: localhost Port: 8000
Sunday, April 04, 2010
Install lxml on Cygwin
- Make sure install the following package for cygwin by using Cygwin setup libxml2, libxml2-devel, libxslt, libxslt-devel, python-libxml2, python-libxslt
- If you got lots of errors about debug format:
- try to add -gdwarf-2 to CFLAGS
- export CFLAGS="-gdwarf-2"
Using pip, virtualenv, and virtualenvwrapper in Cygwin
- Use Cygwin setup to install Python for Cygwin.
- Install easy_install in your Cygwin: download and run ez_setup.py in Cygwin.
- Install pip by using easy_install: eazy_install pip.
- pip install virtualenv
- pip install virtualenvwrapper
- add the following lines into your ~/.bashrc
- export WORKON_HOME=/cygdrive/c/labs/virtualenvs
source /usr/bin/virtualenvwrapper_bashrc
Monday, March 29, 2010
Using HQL Console for JPA facet in Intellij
- Create a DataSource in Intellij, let's name it datasource_1
- Go to the Project->View:J2EE structure->right click the module your pojos are located in, edit the JPA facet properties to set datasource_1 maps to the desired Persistent Unit, and set the default JPA provider to: Hibernate.
- Project->View:J2EE structure->right click the Persistent Unit, you should be able to start HQL Console.
- You can paste your HQL or JPAQL in the HQL Console and try it out, or you can generate SQL for it and run the SQL in your DB.
Wednesday, December 09, 2009
Unable to access jarfile on Cygwin
- java -jar `cygpath -m /cygdrive/c/pathtojar/.yuicompressor.jar`
- java -jar `cygpath -w /cygdrive/c/pathtojar/.yuicompressor.jar`
pip install python packages makes it easy
- To install something from Python Package Index, for example, Django 1.1, you just issue: pip install django, it will download it and install it.
- To see what Python Packages were installed by pip, you can use command: pip freeze, of course, you can redirect the output to a file and pass around.
- To uninstall a Python Package, for example, Django 1.1 installed in step 1, the command is: pip uninstall django.
- To install some Python Package you may run into error: No distributions at all found for xxxxx, you can supply the package file url to the pip install command, for example, if you want to install Django 0.96.5, here is the command: pip install http://www.djangoproject.com/download/0.96.5/tarball/, this one is pretty cool, if you can find the package gz file, then you can install it by using pip.
Friday, June 05, 2009
Install MySQL-python on Cygwin
- Build MySQL on Cygwin
- Download MySQL source package from here. I was using mysql-5.0.76.tar.gz
- configure && make && make install
- Install MySQL-python on Cygwin
- Download MySQL-python . I was using 1.2.2. Unzip it.
- ./setup.py install, if you run into any problem, please have look on the readme file of the MySQL-python package. You may need to update threadSafe=False in the site.cfg file.
Wednesday, June 03, 2009
PIL error: IOError: decoder jpeg not available
IOError: decoder jpeg not availableTo solve this problem I did the following steps:
Remove the installed PIL from Cygwin:
rm -rf /usr/lib/python2.5/site-packages/PIL
rm /usr/lib/python2.5/site-packages/PIL.pth
Install libjpeg by using Cygwin setup.exe
Rerun PIL setup.py install.
unable to remap C:\cygwin\bin\tk84.dll
5 [main] python 4388 C:\cygwin\bin\python.exe: *** fatal error - unable to remap C:\cygwin\bin\tk84.dll to same address as parent(0x410000) != 0
x700000
22 [main] python 4636 fork: child 4388 - died waiting for dll loading, errno 11
error: Resource temporarily unavailable
Fortunately, with the help of Google, it is easy to find an existing solution from Datahammer's blog:
c:\cygwin\bin\ash
cd /bin
./rebase -b 0x100000000 tk84.dll
Rerun the PIL setup.py install in Cygwin shell.
Update: If you run into remap error on Cygwin, you could try rebaseall
c:\cygwin\bin\ash
cd /bin
./rebaseall
Thursday, April 16, 2009
Unix commands help on diagnosing Weblogic problems
- Apache error_log files BackEnd errors: grep -r -h --include=error_log Backend . | awk '{print $2 " " $3}'| sort | uniq -c
- Oracle connections: while true; do netstat -an|grep 1521; netstat -an|grep 1521|wc -l; echo "+++++++++++++++++++"; sleep 4; done;
Thursday, April 09, 2009
Google App Engine for Java Rocks!!!
* Create Application ID
* Download and install Eclipse plugin
* Create new Web application
* Deploy application to GAE
Done!!!
It is just so easy.
More will come on this topic.
Friday, March 13, 2009
How to remote debug JMeter?
- Download JMeter binary package and source package, unzip them into the same directory.
- Rename the eclipse.classpath file to .classpath and open the project with IDEA.
- Open a shell, set JVM_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
- Start JMeter in the previous shell.
- Setup remote debug in IDEA and start debug.
Setup JMeter JMS Publisher Sampler
We choose ActiveMQ as our JMS provider.
- Copy activemq-core-5.2.0.jar, jms-1.1.jar, and geronimo-j2ee-management_1.0_spec-1.0.jar into JMeter's lib directory.
- Create a jndi.properties file and jar it into a jar file, put the jar file into JMeter's lib directory.
- Confiture the JMS publisher sampler with the following settings in the JMeter GUI.
- Check use jndi.properties
- Connection Factory: ConnectionFactory
- Topic: MyTopic
- Number of messages to aggregate: 1
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
java.naming.provider.url=tcp://hostname:61616
topic.MyTopic=topic
There are a few catches during the setting up process:
* The ActiveMQInitialContextFactory package name must have the apache.
* ConnectionFactory can not contain any trailing space.
* The Topic JNDI name must be prefixed with topic in the jndi file.
* You must put in the Number Of messages to aggregate, otherwise there will be no messages published.
Full Guide for using Bitnami Prometheus Operator Helm Chart with Additional Scrape Configuration
"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of...
-
After some digging, finally I got android market working on Android emulator 2.2 running on Windows Vista. Here is the steps,: Start SDK Set...
-
Thingsboard is a fantastic open source IoT data gathering and visualization platform. I was trying to setup the local development mode for ...
-
"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of...