Skip to content

Instantly share code, notes, and snippets.

View jayankandathil's full-sized avatar

Jayan Kandathil jayankandathil

View GitHub Profile
@jayankandathil
jayankandathil / start.sh
Last active November 29, 2015 20:59
CQ 5.6.1 publish start script for 64-bit HotSpot 1.7 JDK on Solaris
#!/bin/bash
#
# This script configures the start information for this server.
#
# The following variables may be used to override the defaults.
# For one-time overrides the variable can be set as part of the command-line; e.g.,
#
# % CQ_PORT=1234 ./start
#
@jayankandathil
jayankandathil / cq_trigger_heapdump.sh
Last active August 29, 2015 14:14
Bash Script to Trigger JVM Heap Dump Using JMX
#!/bin/bash
# Bash script to trigger CQ/AEM heap dump using curl via JMX
# Author : Jayan Kandathil
# Version : 0.1
# Last updated : January 27, 2015
# Instructions : Copy to CQ/AEM Linux instance's /tmp folder, make necessary changes, enable the execute bit and run
@jayankandathil
jayankandathil / Workflow-AverageProcessingTimeMilliseconds.groovy
Last active August 29, 2015 14:06
Groovy script that reports average CQ and AEM workflow processing time
// Author : Jayan Kandathil
// Last Updated : June 18, 2014
// Version : 0.1
// Need following JVM init arguments for JMX access (Windows .bat example)
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.port=10000
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.authenticate=false
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.ssl=false
@jayankandathil
jayankandathil / Sling-AverageRequestDurationMilliseconds.groovy
Last active August 29, 2015 14:06
Groovy script that reports Apache Sling average request duration
// Author : Jayan Kandathil
// Last Updated : June 18, 2014
// Version : 0.1
// Need following JVM init arguments for JMX access (Windows .bat example)
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.port=10000
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.authenticate=false
// set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dcom.sun.management.jmxremote.ssl=false
@jayankandathil
jayankandathil / start.bat
Last active June 16, 2017 15:31
Adobe AEM 6.0 Windows start.bat for MongoDB (DEV environment)
@echo off
:: This script configures the start information for this server.
::
:: The following variables may be used to override the defaults.
:: For one-time overrides the variable can be set as part of the command-line; e.g.,
::
:: SET CQ_PORT=1234 & ./start.bat
::
setlocal
# ------------------------------------------------
# AWK script to print unique user IDs in a folder
# containing a collection of CQ's access.logs
# ------------------------------------------------
# Usage : gawk -f /opt/scripts/parse-cq-access-logs.awk /opt/aem/crx-quickstart/logs/access.log.*
# Author : Jayan Kandathil
# Last updated : April 16, 2014
# Version : 0.1
@jayankandathil
jayankandathil / start.bat
Last active January 12, 2017 08:55
Production-quality Windows start.bat for CQ 5.6.1 (Adobe Experience Manager) with JVM heap and garbage collection tuning - assumes the use of a 1.7 Oracle "HotSpot" JDK
@echo off
:: This script configures the start information for this server.
::
:: The following variables may be used to override the defaults.
:: For one-time overrides the variable can be set as part of the command-line; e.g.,
::
:: SET CQ_PORT=1234 & ./start.bat
::
setlocal
@jayankandathil
jayankandathil / start.sh
Last active February 9, 2017 02:06
Production-quality start script for CQ 5.6.1 (Adobe Experience Manager) with JVM heap and garbage collection tuning - assumes the use of a 1.7 Oracle "HotSpot" JDK
#!/bin/bash
#
# This script configures the start information for this server.
#
# The following variables may be used to override the defaults.
# For one-time overrides the variable can be set as part of the command-line; e.g.,
#
# % CQ_PORT=1234 ./start
#
#!/bin/bash
# Bash script to invoke CQ Backup using CURL
# Author : Jayan Kandathil
# Version : 0.4
# Last updated : May 24, 2013
# Instructions : Copy to CQ's /bin folder, make necessary changes, enable the execute bit and test
@jayankandathil
jayankandathil / get_cq_page.java
Last active December 18, 2015 17:19
Sample Java servlet code snippet showing how to use Apache HTTPComponents (tested with httpclient-4.2.3.jar and httpcore-4.2.2.jar) to connect to a remote Adobe Experience Manager (CQ) instance and GET a web page for server health check (heartbeat) purposes.
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;