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 / murmer.py
Created September 28, 2018 16:51
SKG Query for Fusion
import json
import urllib2
import sys
try:
ip = "35.xxx.xxx.xxx"
except:
print "need an IP"
print "usage: python skg-query.py <ip> '<query>'"
@kordless
kordless / README.md
Last active August 18, 2021 18:43
Indexing XKCD with Lucidwork's Fusion and Google Image API

Overview

This Seed Streams guide illustrates how to use Lucidworks Fusion to crawl a specific set of documents on a website whose URIs match a regular expression. Additionally, img src fields are extracted with a JavaScript parsing stage and inserted into the index for use in other indexing stages. A vision network may be utilized to extract additional fields from the images.

Start Fusion and Create a New Appliction

  1. Start a Fusion instance on Google. Click the link the script outputs to navigate to the Fusion instance page. Set a password. Login with admin and the new password.
  2. Create a new application. Call it XKCD.
  3. Click on the new application.

Add a New Datasource and Limit the Documents

  1. Create a new datasource under Indexing..Datasources. Add a web source. Add https://xkcd.com a
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://xkcd.com/614/info.0.json</loc></url>
<url><loc>https://xkcd.com/502/info.0.json</loc></url>
</urlset>
{"nodes": [{"group": 1, "id": "realdonaldtrump"}, {"group": 1, "id": "marthalimkhemra"}, {"group": 1, "id": "mlkhemra3"}, {"group": 1, "id": "degreesseven"}, {"group": 1, "id": "skyflameburns"}, {"group": 1, "id": "theanti85913723"}, {"group": 1, "id": "mlkhemra8"}, {"group": 1, "id": "jinsefoz1"}, {"group": 1, "id": "christo69443573"}, {"group": 1, "id": "tracevatoons"}, {"group": 1, "id": "given_rick"}, {"group": 1, "id": "selenalimkhemra"}, {"group": 1, "id": "bluebird0566"}, {"group": 1, "id": "danieljfaley"}, {"group": 1, "id": "mikeymgm1701"}, {"group": 1, "id": "jojodr27"}, {"group": 1, "id": "fedupresistrgrl"}, {"group": 1, "id": "cfreshsobrookln"}, {"group": 1, "id": "trumpsucksit"}, {"group": 1, "id": "pagosadude"}, {"group": 1, "id": "reneegalvan4"}, {"group": 1, "id": "spanker_tanker"}, {"group": 1, "id": "pvarkol"}, {"group": 1, "id": "maddogzs"}, {"group": 1, "id": "getdigitalworl3"}, {"group": 1, "id": "trumpateam"}, {"group": 1, "id": "nodemon45"}, {"group": 1, "id": "recitesocial"}, {"group":
@kordless
kordless / README.txt
Last active June 22, 2018 23:30
output forcenode format for d3.json from lucidworks fusion
./forcenode.py 35.233.253.193 celeb-list.txt > amps.json
@kordless
kordless / start-vpn.sh
Last active August 28, 2022 02:25
VPN Server for Google Cloud
#!/bin/bash
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
SERVER_NAME=vpn-$NEW_UUID
gcloud compute instances create $SERVER_NAME \
--machine-type "n1-standard-1" \
--image-family ubuntu-1604-lts \
--image-project "ubuntu-os-cloud" \
--boot-disk-size "20" \
--boot-disk-type "pd-ssd" \
--boot-disk-device-name "$NEW_UUID" \
#include "shieldrelay.h"
#define relay1 D3
#define relay2 D4
#define relay3 D5
#define relay4 D6
#define relay5 D0
#define relay6 D1
bool relays[7] = {false,false,false,false,false,false,false};
@kordless
kordless / binaryprimes.py
Last active October 13, 2017 04:09
Nodebox Visualization for Increasing Binary Prime Spiral
import pyprimes
import random
size(250,250)
speed(20)
def setup():
print "running"
global r
r = 0
@kordless
kordless / primevisual.py
Last active October 6, 2017 12:15
I wrote this code to generate images using primes. You'll need pyprimes to run it, which is here: https://github.com/uzumaxy/pyprimes. I don't know what this means, but it's definitely weird.
"""
Copyright (c) 2017, Kord Campbell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@kordless
kordless / ipfs.yml
Last active September 13, 2022 06:28
Deploy IPFS on Kubernetes
apiVersion: v1
kind: Service
metadata:
name: ipfs
spec:
type: NodePort
ports:
- name: ipfs
port: 8080
targetPort: 8080