Instantly share code, notes, and snippets.
- NYC
- 23:17
(UTC -04:00) - in/alexanderdupuy
dupuy /gist:a5326ccecd62a9ffc0a5
Last activeAugust 29, 2015 14:17 — forked fromkchida/gist:d1c15f3968f4f8272c49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
- What do Etcd, Consul, and Zookeeper do? | |
- Service Registration: | |
- Host, port number, and sometimes authentication credentials, protocols, versions | |
numbers, and/or environment details. | |
- Service Discovery: | |
- Ability for client application to query the central registry to learn of service location. | |
- Consistent and durable general-purpose K/V store across distributed system. | |
- Some solutions support this better than others. | |
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state. | |
- Centralized locking can be based on this K/V store. |
dupuy /expired.pl
CreatedFebruary 13, 2015 11:40
Perl script to report on password and account expirations from /etc/shadow (Linux) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use POSIX'strftime'; | |
use constantDATEFMT=>"%Y-%m-%d"; | |
use constantSHADOWFILE=>"/etc/shadow"; | |
use constantDAYSECS=> 60 * 60 * 24; | |
subdatefmt($) | |
{ |
dupuy /git-pre-receive-hook.sh
CreatedJuly 24, 2014 21:08 — forked fromcaniszczyk/git-pre-receive-hook.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# For each ref, validate the commit. | |
# | |
# - It disallows deleting branches without a /. | |
# - It disallows non fast-forward on branches without a /. | |
# - It disallows deleting tags without a /. | |
# - It disallows unannotated tags to be pushed. |
dupuy /Dumper.py
Last activeJanuary 5, 2017 03:02 — forked fromkarelin/Dumper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
""" | |
A perl Data.Dumper clone for Python | |
Author: simon@log4think.com | |
2011-07-08 | |
""" | |
#!/bin/env python | |
importsys | |
fromtypesimport* |
dupuy /gist:5418227
Last activeDecember 16, 2015 10:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install better common utilities | |
# | |
# Copyright (c) 2012 Barry Allard <barry.allard@gmail.com> | |
# | |
# Also available at: https://gist.github.com/3452111 | |
# UDF template for including in other scripts |