Skip to content

Instantly share code, notes, and snippets.

View ryanlfoster's full-sized avatar

Ryan L. Foster ryanlfoster

View GitHub Profile
package com.site.dotcom.service.services.impl;
import java.util.ArrayList;
import java.util.List;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.Service;
@ryanlfoster
ryanlfoster / rotate_logs.sh
Last active October 19, 2017 00:26 — forked from toodooleedoo/README.md
#AEM #CQ Rotate Logs
#!/bin/sh
#
#CQ Log Rotater
#
#This script will rotate logs in each CQ related log directory to its relative folders archive directory.
#Eventually these logs get zipped and after time removed.
#
######## INSTALLATION INSTRUCTIONS #########
#
# 1) Copy this to CQ crx-quickstart directory.
#!/bin/bash
# our AEM app runs as the 'day' user in the /home/day DIR
## for you yungins, 'day' is the company that created cq5/aem6
# MUST RUN THIS as the day user
# {{ aem_type }} is the AEM instance type we store in Ansible .. author or publish
PID=$(ps aux | egrep "day.*java" | egrep -v "egrep" | awk '{print $2}')
LOG="/home/day/{{ aem_type }}/crx-quickstart/logs/threaddump.log"
# clear out old log file
---
# ansible-playbook -i inventories/ec2.py adhoc/aem_thread_dump.yml --limit aem-author.example.com
# tag_role_aem is what our AWS EC2 AEM nodes are tagged with .. tag:role=aem
# the --limit <node name> is the name of the node you want to run the thread dump helper on
- hosts: tag_role_aem
max_fail_percentage: 1
vars:
email_to:
#!/bin/bash
#set -x
#==========================================================================
# NAME
# aem-control - start, stop, restart or check the status of
# an AEM instance (>= 5.5.0)
#
# SYNOPSIS
# aem-control [start|stop|restart|status|activate|sweep|help|version]
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
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
@ryanlfoster
ryanlfoster / AbstractIntegrationTest.java
Created October 22, 2015 18:52 — forked from klcodanr/AbstractIntegrationTest.java
An abstract class for creating integration tests to use the Sling Remote Testing Tools to test AEM / Adobe CQ5 projects.
package com.sixdimensions.wcm.cq.it;
import java.io.IOException;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.apache.sling.testing.tools.sling.SlingClient;
import org.apache.sling.testing.tools.sling.SlingTestBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ryanlfoster
ryanlfoster / _install_sonar_php.sh
Created October 22, 2015 04:52 — forked from textarcana/_install_sonar_php.sh
Sonar for PHP installation steps for CentOS 6. See also http://docs.codehaus.org/display/SONAR/Installing+PHP+Environment as well as my Pinboard bookmarks for Sonar installation: https://pinboard.in/u:noahsussman/t:sonar+install
# Sonar for PHP installation for CentOS 6
# See http://docs.codehaus.org/display/SONAR/Installing+PHP+Environment
/sbin/service mysqld start
sudo /usr/bin/mysql_secure_installation
# for non-production instances, choose not to create a root password
mkdir /var/sonar
wget http://dist.sonar.codehaus.org/sonar-3.4.1.zip
unzip sonar-3.4.1.zip
@ryanlfoster
ryanlfoster / notify_build_result.sh
Created October 22, 2015 04:47 — forked from gabro/notify_build_result.sh
Bambo <3 GitHub Status API
#!/bin/bash
GITHUB_API=https://api.github.com
AUTH_TOKEN= # GITHUB API TOKEN HERE
REPO= # REPO NAME HERE
URL=${bamboo.buildResultsUrl}
SHA=${bamboo.repository.revision.number}
SUCCESS_DESCRIPTION="The Bamboo CI build passed"
FAILURE_DESCRIPTION="Build #${bamboo.buildNumber} failed"
@ryanlfoster
ryanlfoster / AEM cURL
Created October 10, 2015 01:15 — 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