Skip to content

Instantly share code, notes, and snippets.

View epugh's full-sized avatar

Eric Pugh epugh

View GitHub Profile
@epugh
epugh / fix_for_external_paths.patch
Created March 21, 2026 18:35
fix for external paths...
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index a29e3d0da43..7a321671c35 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -130,7 +130,7 @@ public class SolrTestCase extends LuceneTestCase {
return;
}
final Path extPath = ExternalPaths.DEFAULT_CONFIGSET;
- if (Files.isReadable(extPath /* implies exists() */) && Files.isDirectory(extPath)) {
+ if (extPath != null && Files.isReadable(extPath /* implies exists() */) && Files.isDirectory(extPath)) {
@epugh
epugh / post_book.py
Created May 12, 2024 17:43
Sample of uploading a book.json file to Quepid through API with token
import requests
import json
def post_book_data(quepid_uri, headers, data):
url = f'{quepid_uri}/api/import/books.json'
headers['Authorization'] = f'Bearer 019d3bc549ca751940288972375eb8c1778bcc555eda84865d680632381a72af'
response = requests.post(url, headers=headers, data=data)
return response.text
# Example usage
@epugh
epugh / Bertrand NDCG@10
Created February 13, 2020 22:49
Quepid NDCG@10 developed by Bertrand
// Wrap the Quepid objects and API in a namespace.
// Simple pass-through required by our NDCG scorer.
let quepidApi = {};
(function(context) {
context.getDocs = function() {
return docs;
}
pdf:docinfo:producer Adobe PDF Library 11.0
pdf:docinfo:created 2014-07-14T19:27:34Z
page
For release on delivery
10:00 a.m. EDT
July 15, 2014
classifier = ClassifierReborn::LSI.new #:auto_rebuild => false
strings = [
["n/a OSC Retreat.", :missing],
["LOOKING FOR SPEAKER", :missing],
["Need speaker", :missing],
["Elizabeth Solr Search", :present],
["Matt Datastax", :present],
["Scott Roll your own user analytics with Zeppelin", :present],
["Brandon Rose Spark and Elasticsearch", :present],

Hortonworks User Group

These are notes for following along on the talk I am giving at http://www.meetup.com/Washington-DC-Hortonworks-User-Group-Meetup/events/230394067/

This builds on the gist: https://gist.github.com/epugh/5729071c3b8aab81636d422c391aa716, but is meant to be stand alone! 1

  1. This gist is using not the latest version of Zeppelin, but the latest stable version. Replace the ip address 192.168.99.101 with the your docker machine ip. Get it by running docker-machine ip.
  2. Fire up Zeppelin + Spark Master and a Spark Worker via:

Future of Big Data: Philadelphia

These are notes for following along on the talk I am giving.

This builds on the gist: https://gist.github.com/epugh/5729071c3b8aab81636d422c391aa716, but is meant to be stand alone!

  1. This gist is using the latest version of Zeppelin. Replace the ip address 192.168.99.100 with the your docker machine ip. Get it by running docker-machine ip.
  2. Fire up Zeppelin + Spark Master and a Spark Worker via: docker run -d --name zeppelin -p 8080:8080 dylanmei/zeppelin
  3. If it doesnt' work, go back to the specific "stable" version of Zeppelin. There is a 1 GB layer in there, watch out!
@epugh
epugh / zeppelin_solr_spark_oh_my_meetup_notes.md
Last active October 9, 2018 03:30
Steps for following along with Eric's Zeppelin talk.

The below steps all assume you have installed Docker. I used the Kitematic tool for OSX, and it worked great. Everything is mapped to your "localhost" domain name.

  1. Let's Set up Zeppelin

    I am using this Docker image https://github.com/dylanmei/docker-zeppelin to fire up Zeppelin and Spark. Note, it's slow cause there is so many processes (Spark Master, Spark Worker, Zeppelin) to start! This is now up to Zeppelin 0.7.0

    docker run -d --name zeppelin -p 8080:8080 dylanmei/zeppelin
    
@epugh
epugh / pretty_print_xml.rb
Created March 16, 2016 17:49
Convert a big blob of XML into pretty printed XML in Ruby/Rails
# Oh dear god this was a pain to figure out! REXML had parsing issues, so instead
# I parse with Nokogiri, then dump it out and feed it to REXML to use the pretty printer.
nokogiri_doc = Nokogiri::XML xml_string
rexml_doc = REXML::Document.new nokogiri_doc.to_xml
formatter = REXML::Formatters::Pretty.new(2)
@doc = ""
formatter.write(rexml_doc, @doc)
@epugh
epugh / gist:5f4b40be01aa12ff9f5c
Created March 16, 2016 17:47
Convert a big blob of XML into pretty printed XML in Ruby/Rails
# Oh dear god this was a pain to figure out! REXML had parsing issues, so instead
# I parse with Nokogiri, then dump it out and feed it to REXML to use the pretty printer.
nokogiri_doc = Nokogiri::XML xml_string
rexml_doc = REXML::Document.new nokogiri_doc.to_xml
formatter = REXML::Formatters::Pretty.new(2)
@doc = ""
formatter.write(rexml_doc, @doc)