Skip to content

Instantly share code, notes, and snippets.

@bdenning
bdenning / Dockerfile
Last active May 26, 2021
Dockerfile for creating Splunk container
View Dockerfile
FROM docker.io/centos:latest
MAINTAINER Bowen Denning <bdenning@gmail.com>
ENV PATH=$PATH:/opt/splunk/bin
RUN yum update -y
## Download and install Splunk
RUN curl https://download.splunk.com/products/splunk/releases/6.4.1/linux/splunk-6.4.1-debde650d26e-linux-2.6-x86_64.rpm -O && \
yum install -y splunk*.rpm && \
@bdenning
bdenning / samhainrc
Created Jun 11, 2016
Test Samhain Configuration
View samhainrc
#####################################################################
#
# Configuration file template for samhain.
#
#####################################################################
#
# -- empty lines and lines starting with '#', ';' or '//' are ignored
# -- boolean options can be Yes/No or True/False or 1/0
# -- you can PGP clearsign this file -- samhain will check (if compiled
# with support) or otherwise ignore the signature
View Install Splunk
#!/bin/bash
yum install -y https://download.splunk.com/products/splunk/releases/6.4.1/linux/splunk-6.4.1-debde650d26e-linux-2.6-x86_64.rpm
/opt/splunk/bin/splunk enable boot-start --accept-license
service splunk start
View k8s-node.cloud-init
#cloud-config
password: atomic
ssh_pwauth: True
chpasswd: { expire: False }
write_files:
- path: /etc/sysconfig/docker
content: |
OPTIONS='--selinux-enabled --log-driver=journald --registry-mirror=http://k8s.example.local:5000'
DOCKER_CERT_PATH=/etc/docker
- path: /etc/sysconfig/flanneld
@bdenning
bdenning / check-delivery.sh
Last active Mar 3, 2016
Check Toll Online Delivery Status
View check-delivery.sh
#!/bin/bash
## A "one-liner hack job" to check the delivery status of my new Galaxy Tab S2 (consignment note changed to hide my address)
## Just running this with "watch -n 1800 check-delivery.sh" will send a notification to my Pebble watch with the delivery status every 30 minutes.
curl -s --data '{"connoteIds":"ATHY214635","systemId":null}' 'https://online.toll.com.au/v1/trackAndTrace/searchConsignments' \
-H 'Host: online.toll.com.au' -H 'Accept: application/json' -H 'Content-Type: application/json' \
| python -c 'import sys,json; print json.load(sys.stdin)["tatConnotes"][0]["progressStatusDesc"]' \
| pushover
@bdenning
bdenning / aws-workstations-boot.sh
Last active Feb 23, 2016
A script to configure a development environment on Fedora 23
View aws-workstations-boot.sh
#!/bin/bash
cd /root/
## Configure golang development software
dnf update -y
dnf install -y git emacs-nox golang make tmux
mkdir src lib bin
echo "export GOPATH=/root/" >> /root/.bashrc
source /root/.bashrc
@bdenning
bdenning / aws-lambda-golang.example
Created Feb 22, 2016
AWS Lambda : Calling golang from python
View aws-lambda-golang.example
## lambda.py
import json
from sys import argv, stdin, stdout
from subprocess import Popen, PIPE
def lambda_handler(event, context):
proc = Popen('./main', stdin=PIPE, stdout=PIPE)
stdout, stderr = proc.communicate(json.dumps(event))
if stderr != None:
View .emacs
(setq backup-directory-alist `(("." . "~/.saves")))
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(menu-bar-mode -1)
(load-theme 'wombat)
(set-frame-parameter nil 'font "DejaVu Sans Mono-10")
View .tmux.conf
# use ctrl+a instead of ctrl+b
unbind C-b
set -g prefix C-a
bind a send-prefix
# allow tmux to be reloaded
unbind r
bind r source-file ~/.tmux.conf
# set colours
View glusterfs-centos-6-install.sh
yum install -y http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install -y ansible
cat << 'EOF' > /tmp/bootstrap.yaml
---
- name: Install and configure basic GlusterFS setup on Centos 6
hosts: localhost
connection: local
tasks:
- name: add the glusterfs yum repository