Skip to content

Instantly share code, notes, and snippets.

View kordless's full-sized avatar
🦥
sloth mode

Коrd Campbell kordless

🦥
sloth mode
View GitHub Profile
@kordless
kordless / auth.py
Created March 5, 2021 23:29
Passwordless Authentication for Mitta
import datetime
import logging
import os
import socket
import time
from random import randrange
import urllib.parse
from google.cloud import ndb
@kordless
kordless / timewarp.py
Created March 5, 2021 03:52
Mitta Timewarp
import datetime
from dateutil.relativedelta import relativedelta
import re
# timewarp.py
# Kord Campbell
# Copyright 2020, Mitta Corp.
# All Rights Reserved.
# description: common name to solr timerange converter in python3
@kordless
kordless / models.py
Created March 5, 2021 03:46
Models for Mitta
import datetime
import os
import requests
from google.cloud import ndb
import flask_login
from lib.util import random_string, random_number, generate_token, random_name
from lib.solr import doc_count
@kordless
kordless / spool.json
Last active March 1, 2021 17:25
Upload Reference for Mitta.us
{
"timestamp": "{{timestamp}}",
"request_url": "/g",
"result": "success",
"response": [{
"source_type": "spool",
"created": "{{created}}",
"updated": "{{updated}}",
"name": "{{name}}",
"upload_url": "{{upload_url}}",
@kordless
kordless / tag.py
Created February 27, 2021 17:58
Example code for loading a file out of a Google Cloud bucket and sending it to Google Vision.
import datetime
import json
import io
from google.cloud import ndb
from google.cloud import vision
from google.cloud import storage
from flask import Blueprint, request, make_response, render_template, abort
import flask_login
@kordless
kordless / README.md
Created December 16, 2020 20:41
Secure Solr Server in 2 Minutes with NGINX

Deploy Solr on Google Cloud in 2 Minutes

Useful information and scripts for deploying an instance based Solr Cloud in 2 minutes.

Check this repo out on your Google Cloud Shell terminal.

Launch Solr

Deploy a secure Solr instance on Google cloud:

$ ./deploy-solr.sh
@kordless
kordless / 10M_FUSION_SOLR_SKG_DEPLOY.md
Last active December 12, 2019 14:26
10 Minute Fusion and Solr Deployment Script for Google Cloud

10 Minute Fusion Solr SKG Deployment Script

This script deploys Lucidwork's Fusion 4.1.1 on a Google Cloud instance. Fusion includes Solr 7.4.

Solr 7.4 provides the semantic knowledge graph relatedness() function. This function may be used to extract related topics from datasets which represent a question/answer type structure.

Video

No video for this script exists.

Install

TBD

@kordless
kordless / 10M_TENSORFLOW2_DEPLOY.md
Last active August 27, 2023 17:12
10 Minute Tensorflow Deployment Script

UNFORTUNATELY THIS IS BROKEN AND NEEDS TO BE FIXED

Deploy Tensorflow 2 with Object Detection in 10 Minutes

This gist guide starts a server on your Google Cloud Free account. That server will be configured with Tensorflow. A script and sample notebook will guide you through trying out image recognition.

The instance takes about 10 minutes to launch.

Watch the Video

https://www.youtube.com/watch?v=LmjslM2NK3c

@kordless
kordless / README.md
Created May 14, 2019 17:43 — forked from nitaku/README.md
Minimal JSON HTTP server in python

A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.

python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
@kordless
kordless / topics.py
Last active October 3, 2018 20:20
SKG Python Query
import json
import urllib2
import sys
try:
ip = sys.argv[1]
except:
print "need an IP"
print "usage: python skg-query.py <ip> '<query>'"
sys.exit()
try: