Skip to content

Instantly share code, notes, and snippets.

View chauncey-garrett's full-sized avatar

Chauncey Garrett chauncey-garrett

View GitHub Profile
@hobayoba
hobayoba / certificate_synthetic.js
Last active June 7, 2022 17:03 — forked from adamcrews/certificate_synthetic.js
New Relic SSL/TLS Synthetic
/*
To use this synthetic, set the following Secure credentials under the Synthetic tab:
NEW_RELIC_INSIGHTS_API_KEY - Your api key for Newrelic Insights from the Insights Api Keys.
NEW_RELIC_INSIGHTS_URL - Your URL for Newrelic Insights events from the Insights Api Keys.
CERTS_TO_MONITOR - A list of hosts to check via https, separated by a comma and a space, for example:
host.example.com, foo.example.com
Create a new Synthetic monitor (browser script), copy the entire contents of this script to the monitor.
Set the monitor to run once a day from a single location.
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 20, 2024 04:07
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@ryderdamen
ryderdamen / triggering_cron_job_manually_on_kubernetes.md
Last active March 6, 2024 15:07
How to trigger a Cron Job manually on Kubernetes

Triggering a Cron Job manually on Kubernetes

So you've defined a cronjob.yaml manifest, but it doesn't run until midnight and you want to test it now? Simply replace the variables, and run the following command to create a job from the cronjob.

kubectl create job --from=cronjob/{{ cron_job_name }} {{ the-name-of-this-one-off-job }}

This will create a one-off job in your cluster based on your cronjob.yaml manifest, which might look something like this.

apiVersion: batch/v1beta1
@adamcrews
adamcrews / certificate_synthetic.js
Created June 11, 2019 05:36
New Relic SSL/TLS Synthetic
/*
To use this synthetic, set the following Secure credentials:
NEW_RELIC_INSIGHTS_API_KEY - Your api key from the account settings.
NEW_RELIC_ACCOUNT_ID - Your account ID, also found in the account settings.
CERTS_TO_MONITOR - A list of hosts to check via https, separated by a comma and a space, for example:
host.example.com, foo.example.com
Create a new Synthetic monitor, copy the entire contents of this script to the monitor.
Set the monitor to run once a day from a single location.
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 15, 2024 19:37
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@soloradish
soloradish / vault_logrotate
Created September 12, 2018 02:25
logrotate setting file for HashiCorp's Vault audit file
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
daily
# Do not execute rotate if the log file is empty.
notifempty
missingok
compress
# Set compress on next rotate cycl to prevent entry loss when performing compression.
delaycompress
@ernoaapa
ernoaapa / list-failing-pods.sh
Last active March 26, 2024 14:07
Script to list all Kubernetes Pods what are NOT ready
#!/bin/sh
#
# Print Pods which are Pending or not Ready for some reaosn
#
kubectl get pods --all-namespaces -o go-template='{{ range $item := .items }}{{ range .status.conditions }}{{ if (or (and (eq .type "PodScheduled") (eq .status "False")) (and (eq .type "Ready") (eq .status "False"))) }}{{ $item.metadata.name}} {{ end }}{{ end }}{{ end }}'
@nicerobot
nicerobot / wait-for-postgres.sh
Created June 27, 2017 14:30
A better wait-for-postgres.sh
#!/bin/bash -e
# wait-for-postgres.sh
# Adapted from https://docs.docker.com/compose/startup-order/
# Expects the necessary PG* variables.
until psql -c '\l'; do
echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is unavailable - sleeping"
sleep 1
done
@eriadam
eriadam / example-jenkinsfile-pipeline.groovy
Last active March 31, 2024 15:14
example-jenkinsfile-pipeline.groovy
#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}