Skip to content

Instantly share code, notes, and snippets.

View hemanth415's full-sized avatar

Hemanth Kumar hemanth415

  • Raleigh, North Carolina
View GitHub Profile
@hemanth415
hemanth415 / HrefExtractionScript.py
Last active April 16, 2019 18:09
Python script to Extract Href's from the list pages.
from bs4 import BeautifulSoup
import urllib.request
a={}
a = set()
f = open("output.txt","w")
with open('url.txt') as lines:
for line in lines:
#print(''.join(['URL: ', line]))
@hemanth415
hemanth415 / ListOfCompletedWorkflows
Created January 22, 2019 21:56
List Of Completed Workflows
path=/etc/workflow/instances/server0
type=cq:Workflow
1_property=status
1_property.value=COMPLETED
p.limit=-1
@hemanth415
hemanth415 / EventTypesInAEMAuthor.md
Last active May 21, 2019 14:15
Important Event Types in AEM Author

Activate com/day/cq/replication Deactivate com/day/cq/replication Delete com/day/cq/replication Asset created com/day/cq/dam Asset removed com/day/cq/dam Download com/day/cq/dam Version created com/day/cq/wcm/core/page Page created com/day/cq/wcm/core/page Page deleted com/day/cq/wcm/core/page Page modified com/day/cq/wcm/core/page

Generally AEM project can be created/structured leveraging Lazybones using the below command:
$ lazybones create aem-multimodule-project <project-directory-name>
Occationally, the above command fails to the project creation.
Unexpected failure: Connection reset
Cannot create a new project when the template isn't locally cached or no version is specified
In order to resolve the above error, we have to tweek the above command with the addition of relase version.
@hemanth415
hemanth415 / offline-compaction.sh
Last active April 16, 2019 18:09
Basic script for offline compaction.
aemdir=/Users/hemanth/Projects/AEM_6_2_Instance/author
today="$(date +'%Y-%m-%d-%H-%M-%S')"
compactdir="$aemdir/help"
crxdir="$aemdir/crx-quickstart"
oakrun="$compactdir/oak-run-*.jar"
logfile="$compactdir/compact-log-$today.log"
echo "" > $logfile
echo "Compaction directory: ${compactdir}..." | tee -a $logfile
echo "Quickstart directory: ${crxdir}..." | tee -a $logfile
@hemanth415
hemanth415 / PageAssetReferencesScript.jsp
Last active October 30, 2024 13:46
AEM Fiddle Script to list out all page asset references
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"
import="com.day.cq.dam.api.Asset,
com.day.cq.search.PredicateGroup,
com.day.cq.search.Query,
com.day.cq.search.QueryBuilder,
com.day.cq.search.result.Hit,
com.day.cq.search.result.SearchResult"%>
<%@ page import="org.apache.sling.api.resource.Resource" %>
@hemanth415
hemanth415 / dictionary-to-map
Last active March 28, 2018 14:06
Convert Legacy Dictionary to a Map in java
// Using Google Core Library and Java 8
public Map<String, Object> transformDictionary(Dictionary<String, Object> props) {
Iterator<String> keysIter = Iterators.forEnumeration(props.keys());
return Maps.toMap(keysIter, props::get);
}
@hemanth415
hemanth415 / aem-commands.md
Last active November 3, 2019 03:33
Useful AEM commands
  • Start AEM in debug mode with specific Run mode(s).

    java -Xmx512m -jar cq-author-p4502.jar -Dsling.run.modes=author,local -debug 30303

  • Start AEM in debug mode with specific Run mode(s) and admin password set.

    java -Xmx1024m -jar cq-author-p4502.jar -Dadmin.password=admin -debug 30303

    java -Xmx1024m -jar cq-author-p4502.jar -nointeractive -debug 30303