Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
path="/etc/sling/slingpiper.config.xml">
<!-- Define the Sling Pipe configuration -->
<sling:config
jcr:primaryType="sling:OsgiConfig"
enabled="{Boolean}true">
@rogerblanton
rogerblanton / table-summary-rte.js
Last active December 10, 2023 11:46
A sample of how to modify an existing RTE Plugin
(function ($) {
"use strict";
var _ = window._,
Class = window.Class,
CUI = window.CUI,
EAEM_TABLE = null,
COLUMN_CONTAINER = ".rte-dialog-columnContainer",
SUMMARY_SEL = ".rte-dialog--tableprops textarea[data-type=\"summary\"]",
SUMMARY_HTML = '<div class="rte-dialog-columnContainer">'

AEM6.x Migration

  • How to Rebuild a Pre-Existing AEM+Mongo Cluster
  • or migrate from Tar to MongoDB or MongoDB to Tar"
  • or migrate from 5.6.1 or 6.x to 6.x via data migration instead of jar upgrade
  1. (Mongo to Mongo only) Remove one replica from the replica set and delete/recreate the db
    1. Remove the replica node from the set: http://docs.mongodb.org/master/tutorial/remove-replica-set-member/
    2. Validate that no other nodes in the set consider that node to be part of the set anymore. Log into each node in the cluster via mongo shell and run rs.status() to validate that the node that was taken out is not in the cluster any longer.
    3. Drop the aem database on that node http://docs.mongodb.org/manual/reference/command/dropDatabase/
  2. Re-add the database with the correct user permissions (do not add the mongo instance back to the replica set)
FROM ubuntu
RUN mkdir -p /mnt/crx/author
COPY <AEM_JAR> /mnt/crx/author/
COPY <TAR_OF_JDK_11> /
RUN tar -xf <TAR_OF_JDK_11>
ENV JAVA_HOME <EXTRACTED_JDK_FOLDER>
ENV PATH ${JAVA_HOME}/bin:${PATH}
@rogerblanton
rogerblanton / aem-templates-intellij.xml
Last active February 26, 2021 03:08
AEM IntelliJ Live Templates
<templateSet group="Adobe AEM">
<template name="aem-statictemplate" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;jcr:root xmlns:sling=&quot;http://sling.apache.org/jcr/sling/1.0&quot; xmlns:cq=&quot;http://www.day.com/jcr/cq/1.0&quot; xmlns:jcr=&quot;http://www.jcp.org/jcr/1.0&quot;&#10; jcr:description=&quot;$DESCRIPTION$&quot;&#10; jcr:primaryType=&quot;cq:Template&quot;&#10; jcr:title=&quot;$TITLE$&quot;&#10; allowedPaths=&quot;[$ALLOWED_PATHS$]&quot;&#10; ranking=&quot;{Long}$RANKING$&quot;&gt;&#10; &lt;jcr:content&#10; cq:designPath=&quot;$DESIGN_PATH$&quot;&#10; jcr:primaryType=&quot;cq:PageContent&quot;&#10; sling:resourceType=&quot;$RESOURCE_TYPE$&quot;&gt;&#10; &lt;/jcr:content&gt;&#10;&lt;/jcr:root&gt;&#10;$END$" description="Create template for Adobe AEM" toReformat="false" toShortenFQNames="true">
<variable name="DESCRIPTION" expression="" defaultValue="&quot;Enter the description&quot;" alwaysStopAt="true" />
<
@rogerblanton
rogerblanton / 1_kubernetes_on_macOS.md
Created February 25, 2021 05:13 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@rogerblanton
rogerblanton / floor-is-lava.html
Created January 27, 2021 21:37
A simple HTML file I made to randomly pick Floor is Lava colors because the board spinner that comes with the game is cheap and warps
<!doctype html>
<html>
<head>
<style>
body {
cursor: pointer;
height: 100vh;
}
</style>
/*!
* Pub/Sub implementation
* http://addyosmani.com/
* Licensed under the GPL
* http://jsfiddle.net/LxPrq/
*/
;(function ( window, doc, undef ) {
'use strict';
@rogerblanton
rogerblanton / smartrestize.js
Created October 20, 2014 17:38
Taken from Paul Irish taken from John Hann
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
public static void visitRecursively(Node node, Session currentSession) {
try{
NodeIterator list = node.getNodes();
while(list.hasNext()) {
Node childNode = list.nextNode();
// Verify child node for cqPage type
if((childNode.hasProperty("jcr:primaryType")) && (childNode.getProperty("jcr:primaryType").getValue().getString()).equals("cq:Page") ){