Skip to content

Instantly share code, notes, and snippets.

View helms-charity's full-sized avatar

Charity Helms helms-charity

View GitHub Profile
@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()
@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}"
}
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 / gist:c8d2b269d8a32fe80acf6afebfb0b12a
Last active November 20, 2023 14:41
System76 Serval with Ubuntu 22.04
Fresh install of Ubuntu. No DisplayLink driver installed.
Switched to Nvidia dirver 535.129.03 open from the x.org per https://support.system76.com/articles/upgrade-ubuntu, which says:
To add PPA deb https://ppa.launchpadcontent.net/system76-dev/stable/ubuntu/ jammy main
(more info at https://launchpad.net/~system76-dev/+archive/ubuntu/stable)
and to install the System76 Driver on an NVIDIA based system:
```sudo apt-get install -y system76-driver-nvidia```
More info: https://launchpad.net/~system76-dev/+archive/ubuntu/stable
---