Skip to content

Instantly share code, notes, and snippets.


Josef Šustáček sustacek

  • Liferay, Inc.
  • South Moravia, Czech Republic
View GitHub Profile
sustacek /
Last active Feb 10, 2021
OSGi - list all instances of a factory config
import aQute.bnd.annotation.metatype.Meta;
import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
import com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
sustacek / build.gradle
Created Dec 2, 2020
Verify bundle checksum in Liferay Workspace
View build.gradle
// Make sure we can use the classes from the Download plugin, like the Verify below
buildscript {
repositories { jcenter() }
dependencies { classpath group: "de.undercouch", name: "gradle-download-task", version: "4.0.4" }
apply plugin:
'SHA-256': 'liferay.workspace.bundle.checksum[sha-256]',
'MD5': 'liferay.workspace.bundle.checksum[md5]',
sustacek / build.gradle
Last active Nov 4, 2020
Liferay Workspace - Tomcat version check between configs and used bundle
View build.gradle
// [root]/build.gradle
// A sanity check in case the Tomcat version inside the bundle changes and we miss it
(initBundle): gradle.liferayWorkspace.homeDir,
(distBundle): file("${buildDir}/dist")
].each {Task task, File destDir ->
task.configure {
doLast {
println "Checking Tomcat files in " + destDir
sustacek / gist:b0af0ae1969668042b112542cc8f4eb1
Created Mar 4, 2019
Enhanced log4j monitoring for DXP 7.1 - tomcat/webapps/ROOT/WEB-INF/classes/META-INF/portal-log4j-ext.xml
View gist:b0af0ae1969668042b112542cc8f4eb1
<?xml version="1.0"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="">
<appender class="org.apache.log4j.rolling.RollingFileAppender" name="TEXT_FILE">
<!-- Inspired by: -->
=== What happens when current log file needs to be rotated? ===
sustacek / Cloud Formation boolean Parameter
Last active Oct 27, 2020
The snippet of a Cloud Formation template, which supports input of boolean parameter and using it for a resource with Boolean property.
View Cloud Formation boolean Parameter
"Parameters": {
"DbRdsMultiAZ": {
"Type": "String",
"Description": "Specifies if the RDS instance is deployed in multiple Availability Zones.",
"AllowedValues": [