Skip to content

Instantly share code, notes, and snippets.

@m1keil
m1keil / Corefile
Last active April 21, 2024 16:05
DNS based service discovery for Nomad (Using CoreDNS). Workaround for https://github.com/hashicorp/nomad/issues/12588
.: {
log
loadbalance
# auto: automatically pick up file changes
auto service.nomad {
directory local/zones
reload 1s
}
}
@jsiebens
jsiebens / fabio.nomad
Last active September 24, 2023 06:23
Nomad monitoring with Thanos
job "fabio" {
datacenters = ["dc1"]
type = "system"
group "fabio" {
network {
mode = "host"
port "lb" {
static = 9999
@billti
billti / arm64-on-Win10.md
Last active March 13, 2025 20:04
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
@jpswade
jpswade / devops_best_practices.md
Last active April 1, 2025 11:02
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

@anjia0532
anjia0532 / nexus_docker_image_clean.py
Last active July 11, 2019 08:14
auto clean more than 30 unused docker image https://stackoverflow.com/a/46481098/7001350
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# python2.7
from requests import Request, Session
from requests.exceptions import RequestException
from datetime import datetime,timedelta
import base64
import json
import sys
@stalkerg
stalkerg / ptrack_backup_todo.md
Last active May 31, 2016 17:05
Truly Incremental backup for Postgres

Description

First, I will talk about the current state of affairs. We have a several approaches:

  1. Scan all db files and compare page LSN (barman, pg_rman). If you have big db it is not your choice.

  2. Scan archive WAL files (current pg_arman). If you have high load it is not oyur choice too. (Big databases rarely living without high load.)

  3. Pages are tracked using bitmap during runtime, so the needed ones can be easily dumped. (Oracle and my ptrack (patches for postgres and pg_arman)) It's really your choice.

@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active July 27, 2024 16:49 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@ibussieres
ibussieres / upgrade_pg.sh
Last active May 26, 2021 04:29
Upgrade PostgreSQL 9.1 to 9.3 on Ubuntu 12.04
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
sudo su - postgres -c "service postgresql stop"
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"'
@fnichol
fnichol / README.md
Last active January 20, 2019 13:32
(Excellent?) Format Changes to Test Kitchen's kitchen.yml

Format Changes to Test Kitchen's kitchen.yml File

This is happening thanks to a refactoring of the data manipulation code formerly in Kitchen::Config.

There are now 3 main configuration blocks that can be placed in the various levels:

  • driver: Configurtation relavent to Kitchen drivers. This is a combination of what was driver_plugin and driver_config. Backwards compatability is guarenteed with the legacy formats for a time, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • provisioner: Configuration relating to the automation tool being used. Currently supporting "chef_solo" and "chef_zero". Previously several Chef-related config paths were dumped in a Suite block, namely data_path, data_bags_path, environments_path, nodes_path, roles_path, etc. These will be supported for backwards compatability, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • busser: Configuration rela
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)