Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar
⚡

jespada jespada

⚡
View GitHub Profile
@jmatsushita
jmatsushita / README
Last active September 27, 2026 21:28
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@dmitri-lerko
dmitri-lerko / rules.yaml
Created October 25, 2021 14:57
Dynamic prometheus alert rules based on team label
# List of kube_*_labels metrics - not all of these are useful for alerting.
# kube_certificatesigningrequest_labels
kube_certificatesigningrequest_labels * on (certificatesigningrequest) group_right(label_team) (
...insert expression here
)
# kube_cronjob_labels
kube_cronjob_labels * on (cronjob, namespace) group_right(label_team) (
...insert expression here
)
@reetasingh
reetasingh / envoy_http_dynamic_forward_proxy.yaml
Created March 22, 2021 20:13
Envoy to operate as an HTTP dynamic forward proxy
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
address: 127.0.0.1
protocol: TCP
port_value: 9901
static_resources:
listeners:
- name: listener_0
#!/bin/sh
set -e
set -x
cd $HOME
rm -rf netstack.bare netstack
git clone --bare $HOME/gvisor netstack.bare
cd netstack.bare
[diff "clj"]
xfuncname = "^(\\((def|ns)([^\\[])*).*$"
@mikesparr
mikesparr / bastion_iap_setup.sh
Last active May 16, 2023 14:51
Google Cloud bastion jump host with Cloud IAP tunneling over private network example
#!/usr/bin/env bash
# set vars
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export REGION="us-central1"
export ZONE="us-central1-a"
@lizthegrey
lizthegrey / attributes.rb
Last active August 24, 2026 08:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@reborg
reborg / conference-radar.md
Last active January 28, 2019 17:56
Conference Radar
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active July 28, 2026 19:34
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)
##
groups:
- name: datetime
rules:
- record: daily_saving_time_belgium
expr: |
(vector(0) and (month() < 3 or month() > 10))
or
(vector(1) and (month() > 3 and month() < 10))
or
(