Skip to content

Instantly share code, notes, and snippets.

@justinedelson
justinedelson / Test.java
Created April 16, 2014 13:47
How to make a http request to get the auth token in AEM
import java.io.IOException;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
public class Test {
@justinedelson
justinedelson / add-video.groovy
Created March 30, 2013 21:01
Geb script which demonstrates how to add a component to a parsys in AEM 5.6
/**
*
* In this sample Geb script, we are going to add a video component to a page in AEM
* using the context menu.
*
*/
@Grapes([
@Grab("org.codehaus.geb:geb-core:0.7.2"),
@justinedelson
justinedelson / unquiesce.groovy
Created February 21, 2013 20:22
Groovy script to unquiesce a CQ/CRX instance
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnectorFactory;
import javax.management.ObjectName;
// assuming that CQ is started with -Dcom.sun.management.jmxremote.port=9000
def jmxUrl = "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi";
def serviceUrl = new JMXServiceURL(jmxUrl);
def jmxConnector = JMXConnectorFactory.connect(serviceUrl);
def mbeanConn = jmxConnector.getMBeanServerConnection();
@justinedelson
justinedelson / quiesce.groovy
Created February 21, 2013 20:21
Groovy script to quiesce a CRX/CQ instance
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnectorFactory;
import javax.management.ObjectName;
// assuming that CQ is started with -Dcom.sun.management.jmxremote.port=9000
def jmxUrl = "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi";
def serviceUrl = new JMXServiceURL(jmxUrl);
def jmxConnector = JMXConnectorFactory.connect(serviceUrl);
def mbeanConn = jmxConnector.getMBeanServerConnection();
@justinedelson
justinedelson / gist:3955062
Last active October 12, 2015 02:08
Install vlt (3.0.0) using Homebrew
First Time:
$ brew tap justinedelson/homebrew-filevault
$ brew install filevault
Every Other Time:
$ brew update
$ brew upgrade filevault
@justinedelson
justinedelson / gist:3942776
Created October 24, 2012 00:02
maven profiles for installing package in author and publish
<profiles>
<profile>
<id>autoInstallPackageAuthor</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
@justinedelson
justinedelson / gist:2879365
Created June 6, 2012 01:48
replacement for servlet archetype pom
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@justinedelson
justinedelson / gist:2871513
Created June 4, 2012 23:40 — forked from efroese/gist:2869165
remove sling from maven-launchpad-plugin output
<?xml version="1.0"?>
<!--
Licensed to the Sakai Foundation (SF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The SF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@justinedelson
justinedelson / adapters.json
Created November 12, 2011 03:36
Adapter JSON file
[
{
"adaptables":"org.apache.sling.api.resource.Resource",
"adapters":[
"javax.jcr.Node",
"javax.jcr.Item",
"java.net.URL",
"java.util.Map",
"org.apache.sling.api.resource.ValueMap"
],
@justinedelson
justinedelson / gist:1359911
Created November 12, 2011 02:16
AdapterWebConsolePlugin POC
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*