Skip to content

Instantly share code, notes, and snippets.

View laszlocsontos's full-sized avatar
🏠
Working from home

László Csontos laszlocsontos

🏠
Working from home
View GitHub Profile
CREATE TABLESPACE &1
DATAFILE '&2/&1..dbf' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE 4096M;
@laszlocsontos
laszlocsontos / gist:5468103
Created April 26, 2013 15:26
Create a Weblogic domain
java -Xms1024m -Xmx2048m -XX:MaxPermSize=512m \
-Dweblogic.management.allowClearTextPasswords=true \
-Dweblogic.management.GenerateDefaultConfig=true \
-Dweblogic.management.username=weblogic \
-Dweblogic.management.password=weblogic1 \
weblogic.Server
@laszlocsontos
laszlocsontos / gist:5468140
Created April 26, 2013 15:30
Create a WebSphere profile
PROFILE=newProfile
# Create new profile
manageprofiles.sh -create \
-profileName $PROFILE \
-profilePath /opt/ibm/was/v7/profiles/$PROFILE \
-templatePath /opt/ibm/was/v7/profileTemplates/default \
-enableAdminSecurity false \
-startingPort 31764 \
-isDefault false \
SET DEFINE ON
CREATE USER &1 IDENTIFIED BY password
DEFAULT TABLESPACE &2
TEMPORARY TABLESPACE &3;
GRANT LPORTAL TO &1;
GRANT READ, WRITE ON DIRECTORY data_pump_dir TO &1;
ALTER USER &1 QUOTA UNLIMITED ON &2;
diff --git a/portal-impl/src/com/liferay/portal/service/impl/RoleLocalServiceImpl.java b/portal-impl/src/com/liferay/portal/service/impl/RoleLocalServiceImpl.java
index 65167cc..e6c8cf1 100644
--- a/portal-impl/src/com/liferay/portal/service/impl/RoleLocalServiceImpl.java
+++ b/portal-impl/src/com/liferay/portal/service/impl/RoleLocalServiceImpl.java
@@ -828,7 +828,7 @@ public class RoleLocalServiceImpl extends RoleLocalServiceBaseImpl {
public Collection<Role> getTeamRoles(long groupId, long[] skipRoleIds)
throws PortalException, SystemException {
- Map<Team, Role> roles = getTeamRoleMap(groupId, null);
+ Map<Team, Role> roles = getTeamRoleMap(groupId, skipRoleIds);
@laszlocsontos
laszlocsontos / StringTest.java
Created May 12, 2014 11:00
Demonstrates heap allocation problem caused by reusing the internal char[] arrays (value) when String.substring() is called
import com.sun.management.HotSpotDiagnosticMXBean;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
/**
* Demonstrates heap allocation problem with String.substring()
* http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-May/010257.html
*
@laszlocsontos
laszlocsontos / SchedulerPortlet.java
Created July 3, 2014 08:41
Sample Scheduler Portlet
package com.liferay.support.scheduler;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.DestinationNames;
import com.liferay.portal.kernel.messaging.Message;
import com.liferay.portal.kernel.portlet.LiferayPortletConfig;
import com.liferay.portal.kernel.scheduler.CronTrigger;
import com.liferay.portal.kernel.scheduler.SchedulerEngine;
import com.liferay.portal.kernel.scheduler.SchedulerEngineUtil;
@laszlocsontos
laszlocsontos / take_dumps.sh
Created November 25, 2014 12:55
Gather JVM CPU usage metrics per thread
#!/bin/sh
count=30
delay=1
pid=`jps -v | grep liferay | awk '{ print $1 }'`
if [ -n "${1}" ]; then
pid=$1
fi
@laszlocsontos
laszlocsontos / thread_dump_extample
Created June 22, 2015 10:25
Thread Dump Example
2015-06-22 12:24:48
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.72-b04 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007f90f8001800 nid=0x35ce waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"http-bio-9080-exec-1" daemon prio=10 tid=0x00007f9124065800 nid=0x3559 runnable [0x00007f901a611000]
@laszlocsontos
laszlocsontos / stack_trace.txt
Last active August 29, 2015 14:23
Stack Trace Interpretation Example
"http-bio-9080-exec-1" daemon prio=10 tid=0x00007f9124065800 nid=0x3559 runnable [0x00007f901a611000]
java.lang.Thread.State: RUNNABLE
--------------------------------------------------------------------------------------------------------------------
--------------------------------------- [[ WHAT DOES THE SUB-COMPONENT DO?]] ---------------------------------------
--------------------------------------------------------------------------------------------------------------------
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:145)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:114)