Skip to content

Instantly share code, notes, and snippets.

@ekristen
ekristen / renovate.json
Created December 7, 2023 17:31
Renovate Config - Kubernetes Versions - Separate Major/Minor
{
"packageRules": [
{
"matchDatasources": [
"go",
"docker"
],
"groupName": "kubernetes",
"groupSlug": "kubernetes",
"matchPackagePatterns": [

Files for setting up a test for restic assume role

Constrained Version

helm template test grafana/promtail --version 4.2.1 --values test.yaml
      volumes:
        - name: config
 secret:
# -- Default volume mounts. Corresponds to `volumes`.
# @default -- See `values.yaml`
defaultVolumeMounts:
- name: run
mountPath: /run/promtail
- name: containers
mountPath: /var/lib/docker/containers
readOnly: true
- name: pods
mountPath: /var/log/pods
@ekristen
ekristen / shell-one-liner-remove-bad-finalizer.sh
Created January 30, 2020 19:06
Shell One Liner to Remove Bad Finalizer From Kubernetes Resources
# Swap pod for any resource you need to iterate over. (ie daemonset, deployment)
kubectl get pods --all-namespaces | tail -n+2 | awk '{print $1 " " $2}' | xargs -L1 bash -c "kubectl patch -n \$0 pod/\$1 --type=merge -p \$(kubectl get -n \$0 pod/\$1 -o json | jq -Mcr '.metadata.finalizers // [] | {metadata:{finalizers:map(select(. != \"name-of-bad-finalizer\"))}}')"
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Small module for use with the wake on lan protocol.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import argparse
@ekristen
ekristen / auto-ci.sh
Last active September 18, 2018 04:58
NowSecure Auto CI Script
#!/bin/bash
# NowSecure Auto CI Script
#
# Uploads a Binary to Auto, performs preflight checks,
# then performs an assessment, and compares summary score
# and exits non-zero if score is lower than score threshold
#
# ---------------------------------------------------------------
#
@ekristen
ekristen / check_chrony
Last active February 22, 2023 14:26
Chrony Nagios Plugin
#!/bin/bash
# Changes by Erik Kristensen
#
# Changelog (2018/01/31)
# - Improved debugging, just set DEBUG=true in shell env
# - Can set critical, warning and service name via ENV vars or command line opts
# - Improved if statements for checking warning, critical conditions
# - Errors unknown if `bc` command line tool is not installed
#
@ekristen
ekristen / notify-pushover.sh
Last active February 7, 2024 22:05
Very Basic Nagios/Icinga Pushover Notification Script
#!/bin/sh
PUSHOVERUSER=$1
PUSHOVERTOKEN=$2
PUSHOVERTITLE=$3
PUSHOVERMESSAGE=$4
curl -XPOST \
-F "token=${PUSHOVERTOKEN}" \
-F "user=${PUSHOVERUSER}" \
@ekristen
ekristen / Dockerfile
Last active August 29, 2016 22:44
Example of Order Rules
FROM ubuntu
WORKDIR /opt
EXPOSE 3000
VOLUME ["/data"]
ENTRYPOINT ["node"]
CMD ["server.js"]
ADD package.json /opt/package.json
RUN npm install --production