Skip to content

Instantly share code, notes, and snippets.

View pyMixin's full-sized avatar
🎯
Focusing

pymixin pyMixin

🎯
Focusing
  • Corona, CA
  • 19:24 (UTC -07:00)
View GitHub Profile
SOLR_CONTEXT="https://${SOLR_TOMCAT_HOST}:${SOLR_TOMCAT_PORT}/${SOLR_TOMCAT_CONTEXT}"
REPO_CERT=$SSL_BASE/certs/client.pem
CURL_PARAMS=( -k -s --cert "$REPO_CERT":"$REPO_CERT_PW" )
# get indexing status
curl "${CURL_PARAMS[@]}" "$SOLR_CONTEXT/admin/cores?action=SUMMARY&wt=json" |jq -r '.Summary | keys_unsorted[] as $k | "\($k), \(.[$k]."TX Duration"), \(.[$k]."Id for last TX in index")/\(.[$k]."Id for last TX on server") tx, \(.[$k]."On disk (GB)") GB, \(.[$k]."Approx transaction indexing time remaining")"'
# Show numDocs,maxDoc and deletedDocs for each Alfresco core
curl "${CURL_PARAMS[@]}" "$SOLR_CONTEXT/admin/cores?action=SUMMARY&wt=json"| \
jq '.Summary[].Searcher' | jq -r '"\(.searcherName),\(.numDocs),\(.maxDoc),\(.deletedDocs)"'
@terencezl
terencezl / convert_pdf.py
Created April 20, 2017 04:39
use pdfminer to extract pdf
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter, XMLConverter, HTMLConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from io import BytesIO
def convert_pdf(path, format='text', codec='utf-8', password=''):
rsrcmgr = PDFResourceManager()
retstr = BytesIO()
laparams = LAParams()
@alexcasalboni
alexcasalboni / amazon-rekognition.md
Last active October 11, 2024 16:44
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search
@ololobus
ololobus / Spark+ipython_on_MacOS.md
Last active October 3, 2025 16:28
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

@casschin
casschin / gist:1990245
Created March 7, 2012 01:16
Python webdriver api quick sheet
### Locating UI elements ###
# By ID
<div id="coolestWidgetEvah">...</div>
element = driver.find_element_by_id("coolestWidgetEvah")
or
from selenium.webdriver.common.by import By
element = driver.find_element(by=By.ID, value="coolestWidgetEvah")
# By class name: