Skip to content

Instantly share code, notes, and snippets.

@spuder
spuder / chef-http-client.rb
Created April 1, 2016 20:43
A working, but ugly way to fetch from a url
ruby_block 'get build' do
block do
require "net/https"
require "uri"
require "json"
uri = URI.parse("http://nexus.example.com/nexus/service/local/repositories/foobar/content/master-5678.zip?describe=info")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@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:
@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
  1. Download https://files.acrobat.com/a/preview/e885654b-8424-4698-b5e9-7751b647276b (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: