Skip to content

Instantly share code, notes, and snippets.

# Consul Deployment Guide

This deployment guide covers the steps required to install and configure a single HashiCorp Consul cluster as defined in the Consul Reference Architecture.

Below are instructions for installing and configuring Consul on Linux hosts running the systemd system and service manager.

Reference Material

This deployment guide is designed to work in combination with the Consul Reference Architecture. Although not a strict requirement to follow the Consul Reference Architecture, please ensure you are familiar with the overall architecture design; for example installing Consul on multiple physical or virtual (with correct anti-affinity) hosts for high-availability.

@letsrokk
letsrokk / Jenkinsfile
Last active September 13, 2023 14:56
Allure Summary Email using Email-ext Jenkins Plugin
node {
stage('Test') {
//... test execution steps
}
stage('Build report'){
allure includeProperties: false, jdk: '', results: [[path: 'target/allure-results']]
}
stage('Send Summary'){
emailext body: '''${SCRIPT, template="allure-report.groovy"}''',
subject: "[Jenkins] Test Execution Summary",
#may need to update local branches fist
git remote update origin --prune
# get all branches that are merged into release
# remove the origin/ prefix
# make sure we don't delete release, develop and HEAD branches
# remove them
git branch -r --merged origin/release | sed 's/origin\///' | grep -vwE "(develop|HEAD|release)$" | xargs -n 1 git push origin --delete
#for develop
@bbengfort
bbengfort / gitseries.py
Last active August 3, 2025 20:02
Iterate through all commits and yield file version information or a time series of file changes.
## Imports
import os
import git
## Module Constants
DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@rlee287
rlee287 / pre-commit.sh
Last active March 29, 2021 16:50
Short git pre-commit hook to remove BOM headers
#!/bin/sh
#
# A hook script to remove BOM headers
echo "Running pre-commit BOM removal"
trap ctrl_c INT
ctrl_c ()
{
@chinshr
chinshr / Jenkinsfile
Last active May 20, 2025 13:10
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@donnfelker
donnfelker / OrderActivity.java
Last active November 22, 2019 23:46
RxJava Bound Service AIDL Abstraction
package com.donnfelker.rxexample;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@varemenos
varemenos / 1.README.md
Last active October 9, 2025 17:15
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
from array import array
import bisect
import struct
import operator
import sys
class WordList(object):
def __init__(self, words):
self.buf = "".join(words)
self.offsets = array("L", [0])