Skip to content

Instantly share code, notes, and snippets.

scrape_configs:
- job_name: monitoring
ec2_sd_configs:
- region: us-east-1
port: 9100
relabel_configs:
- action: replace
regex: ".*"
replacement: /var/log/nginx/access.log
target_label: __path__
#!/usr/bin/env python
import json, requests, base64, sys, os, re, socket
slack_url = "https://hooks.slack.com/services/###MYKEYHERE#####"
def main():
consul_stdin = json.load(sys.stdin)
getSVCStatus(consul_stdin)
@bamnet
bamnet / .gitlab-ci.yml
Last active January 11, 2023 06:16
Multiarch Go Builds
image: docker:latest
services:
- docker:dind
stages:
- build
variables:
IMAGE: registry.gitlab.com/bamnet/njtdata
DOCKER_CLI_EXPERIMENTAL: enabled
@m-wrona
m-wrona / k8s-nginx-deployment.yml
Created November 15, 2018 12:14
Nginx deployment for Kubernetes with Prometheus monitoring
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx
namespace: default
data:
nginx.conf: |
worker_processes auto;
events {
@merikan
merikan / Jenkinsfile
Last active September 4, 2025 20:48
Some Jenkinsfile examples
Some Jenkinsfile examples
@arykalin
arykalin / replicas-helm-range.yaml
Last active January 11, 2020 17:06
Helm template with replicaCount range
{{- $root := . -}}
{{ range $k, $v := until (atoi (quote $root.Values.Replicas) | default 5) }}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
service: {{ $root.Values.application }}-{{$v}}
name: {{ $root.Values.application }}-{{$v}}
@jpswade
jpswade / devops_best_practices.md
Last active October 15, 2025 05:39
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@rajkrrsingh
rajkrrsingh / Kafka-Metrics.md
Last active July 23, 2022 12:21
Monitoring Kafka Broker JMX using jolokia JVM Agent
Download Jolokia JVM Agent from following location
https://jolokia.org/download.html
wget http://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/1.3.7/jolokia-jvm-1.3.7-agent.jar

mv jolokia-jvm-1.3.7-agent.jar agent.jar
here is the small shell script to get metrics you are intersted in
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@tombentley
tombentley / kafka-cheat-sheet.md
Created June 14, 2017 10:39 — forked from sahilsk/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1