Skip to content

Instantly share code, notes, and snippets.

View jverweijL's full-sized avatar
💭
🏴‍☠️

Jan Verweij jverweijL

💭
🏴‍☠️
View GitHub Profile

I needed the logo of an organization within a fragment and perhaps you can embed it somewhere in the fragments library

<div class="fragment_1301">
	[#assign org = user.getOrganizations() /]
	[#if org?has_content ]
		[#assign logoid = org[0].getLogoId() /]
		<img src="/image/layout_set_logo?img_id=${logoid}"/>
	[/#if]
</div>
#!/bin/bash
curl -XDELETE "http://localhost:9200/tmdb";
curl -XPUT "http://localhost:9200/tmdb/" -H 'Content-Type: application/json' --data-binary @schema.json;
curl -XPOST "http://localhost:9200/tmdb/_bulk" -H 'Content-Type: application/json' --data-binary @tmdb_es.json;
@jverweijL
jverweijL / remove sensitive info from GIT.md
Created May 28, 2021 07:15
Remove sensitive info from remote git repo.

Copy the file you want to remove in case you just need to remove just something like APIKEY or PASSWORD entry.

git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch INSERT_PATH_TO_FILE_HERE" \
--prune-empty --tag-name-filter cat -- --all

Next push changes.

git push origin --force --all

Setting up Liferay 7.3 with Okta

30 January 2021

Bypass SSO

In case you make a mistake or need to login without Saml you can append the following:

http://localhost:8080?p_p_id=com_liferay_login_web_portlet_LoginPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=false&_com_liferay_login_web_portlet_LoginPortlet_mvcRenderCommandName=%2Flogin%2Flogin 

npx create-react-app my-app
cd my-app
npm run start
^C
npm install -g generator-liferay-js
yo liferay-js:adapt
npm run build:liferay

@jverweijL
jverweijL / README.md
Last active March 11, 2022 10:00
Adding WiFi Drivers to Ubuntu/Linux for Dell’s XPS-15 9500 with AX500

Based upon https://mukaiguy.medium.com/adding-wifi-drivers-to-ubuntu-linux-for-dells-xps-15-9500-with-ax500-f535fb42db70

Step 1 — Pre-Requisites The line of code below will update, then upgrade all of the packages and their dependencies as necessary. Then it will install git if it’s not already installed, as well as the other tools needed to build the kernels. *Note I use the -y flag to indicate that I am okay with the installs. feel free to change that if you want to be asked.

sudo apt update && sudo apt -y full-upgrade && sudo apt install -y git && sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev dwarves

I had to install a dwarf 1.17

@jverweijL
jverweijL / install blade.md
Created December 24, 2020 10:28
Install Liferay Blade
curl https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.jpm.run/3.5.0/biz.aQute.jpm.run-3.5.0.jar >t.jar
sudo java -jar t.jar init
jpm version
@jverweijL
jverweijL / queries.sql.md
Last active April 23, 2020 08:31
Usefull queries for Liferay

Shows the ratings on assets

SELECT * FROM RatingStats;
select * from AssetEntry
select * from DDMStructure
select * from DDLRecordSet
select * from DLFolder
reserved-article-asset-tag-names
reserved-article-author-comments
reserved-article-author-email-address
reserved-article-author-id
reserved-article-author-job-title
reserved-article-author-location
reserved-article-author-name
reserved-article-author-organization
reserved-article-create-date
reserved-article-description
@jverweijL
jverweijL / workflow.groovy
Last active January 7, 2020 16:07
Add new user to Liferay using Liferay Forms and Workflow
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.counter.kernel.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.service.UserLocalServiceUtil;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.dynamic.data.lists.service.DDLRecordVersionLocalServiceUtil;
import com.liferay.dynamic.data.lists.model.DDLRecordVersion;
// static stuff