Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

naviat

🪲
View GitHub Profile
@naviat
naviat / monzo-alertmanager-config.yaml
Created April 25, 2022 01:19 — 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)
##
@naviat
naviat / values.yaml
Created April 15, 2022 03:28 — forked from l13t/values.yaml
alertmanager alerts to slack for prometheus-operator
.......some config.....
alertmanager:
## Deploy alertmanager
##
enabled: true
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##

Using Vagrant with Multi-Node MicroK8S to experiment with Kubernetes

This script (using Vagrant) is used to build a pair of Ubuntu based virtual machines that have the MicroK8S setup of Kubernetes.

It also installs docker, and sets up aliases for kubectl in line with the MicroK8S documentation.

Please note that this script relies on the fact that Vagrant transfers files in /vagrant to the host file system, which we can then use to setup the second node.

@naviat
naviat / Vagrant + MicroK8S - README.md
Created April 12, 2022 05:36 — forked from JonTheNiceGuy/Vagrant + MicroK8S - README.md
Using Vagrant with MicroK8S to experiment with Kubernetes
@naviat
naviat / redis_migrate.py
Created March 25, 2022 11:08 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@naviat
naviat / es-migrate.es6.js
Created February 15, 2022 01:36 — forked from TheDeveloper/es-migrate.es6.js
Script to migrate documents from one Elasticsearch cluster to another using Scan/Scroll
/*
Migrate documents from one elasticsearch endpoint to another.
To squeeze out extra performance, disable index refresh and replicas on the target cluster:
curl -XPUT 'http://elasticsearch:9200/_settings' -d '{
"index" : {
"refresh_interval" : "-1",
"number_of_replicas": "0"
}
@naviat
naviat / postgres-cheatsheet.md
Created October 8, 2021 09:47 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@naviat
naviat / peer_routes.py
Created October 6, 2021 17:18 — forked from bwhaley/peer_routes.py
A script to configure routes in in a VPC peering connection
# Quick script to configure routes for a VPC peering connection
# Searches a region for all peering connection and prompts to choose one
# Configures routes between the peered networks for all routing tables
# STS/AssumeRole not implemented cross-account peering. Instead,
# Choose accepter/requestor depending on which credentials are set in the environment
# Enter either IPv4 and IPv6 route destinations
# Example usage:
# ( Assuming boto credentials are configured)
# $ pip install boto3
# $ python3.6 peer_routes.py
# eks.yml
on:
pull_request:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
name: Build and Deploy to EKS
env:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",