Skip to content

Instantly share code, notes, and snippets.

@dcmbrown
dcmbrown / resetting-csync2-cluster.md
Created October 25, 2021 20:28 — forked from scottsb/resetting-csync2-cluster.md
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@dcmbrown
dcmbrown / gmail-github-filters.md
Created October 25, 2021 18:04 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed AROUND 1 commit" "pushed AROUND 2 commits"}

label: gh-pull-request

@dcmbrown
dcmbrown / fingerprint_function.md
Last active November 13, 2023 18:04
fingerprint ssh keys - something which happens all too regularly

Get your ssh key finger print

This function is useful when you need to know the fingerprint of your ssh keys because you have too many keys across too many systems or you're verifying your key use against a particular system/service.

Add this to your .bashrc/.bash_profile/.profile or whereever you keep your shell functions. Works in bash, have not verified use in zsh, csk, ksh, fish, etc.

# fingerprint an ssh key
function fingerprint(){
    if [ $# -eq 0 ]; then

echo "usage: fingerprint [md5|sha256] "

@dcmbrown
dcmbrown / difftree
Last active September 27, 2021 16:17
Bash function to differentiate the contents of the current directory with another. Creates folder of diffs in ~/difftree/<dirname>
# diff the files in any two directories
function difftree ()
{
if [ $# -eq 0 ]; then
echo "DIFFTREE - Be in the source directory to compare."
echo " usage: difftree <path to directory to compare to>"
return 1
fi
here=`pwd`
@dcmbrown
dcmbrown / varnishlog.md
Last active November 13, 2023 18:06
Varnish Logging (v3.x, 4.x) of real OR x-forwarded-for IPs behind a load balancer or proxy

Varnish Logging (v3.x+) of real OR x-forwarded-for IPs behind a load balancer or proxy

This works under init.d on CentOS. Some modification be required to file locations for other distributions or systemd.

In your /etc/varnish/default.vcl file:

Before all else:

    import std;
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'