Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Corné Aussems CorneAussems

🎯
Focusing
Block or report user

Report or block CorneAussems

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CorneAussems
CorneAussems / getAllLayouts.groovy
Created Feb 16, 2019
Groovy Liferay 7 get all Layouts
View getAllLayouts.groovy
import com.liferay.portal.kernel.service.*;
try{
companyId = 5015832
def start = -1
def end = -1
def privateLayout = false;
groups = GroupLocalServiceUtil.getGroups(start,end);
println('groups found='+groups.size()+ groups[0])
@CorneAussems
CorneAussems / DLVerifyFiles.groovy
Last active Nov 1, 2018
Verify Liferay Document Library files exist on disk
View DLVerifyFiles.groovy
import com.liferay.document.library.kernel.store.*;
import com.liferay.portal.kernel.util.*;
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.dao.orm.*;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.document.library.kernel.util.*;
import com.liferay.document.library.kernel.lar.*;
import com.liferay.document.library.kernel.service.*;
import com.liferay.document.library.kernel.model.*;
import com.liferay.document.library.kernel.service.*;
@CorneAussems
CorneAussems / tunneling.servlet.shared.secret.groovy
Last active Jul 19, 2018
Create Liferay Tunnel tunneling.servlet.shared.secret Hex
View tunneling.servlet.shared.secret.groovy
/**
https://dev.liferay.com/en/discover/portal/-/knowledge_base/7-0/enabling-remote-live-staging
tunneling.servlet.shared.secret=6162636465666768696a6b6c6d6e6f70
tunneling.servlet.shared.secret.hex=true
**/
import com.liferay.portal.kernel.security.pwd.*
import com.liferay.portal.util.*
try {
@CorneAussems
CorneAussems / TUnnel
Created Jul 19, 2018
Get Liferay Tunnel
View TUnnel
import com.liferay.portal.kernel.security.pwd.*
try{
String algorithm = PasswordEncryptorUtil.getDefaultPasswordAlgorithmType();
out.println("Algorithm"+algorithm);
String pwdEnc = PasswordEncryptorUtil.encrypt("TEXTTEXTTEXT");
out.println("Password encrypted:"+pwdEnc);
String hexPwd = org.apache.commons.codec.binary.Hex.encodeHexString(pwdEnc.getBytes());
@CorneAussems
CorneAussems / TUnnel
Created Jul 19, 2018
Get Liferay Tunnel
View TUnnel
import com.liferay.portal.kernel.security.pwd.*
try{
String algorithm = PasswordEncryptorUtil.getDefaultPasswordAlgorithmType();
out.println("Algorithm"+algorithm);
String pwdEnc = PasswordEncryptorUtil.encrypt("TEXTTEXTTEXT");
out.println("Password encrypted:"+pwdEnc);
String hexPwd = org.apache.commons.codec.binary.Hex.encodeHexString(pwdEnc.getBytes());
@CorneAussems
CorneAussems / skype-query.sql
Last active Jun 27, 2018
Skype SqlLite Database Queries
View skype-query.sql
cd /Users/corne/Library/Application\ Support/Skype/corne.aussems/
cp main.db main-bak.db
sqlite3 main-bak.db
/** pretty print **/
sqlite3 -separator $'\t' -header -cmd '.mode columns' main-bak.db ;
/** You want to know what you wrote in each Conversation last 2 days **/
SELECT displayname,from_dispname, datetime(Messages.timestamp, 'unixepoch') AS date, body_xml
FROM Messages LEFT JOIN Conversations on Messages.chatname = Conversations.identity
WHERE Messages.timestamp BETWEEN strftime('%s','now', '-2 days') AND strftime('%s','now')
@CorneAussems
CorneAussems / Liferay Groovy output file
Last active May 15, 2018
Liferay Groovy output Web Content Folder Tree
View Liferay Groovy output file
#############
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.dao.orm.*;
final def SCRIPT_ID = "MYSCRIPT"
outputFile = new File("""${System.getProperty("liferay.home")}/logs/out-${SCRIPT_ID}.txt""")
out.println(outputFile.text)
@CorneAussems
CorneAussems / JournalFolderTree.groovy
Created Mar 21, 2018
Liferay DXP JournalFolderTree with file download groovy
View JournalFolderTree.groovy
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portlet.journal.service.*;
import com.liferay.journal.service.impl.*;
import com.liferay.journal.service.*;
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.dao.orm.*;
final def SCRIPT_ID = "MYSCRIPT1"
outputFile = new File("""${System.getProperty("liferay.home")}/scripting/out-${SCRIPT_ID}.txt""")
@CorneAussems
CorneAussems / .groovy
Created Nov 22, 2017
Groovy Document and Media File: remove Guest and set SiteMember permission on all documents
View .groovy
import java.util.ArrayList
import java.util.Iterator
import java.util.List
import java.util.ListIterator
import com.liferay.portal.service.ResourcePermissionLocalServiceUtil
import com.liferay.portal.service.RoleLocalServiceUtil
import com.liferay.portal.model.ResourceConstants
import com.liferay.portal.model.ResourcePermission
import com.liferay.portal.model.Role
View Liferay Groovy update Agreed To Terms Of Use
//import com.liferay.portal.service.ServiceContext;
//import com.liferay.portal.util.*;
//import com.liferay.portal.service.*;
//import com.liferay.portal.service.impl.*;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.*;
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.service.impl.*;
You can’t perform that action at this time.