Skip to content

Instantly share code, notes, and snippets.

@chromko
chromko / monzo-alertmanager-config.yaml
Created August 27, 2019 15:41 — forked from milesbxf/monzo-alertmanager-config.yaml
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)
##
@bmoyles
bmoyles / 52-ec2-xen-vbd-devices.rules
Created March 19, 2019 17:29
ec2 vbd and NVMe udev rules and helpers
# ensure any xen virtual block devices named xvdN get a sdN symlink for consistency
KERNEL=="xvd*", PROGRAM="/sbin/ec2udev-vbd %k", SYMLINK+="%c"
@grem11n
grem11n / Jenkinsfile
Last active March 18, 2023 12:54
Jenkinsfile which loads builds for microservices in monorepo based on git diff
#!/usr/bin/env groovy
// Load the shared libraries
@Library('jenkins-shared-libraries')_
import static groovy.io.FileType.FILES
// Load child Jenkinsfiles based on diff
def loadDiff() {
dirs = []
loads = [:]
@marjamis
marjamis / aws_cli_paginator.sh
Created July 2, 2017 07:05
A simple sample of running the AWS CLI which will take consideration of pagination to get all results.
#!/bin/bash -xe
# Below command can be replaced to the required CLI, including with custom JSON output, assuming the NextToken is in the same location.
AWS_CLI_COMMAND="aws elasticbeanstalk list-platform-versions --max-records 100 --query={NextToken:NextToken,PlatformARNs:PlatformSummaryList[*].PlatformArn}"
OUTPUT_FILE="./output-$(date +%s)"
function CLI_call() {
if [ ! -v NEXT_TOKEN ]; then
cli_output=$($AWS_CLI_COMMAND)
else
@fearphage
fearphage / .gitconfig
Last active November 26, 2018 15:13
When you need to save the code before you save yourself, git fire.
[alias]
fire = !"f() { \
local current_branch=$(basename \"$(git symbolic-ref HEAD)\"); \
local new_branch=fire-${current_branch}-$(git config user.email)-$(date +%s) \
local message; \
if [ -z \"$1\" ]; then \
message=\"fire commit from $current_branch\"; \
else \
message=\"$*\"; \
fi; \
@oliworx
oliworx / full-xfs-backup
Created March 25, 2016 11:57
very fast full backup of XFS partition with xfdump and lzo compression
sudo xfsdump -L KW12 -M FullBackup -J - / |lzop > /media/oli/465GB/Backup/Oli/Vostro/Linux-xfsdump-2016-03-26.lzo
## Explanation:
# sudo xfsdump
# -> start the xfsdump programm with root privileges
# -L KW12
# -> gives the Backup the label KW12
# -M FullBackup
@PowerKiKi
PowerKiKi / generate-wildcard-certificate.sh
Created December 4, 2015 07:31
Generate self-signed wildcard SSL certificate for development environment
#!/usr/bin/env bash
# print usage
DOMAIN=$1
if [ -z "$1" ]; then
echo "USAGE: $0 domain.lan"
echo ""
echo "This will generate a non-secure self-signed wildcard certificate for given domain."
echo "This should only be used in a development environment."