Skip to content

Instantly share code, notes, and snippets.

@bulain
bulain / assembly_plugin.xml
Created October 14, 2011 01:22
using assembly package in maven
<!-- pom.xml -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assemble/assemble.xml</descriptor>
</descriptors>
</configuration>
@bulain
bulain / jar_pom.xml
Created October 14, 2011 01:28
excludes some file when package using maven
<!-- pom.xml -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>*.properties</exclude>
</excludes>
</configuration>
</plugin>
@bulain
bulain / mysql_master_slave_driver.txt
Created January 14, 2012 13:01
mysql master-slave ReplicationDriver and Driver
jdbc:mysql:replication://localhost:3306/test
jdbc:mysql://localhost:3306/test
@bulain
bulain / ora_impdp_expdp.bat
Created February 27, 2012 06:15
using expdp and impdp in oracle 10g 11g
# create directory
create directory dmpdir as 'c:/temp';
select directory_name,directory_path from dba_directories;
# expdp owner
create user scott identified by tiger;
grant connect, resource to scott;
...
grant read, write on directory dmpdir to scott;
expdp scott/tiger@xe directory=dmpdir dumpfile=scott.dmp logfile=expdp.log
@bulain
bulain / fmt_date_win.bat
Created February 27, 2012 06:19
format date in windows
set stamp=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%
echo %stamp%
@bulain
bulain / sqlplus_sql.bat
Created February 27, 2012 06:22
sqlplus to run sql autmatically
# run_sql.bat
sqlplus system/system@xe @test.sql
# test.sql
set echo on;
spool test.log
...your sql
spool off;
@bulain
bulain / jmx.sh
Created March 14, 2012 03:26
start java application with jmx
#windows
-Dcom.sun.management.jmxremote.port=7101
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
#linux
-Djava.rmi.server.hostname=192.168.0.190
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=7101
-Dcom.sun.management.jmxremote.authenticate=false
@bulain
bulain / jboss_port_binding.sh
Created March 21, 2012 05:03
jboss port binding
run.sh -Djboss.service.binding.set=ports-01
@bulain
bulain / yourkit_server.sh
Created March 21, 2012 09:23
YourKit agant registion
#for java
-agentpath:/temp/yjpagent.dll
#for jboss
-agentpath:/temp/yjpagent.dll=delay=10000
@bulain
bulain / java_lang.sh
Created March 21, 2012 10:37
change java program language
#change java program language
-J-Duser.language=en -J-Duser.region=CN
or
-J-Duser.language=en -J-Duser.country=CN