Skip to content

Instantly share code, notes, and snippets.

@petethepig
petethepig / 0-screenshot.md
Last active August 7, 2023 05:40
Send AWS EC2 maintenance notification to Slack

Screenshot

@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

require 'gsl'
require 'time'
module Diskalerter
class ThresholdEstimator
attr_reader :timestamps, :signal, :threshold, :now
# timestamps - a list of timestamps in epoch milliseconds
# signal - a list of values for the provided timestamps
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal)
@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active April 30, 2024 12:57
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
  1. Humans build and fix systems.
  2. Humans get tired and stressed, they feel happy and sad.
  3. Systems don't have feelings yet. They only have SLAs.
  4. Humans need to switch off and on again.
  5. The wellbeing of human operators impacts the reliability of systems.
  6. Alert Fatigue == Human Fatigue
  7. Automate as much as possible, escalate to a human as a last resort.
  8. Document everything. Train everyone. Save time.
  9. Kill the shame game.
  10. Human issues are system issues.
@thomasdarimont
thomasdarimont / readme.md
Last active May 20, 2024 22:58
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@nf
nf / nofrils-adg.vim
Created December 6, 2016 02:29
adg's modified nofrils vim color scheme
" Name: modified nofrils
" Author: adg
" URL: based on https://github.com/robertmeta/nofrils
" (see this url for latest release & screenshots)
" License: OSI approved MIT license
" Modified: 2016 Feb 26
hi clear
if exists("syntax_on")
syntax reset
@csabapalfi
csabapalfi / awesome-histograms.md
Last active December 31, 2018 04:32
awesome histograms
@mbartsch
mbartsch / ArchLinuxIpv6Docker.md
Last active December 30, 2021 20:41
Docker + IPv6 + ip6tables + dhcpcd

This is how I manage docker with ipv6 and dhcp-pd in arch linux

/etc/dhcpcd.conf

  duid
  persistent
  option rapid_commit
  option classless_static_routes
  option ntp_servers