Skip to content

Instantly share code, notes, and snippets.

View pindlebot's full-sized avatar

Ben Gardner pindlebot

View GitHub Profile
# Template for a Spark Job Server configuration file
# When deployed these settings are loaded when job server starts
#
# Spark Cluster / Job Server configuration
spark {
# Spark Master will be automatically learned via the DSE
# spark.master will be passed to each job's JobContext
# master = "local[4]"
# master = "mesos://vm28-hulk-pub:5050"
# master = "yarn-client"
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"math/rand"
"os"
"os/exec"
const fetch = require('node-fetch')
const AUTH_TOKEN = ''
const HOST = ''
const KIBANA_ENDPOINT = '${HOST}/elasticsearch/_msearch?rest_total_hits_as_int=true&ignore_throttled=true'
const preamble = `{"index":"*","ignore_unavailable":true,"preference":1561797618673}`
const payload = {
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
#!/usr/bin/env bash
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
curl -o /etc/yum.repos.d/elasticsearch.repo https://gist.githubusercontent.com/unshift/54c4eed278fca283ce71efb24a652885/raw/d1d4efbbae526f8546fc3abcda8fadbe185f45d7/elasticsearch.repo
yum install java-1.8.0-openjdk elasticsearch kibana logstash -y
chkconfig --add elasticsearch
chkconfig --add kibana
chkconfig --add logstash
const makeCancelable = (promise) => {
let isCanceled = false
const wrappedPromise = new Promise((resolve, reject) => {
promise.then(
val => isCanceled ? reject({ isCanceled: true }) : resolve(val), // eslint-disable-line prefer-promise-reject-errors
error => isCanceled ? reject({ isCanceled: true }) : reject(error) // eslint-disable-line prefer-promise-reject-errors
)
})