Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Mervine jmervine

View GitHub Profile
@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
View date_time_fmt.js
var DotW = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Satruday' ];
var MotY = [ 'January', 'Feburary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
var dig2 = function(n) {
if (n > 9) return n.toString();
return "0" + n;
};
var formatDateUtc = function(date) {
var dddd = DotW[date.getUTCDay()];
var MMMM = MotY[date.getUTCMonth()];
@jmervine
jmervine / cool.rb
Created Apr 14, 2017
cool, but never used
View cool.rb
scope :find_by_eamil, ->(email) do
# Search team.
teams = joins(:team).where(teams: { email: email })
return teams unless teams.empty?
# Search user.
joins(:user).where(users: { email: email })
end
You can’t perform that action at this time.