Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Mervine jmervine

View GitHub Profile
@jmervine
jmervine / splunk.sh
Last active Mar 29, 2021
Simple script to start and seed a local splunk instances using Docker
View splunk.sh
#!/usr/bin/env bash
# Simple script to start and seed a local splunk instances using Docker
# Usage:
# $ bash splunk.sh [USERNAME] [HEC TOKEN]
PASSWORD="$1"
TOKEN="$2"
test -z "$PASSWORD" && PASSWORD=password
test -z "$TOKEN" && TOKEN=token
View general.md

General Macros and Commands

Commands

Change Cursor Size

Options:

  • -1 is auto
  • 0 is smallest
  • 2 is biggest
/console cursorsizepreferred 2
@jmervine
jmervine / test-external-secrets.yaml
Last active Apr 18, 2019
godaddy external-secrets test
View test-external-secrets.yaml
---
apiVersion: 'kubernetes-client.io/v1'
kind: ExternalSecret
metadata:
name: test-external-secrets
namespace: default
secretDescriptor:
backendType: secretsManager
data:
- key: /splunk/license
View update.mk
UPDATE_TYPE ?= sts
STS ?=
indexers: ## Select indexer as actionable StatefultSet
indexers:
$(eval STS := indexer)
@echo "Set indexer as actionable StatefulSet"
indexer: indexers
View Makefile
# Override github.com/splunk/docker-splunk build args
# ---
# SPLUNK_ANSIBLE_BRANCH ?= master
# SPLUNK_VERSION ?= 7.2.0
# SPLUNK_BUILD ?= 8c86330ac18
# Choose a github.com/splunk/docker-splunk branch to deploy
DOCKER_SPLUNK_BRANCH ?= master
IMAGE ?= splunk-edge
View foo.tf
provider "helm" {
kubernetes {
config_path = "${local_file.kubeconfig.filename}"
}
}
provider "helm" {
kubernetes {
host = "${aws_eks_cluster.eks_master.endpoint}"
cluster_ca_certificate = "${base64decode(aws_eks_cluster.eks_master.certificate_authority.0.data)}"
View ecr.sh
# Simply ensure repo and return url
aws ecr create-repository --repository-name $1 2>/dev/null || true
echo "$(aws ecr describe-repositories --repository-name $1 | jq '.repositories[0].repositoryUri')"
View p.rb
#!/usr/bin/env ruby
# Modifying Float and Integer for fun.
class Float
def whole?
n = self
!!( n % 1 == 0 )
end
end
class Integer
@jmervine
jmervine / main.go
Last active Oct 3, 2017
Fetch a file from a private repo on github.
View main.go
package main
import (
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
)
View restart.rb
fake_rand = `hostname`.hash % 6
if config["STUNNEL_AUTORESTART"]
cron "stunnel-restart cron job" do
command "/sbin/restart stunnel-mod-gearman-worker-ssl"
minute [0, 15, 30, 45].map { |i| fake_rand + i }.join(", ")
mailto "srtools@heroku.com"
user "root"
action :create
end
else