This file contains 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
import java.sql.Connection; | |
import java.sql.DatabaseMetaData; | |
import java.sql.ResultSet; | |
import java.sql.Statement; | |
import com.zaxxer.hikari.HikariConfig; | |
import com.zaxxer.hikari.HikariDataSource; | |
public class LiferayShardingMigrationTool { |
This file contains 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
Found one Java-level deadlock: | |
============================= | |
"MSC service thread 1-16": | |
waiting to lock monitor 0x00007fb71c003ef8 (object 0x0000000601fb0f48, a org.jboss.modules.ModuleClassLoader), | |
which is held by "MSC service thread 1-1" | |
"MSC service thread 1-1": | |
waiting to lock monitor 0x00007fb71c003e50 (object 0x000000060016ce60, a com.newrelic.agent.instrumentation.weaver.Verifier), | |
which is held by "MSC service thread 1-11" | |
"MSC service thread 1-11": | |
waiting to lock monitor 0x00007fb71c003ef8 (object 0x0000000601fb0f48, a org.jboss.modules.ModuleClassLoader) |
This file contains 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
<% | |
int listTypeId = ParamUtil.getInteger(request, name, BeanParamUtil.getInteger(bean, request, listTypeFieldName)); | |
List<ListType> listTypeModels = ListTypeServiceUtil.getListTypes(listType); | |
for (ListType listTypeModel : listTypeModels) { | |
%> | |
<aui:option selected="<%= listTypeId == listTypeModel.getListTypeId() %>" value="<%= listTypeModel.getListTypeId() %>"><liferay-ui:message key="<%= listTypeModel.getName() %>" /></aui:option> |
This file contains 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
import java.sql.Connection; | |
import com.mchange.v2.c3p0.ComboPooledDataSource; | |
public class MainC3P0 { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) throws Exception { |
This file contains 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
#at the branch you want to rebase into "master > mybranch" | |
git rebase -s recursive -X theirs master | |
#then a binary conflict will happen so now you must checkout the version of the binary you want | |
git co --theirs -- my-binary-file.bin | |
git co --ours -- my-binary-file.bin | |
#now you must stage the file | |
git add my-binary-file.bin |
This file contains 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
function gitrollback() { git diff -p -R "$1"^ "$1" > "$1".rollback ;} |
This file contains 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
#!/bin/sh | |
VOLUME=$1 | |
if [ -z $VOLUME ]; then | |
echo "You must specify the volume, like /dev/sdf" | |
exit 1; | |
fi | |
if [ ! -b $VOLUME ]; then |
This file contains 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
if [ -d $1 ] && [ -n "$1" ]; then | |
service tomcat stop | |
sleep 20 | |
tar -czvf /opt/liferay-portal-tomcat-6.0-ee-sp1/tomcat-6.0.32/logs/tomcat_logs.tgz /opt/liferay-portal-tomcat-6.0-ee-sp1/tomcat-6.0.32/logs/* | |
cp /opt/liferay-portal-tomcat-6.0-ee-sp1/tomcat-6.0.32/logs/tomcat_logs.tgz $1 | |
rm -rf /opt/liferay-portal-tomcat-6.0-ee-sp1/tomcat-6.0.32/logs/* | |
mv /opt/liferay-portal-tomcat-6.0-ee-sp1/dump* $1 | |
service tomcat start | |
/opt/liferay-portal-tomcat-6.0-ee-sp1/get-java-thread-memory-dump.sh Bootstrap | |
else |
This file contains 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
#!/bin/bash | |
if [ -n "$1" ]; then | |
for (( ; ; )) | |
do | |
echo "infinite loops [ hit CTRL+C to stop]" | |
pid=`jps | grep $1 | awk '{print $1}'` | |
echo "Getting dump from process $pid" | |
jstat -gcutil $pid 250 3 >> dump-memory-$pid.txt | |
jstack -l $pid >> dump-thread-$pid.trc |
This file contains 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
mysqladmin -u root -p password 'root' |