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 | |
DIR=`pwd` | |
cd /tmp | |
CRASH="/tmp/crash-1.3.1/crash/bin/crash.sh" | |
if [ ! -f "$CRASH" ]; then | |
curl https://repo1.maven.org/maven2/org/crashub/crash.distrib/1.3.1/crash.distrib-1.3.1.tar.gz > crash.distrib-1.3.1.tar.gz |
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 javax.portlet.PortletPreferences; | |
import com.liferay.portal.kernel.util.PortalUtil; | |
import com.liferay.portal.kernel.util.PortletKeys; | |
import com.liferay.portal.kernel.service.PortalPreferencesLocalServiceUtil; | |
companyId = PortalUtil.getDefaultCompanyId() | |
PortletPreferences portalPreferences = PortalPreferencesLocalServiceUtil.getPreferences(PortletKeys.PREFS_OWNER_ID_DEFAULT, PortletKeys.PREFS_OWNER_TYPE_COMPANY); |
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 com.liferay.portal.util.PropsValues; | |
import com.liferay.document.library.kernel.antivirus.AntivirusScannerUtil | |
import com.liferay.document.library.kernel.antivirus.AntivirusScannerWrapper; | |
println "[config] Antivirus implementation: " + PropsValues.DL_STORE_ANTIVIRUS_IMPL | |
println "[config] Antivirus enabled: " + PropsValues.DL_STORE_ANTIVIRUS_ENABLED | |
println "[util] Antivirus scanner: " + AntivirusScannerUtil.getAntivirusScanner().getClass().getName() | |
println "[util] Antivirus enabled: " + AntivirusScannerUtil.isActive() |
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 com.liferay.portal.kernel.backgroundtask.BackgroundTask; | |
import com.liferay.portal.kernel.backgroundtask.BackgroundTaskConstants; | |
import com.liferay.portal.kernel.backgroundtask.BackgroundTaskManagerUtil; | |
import com.liferay.portal.kernel.backgroundtask.BackgroundTaskStatusRegistryUtil; | |
import com.liferay.portal.kernel.model.CompanyConstants; | |
def printTask(task) { | |
def status = BackgroundTaskStatusRegistryUtil.getBackgroundTaskStatus(task.backgroundTaskId); |
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 | |
DIR=`pwd` | |
URL=`grep -h jdbc.default.url /opt/liferay/*.properties | sed s#.*jdbc.default.url=##` | |
USER=`grep -h jdbc.default.username /opt/liferay/*.properties | sed s#.*jdbc.default.username=##` | |
PASS=`grep -h jdbc.default.password /opt/liferay/*.properties | sed s#.*jdbc.default.password=##` | |
SQLLINE="sqlline.jar" | |
DB_DRIVER="mysql-connector-java.jar" |
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 com.liferay.portal.kernel.dao.jdbc.DataAccess; | |
import com.liferay.portal.util.PropsValues; | |
import java.nio.file.Files; | |
import java.nio.charset.Charset | |
import java.nio.file.StandardOpenOption | |
/* | |
Calculating the size of very large folder trees can take very long time | |
In such case the web server may timeout with 504 error | |
To work around that, the data can be stored in a tmp file |
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.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import com.liferay.portal.kernel.dao.jdbc.DataAccess; | |
Connection con = null; | |
Statement st = null; |
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
public interface HelloService { | |
String hello (); | |
} |