Skip to content

Instantly share code, notes, and snippets.

@chris-belcher
chris-belcher / JMalert.md
Last active May 31, 2023 05:07
JoinMarket release 0.2.0 ameliorates this snooping attack.

Intermediate CA Signing with Puppet

Problem statement

Many sites have a requirement to use an enterprise-wide certificate authority. They either have a "real" signing cert that chains to a public root CA or an internal root (usually air-gapped) which only signs issuing CA certificates, one per PKI application.

Puppet does not have a currently supported configuration which fits into this model. The [existing documentation][existing] describes using an "external CA" instead of Puppet's internally generated CA (which is a combined self-signed Root and issuing CA in one), but requires that the user turn off Puppet's issuance code and leaves the whole certificate generation and distribution workflow as an "exercise to the reader".

The procedure in this document describes a supportable configuration which bridges the gap between these two positions: it is possible to use Puppet's internal signing code to issue certificates from an intermediate CA cert which was externally generated and signed. There are a

@cangoal
cangoal / LargestBSTSubtree.java
Created April 21, 2016 00:32
LeetCode - Largest BST Subtree
// Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it.
// Note:
// A subtree must include all of its descendants.
// Here's an example:
// 10
// / \
// 5 15
// / \ \
// 1 8 7
@nukemberg
nukemberg / facter-inventory.json
Created April 7, 2016 23:52
Elasticsearch index template for ELK based facter/puppet inventory
{
"template": "inventory",
"mappings": {
"host": {
"_source": {
"enabled": true,
"excludes" : ["network.interfaces.*.arp", "kernel.pnp_drivers", "kernel.modules"]
},
"dynamic_templates": [
{
usa_00002.dat
usa_00002.dat.gz
usa_000002.csv
filtered.csv
@moollaza
moollaza / WordCount.pm
Last active March 26, 2017 19:39
DuckDuckHack Webcast - Making a "Wordcount" Goodie Instant Answer with JavaScript & Templates
package DDG::Goodie::WordCount;
use DDG::Goodie;
use strict;
zci answer_type => 'word_count';
zci is_cached => 1;
triggers start => 'word count', 'wordcount', 'how many words in';
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
// ==UserScript==
// @name Grab HB keys
// @namespace org.chloetigre.perso
// @description Grab game keys from a humble bundle page
// @include https://www.humblebundle.com/home/keys
// @version 1
// @grant none
// ==/UserScript==
var hbkeys = {
};
@burtonsamograd
burtonsamograd / nock.lisp
Created October 9, 2015 02:48
A Nock Interpreter and Compiler in Common Lisp #Urbit
;; A nock interpreter
(defun tar (a f)
(labels ((fas (b a)
(declare (integer b))
(cond
((= b 1) a)
((= b 2) (car a))
((= b 3) (cdr a))
((evenp b) (car (fas (/ b 2) a)))
((oddp b) (cdr (fas (/ (1- (the integer b)) 2) a))))))
@connerbrooks
connerbrooks / plan9.md
Last active April 8, 2017 16:47
Using Plan9