Skip to content

Instantly share code, notes, and snippets.

View pindlebot's full-sized avatar

Ben Gardner pindlebot

View GitHub Profile
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
)
})
#!/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
[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
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 = {
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"math/rand"
"os"
"os/exec"
# 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"
#!/usr/bin/env bash
sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
docker info
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

MIT License

Copyright (c) 2017-present Ben Gardner

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:

const chromeLauncher = require('chrome-launcher')
const DEFAULT_ARGS = [
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-extensions',