Skip to content

Instantly share code, notes, and snippets.

View gist:86bd786c33884cb3901d893b8cff32d8
$ pip --version
pip 19.0.3 from /home/joey/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pip (python 3.7)
$ pip install
PyQt5-5.12.3-5.12.7-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl is not a supported wheel on this platform.
View 1-Oak SegmentNotFoundException repair

The objective here is to find all SegmentNotFoundException type corruption and remove it (as we don't have a valid backup)

Before running any of the below steps we created an index.json file (see the file below) which contains only the index definitions of the corrupted indexes.

  1. This generates the file indexing-results\index-definities.json
java -Xmx8g -jar oak-run-1.8.12.jar index --fds-path=crx-quickstart\repository\datastore crx-quickstart\repository\segmentstore --index-definitions
  1. From that file we copied only the definitions we needed and created index.json (file attached here )
View gist:0ad2ce95991997061940600b1167ddac
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="TV">
<meta name="keyword" content="TV Show">

Generating Authy passwords on other authenticators

There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues

View gist:696c2cdb463824f31ef90fcb9f9ec539
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
View gist:afda92a8e876bc01a66da37b91061ba7
tml / oakTreeNodeCount.groovy
Created Jul 15, 2019 — forked from andrewmkhoury/oakTreeNodeCount.groovy
Counting nodes in a tree of Oak repository using the oak-run console tool
View oakTreeNodeCount.groovy
import org.apache.jackrabbit.oak.spi.state.NodeState
import java.util.concurrent.atomic.AtomicInteger
def countNodes(NodeState n, String path = "/", flush = 5000, AtomicInteger count = new AtomicInteger(0), root = true) {
if(root) {
println "Counting nodes in tree ${path}"
cnt = count.incrementAndGet()
if (cnt % flush == 0) println(" " + cnt)
View Setting a property using oak-run
  1. Download (or build oak-run 1.1.x version)
  2. Stop all AEM instances
  3. Upload the oak-run 1.1 version to the AEM server if using TarMK or MongoDB server (if using MongoMK)
  4. Run this command to start the oak console
  • on TarMK:
   java -jar target/oak-run.jar console --quiet /path/to/segmentstore
  • For MongoMK run this:
tml /
Created Jul 15, 2019 — forked from andrewmkhoury/
Apache Sling - enabling debug log level for all java packages when instance won't start up
  1. Open this file in an editor crx-quickstart/launchpad/config/org/apache/sling/commons/log/LogManager.config
  2. Change value from "info" to "debug"
  3. Try to start the instance again
tml /
Created Jul 15, 2019 — forked from andrewmkhoury/
Reindexing Oak Async Indexes on a Clone AEM Instance

How to Reindex AEM on a Clone Instance and Sync over the Changes

  1. Clone your AEM instance to another VM for reindexing
  2. Download these oak-run jars:
  1. Upload the oak-run jars to the clone server
  2. Stop AEM (stop all AEM instances if a cluster or cold standby)
  3. Run this command (using oak-run-1.6.6.jar)
  • java -Xmx4096m -jar oak-run-1.6.6.jar checkpoints /path/to/repository/segmentstore
  1. Run this command (using oak-run-1.6.6.jar)