Skip to content

Instantly share code, notes, and snippets.

@jay-johnson
jay-johnson / Change the Compose File without having to Rebuild the Container.md
Last active January 4, 2017 23:47
Change the Compose File without having to Rebuild the Container

Clone the Repo

$ git clone https://github.com/jay-johnson/docker-schema-prototyping-with-mysql.git

Start the Composition

$ ./start_composition.sh 
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@andrewmkhoury
andrewmkhoury / Oak Datastore Check.md
Last active April 29, 2021 08:19
Oak Datastore Consistency Check
  1. Download the oak-run version that matches what is installed from http://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/
  2. Stop all AEM instances in cluster
  3. Upload the oak-run jar to the AEM server
  4. Run this command to start the oak console
  • on TarMK:
   java -Xmx4g -jar target/oak-run.jar console --quiet /path/to/segmentstore
  • For MongoMK run this:
@badvision
badvision / sessionSummary.groovy
Created February 9, 2016 23:30
Summarize all open JCR sessions by the stack trace of the code that opened them. This helps identify session leaks in code.
import groovy.json.JsonSlurper
//Get data from here: /system/sling/monitoring/mbeans/org/apache/jackrabbit/oak/%2522SessionStatistics%2522.2.json
def file = '/Users/brobert/Desktop/all_sessions.json' as File
def sanitizeStacktrace = {trace->
if (trace.contains("loginAdministrative")) {
def lines = trace.split("\n")
def startIdx;
for (def idx=0; idx < lines.length; idx++) {

Note that offline compaction requires a long duration of downtime from 30 minutes to 7 hours (and in extreme cases more time).

Offline Oak compaction with debug logging:

  1. Stop Oak / AEM
  2. Install the latest Oak hotfix to your AEM instance:
@andrewmkhoury
andrewmkhoury / OakMaintenanceLogMessages.md
Last active August 29, 2017 21:22
Apache Oak Maintenance Log Messages

MongoDB Storage (aka "MongoMK") and RDBMK:

Revision GC:

12.09.2015 00:00:00.857 *INFO* [pool-7-thread-10] org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector Starting revision garbage collection. Revisions older than [2015-09-11 00:00:00.857] would be removed
13.09.2015 00:00:15.912 *INFO* [pool-7-thread-9] org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector Iterated through 10000 documents so far. 9698 found to be deleted
14.09.2015 00:00:49.358 *INFO* [pool-7-thread-12] org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector Deleted 859050 (58.28%) documents so far
12.09.2015 00:39:43.490 *INFO* [pool-7-thread-10] org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector Version garbage collected in 39.71 min. VersionGCStats{ignoredGCDueToCheckPoint=false, deletedDocGCCount=180021, splitDocGCCount=4853, intermediateSplitDocGCCount=441, timeToCollectDeletedDocs=14.62 min, timeTakenToDeleteDocs=23.52 min}
@nateyolles
nateyolles / curlPackageFilterRules.sh
Last active November 2, 2023 16:30
AEM/CQ cURL: Adding include/exclude rules to package filters
# Adding include/exclude rules to CQ/AEM package filters through cURL.
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands.
# However, I haven't seen an example of adding rules to package filters. The
# JSON "rules" key takes an array value. You can leave the array empty if you
# don't need to include any rules. The array is of JSON objects with a
# "modifier" key and value of "include" or "exclude", and a "pattern" key with
# your path or regular expression as the value.
# create package
@chetanmeh
chetanmeh / bundle.info
Created January 21, 2013 15:01
Felix 4.x bundle.info description
11 #Bundle Id
slinginstall:/path/to/foo.jar #Bundle original location
32 #Persistence State (INSTALLED, RESOLVED etc)
1 #Start level
1358768421064 #Last modified
0 #Refresh Count