Skip to content

Instantly share code, notes, and snippets.

@ronnyfm
ronnyfm / query-aws-logs-insights.bash
Created June 28, 2024 20:40 — forked from dsmrt/query-aws-logs-insights.bash
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
# this script queries aws logs with insights filtering on ERROR
# explanation of start and end times
#--start-time = unix timestamp 30 mins in the past
#--end-time = unix timestamp now
QUERY_ID=$(aws logs start-query \
--profile $profile \
--log-group-name /aws/lambda/aap-event-consumer-dev \
--start-time `date -v-30M "+%s"` \
@ronnyfm
ronnyfm / delete-unpublished-nonreferenced-assets.groovy
Created April 25, 2023 15:30
This Groovy script can be used to delete assets that have never been published or deactivated assets that are not referenced in any pages or DAM. It is a cleanup script. Optionally you can generate a report. It requires the Groovy Console
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.query.Query;
import javax.jcr.query.QueryManager;
import javax.jcr.query.QueryResult;
final String BASE_UNPUBLISHED_STATEMENT = "select * from [dam:Asset] as a where([jcr:content/cq:lastReplicationAction] is null or [jcr:content/cq:lastReplicationAction] = 'Deactivate') and isdescendantnode(a, '%s')";
@ronnyfm
ronnyfm / AEM cURL
Created June 28, 2016 04:58 — forked from joemaffia/AEM cURL
AEM cURL commands
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
bundlefile=@"name of jar.jar" http://localhost:4505/system/console/bundles
Build a bundle
curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
@ronnyfm
ronnyfm / sml.html
Created September 11, 2012 16:54 — forked from THEtheChad/sml.html
SML
{% partial name:'media_data' %}
{% editable_setting GDS type:'string' default:'http://involver-gatorade.herokuapp.com' %}
{% contest name:'test' %}
<script>
var temp = [
/*{% paginate contest.contest_entries per_page:9999 keywords:filters %}*/
// total: {{total_entries}}
{% for media in contest_entries %}