Skip to content

Instantly share code, notes, and snippets.

View helms-charity's full-sized avatar

Charity Helms helms-charity

View GitHub Profile
import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeState
import org.apache.jackrabbit.oak.spi.state.NodeBuilder
class LibsCleaner {
def session
def scanBundles(remove = false) {
@helms-charity
helms-charity / childCountWarning.groovy
Created February 12, 2022 21:10 — forked from stillalex/childCountWarning.groovy
counts number of nodes in tree, logging a warn is the number of child nodes exceeds a certain threshold
import java.util.concurrent.atomic.AtomicInteger
import org.apache.jackrabbit.oak.api.Type
import org.apache.jackrabbit.oak.plugins.segment.SegmentBlob
import org.apache.jackrabbit.oak.spi.state.NodeState
def countNodes(NodeState n, String path = "/", Integer flush = 1000000, Long warnAt = 1000, AtomicInteger count = new AtomicInteger(0), AtomicInteger binaries = new AtomicInteger(0), root = true) {
if(root) {
println "Counting nodes in tree ${path}"
}
@helms-charity
helms-charity / rmNode.groovy
Created February 12, 2022 21:09 — forked from stillalex/rmNode.groovy
Groovy script to remove a node at a given path
import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeStore
import org.apache.jackrabbit.oak.commons.PathUtils
def rmNode(def session, String path) {
println "Removing node ${path}"
NodeStore ns = session.store
def nb = ns.root.builder()
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicInteger
import org.apache.jackrabbit.oak.api.Type
import org.apache.jackrabbit.oak.plugins.segment.SegmentBlob
import org.apache.jackrabbit.oak.spi.state.NodeState
def countNodes(NodeState n, deep = false, String path = "/", Integer flush = 50000, AtomicInteger count = new AtomicInteger(0), AtomicInteger binaries = new AtomicInteger(0), root = true) {
if(root) {
println "Counting nodes in tree ${path}"
}
@helms-charity
helms-charity / archive.applescript
Created November 11, 2017 05:45 — forked from davejlong/archive.applescript
Rebuilding Quick Actions in Outlook for Mac
(*
Script to Mark Item as Read and Move to folder "Archive"
For Microsoft Outlook 15
*)
tell application "Microsoft Outlook"
activate
set msgSet to current messages
if msgSet = {} then
error "No Messages selected. Select at least one message."
@helms-charity
helms-charity / cq5 startup script
Created February 2, 2016 04:06
Startup script for Adobe CQ 5.6, tested on CentOS 6.5
+-----------------------+
| /etc/rc.d/init.d/cq5 |
+-----------------------+
#!/bin/bash
#
# cq5 Startup script for Adobe AEM/CQ5
#
# chkconfig: 345 80 20
# description: Startup script for Adobe AEM/CQ5
@helms-charity
helms-charity / cqmgr
Last active August 29, 2015 14:01 — forked from klcodanr/cqmgr
#!/bin/bash
# a script to make it easier for developers to start multiple CQ instances
# instructions here http://labs.sixdimensions.com/blog/2014-04-28/my-aem-dev-setup/
# Default Settings
version=5.6.1
root=~/dev/cq
publish=
debug="true"