Skip to content

Instantly share code, notes, and snippets.

View Magisus's full-sized avatar

Maggie Dreyer Magisus

  • Puppet, Inc.
  • Portland, OR
View GitHub Profile
@Magisus
Magisus / external-ca
Last active September 10, 2018 23:06
1) Create self-signed root CA cert
2) Create CSR for intermediate CA cert
3) Sign with root
4) Create CRL for root
5) Create CRL for intermediate
6) Concatenate intermediate cert and root cert into one file (e.g. bundle.pem), intermediate first
7) Concatenate intermediate CRL and root CRL into one file (e.g. crls.pem), intermediate first
To import:
puppetserver ca import --cert-bundle bundle.pem --crl-chain crls.pem --private-key intermediate-key.pem
Ruby 2.5.1 #1
> total: 22.252030 0.735889 22.987919 ( 23.713942)
> avg: 2.225203 0.073589 2.298792 ( 2.371394)
Ruby 2.5.1 #2
> total: 18.067680 0.557513 18.625193 ( 18.682405)
> avg: 1.806768 0.055751 1.862519 ( 1.868240)
Ruby 2.5.1 #3
> total: 18.897436 0.629799 19.527235 ( 19.696831)
#!/usr/bin/bash
# On a centos7 VM from the pooler.
# Install PE
latest_pe=$(curl http://neptune.puppetlabs.lan/2019.1/ci-ready/LATEST)
curl -O "http://neptune.puppetlabs.lan/2019.1/ci-ready/puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
tar xvf "puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
pushd "puppet-enterprise-${latest_pe}-el-7-x86_64"
@Magisus
Magisus / analytics_test.sh
Last active August 6, 2020 20:29
Test dujour setup
# On a Centos 7 pooler VM
# Install PE
latest_pe=$(curl https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/master/ci-ready/LATEST)
curl -O "https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/master/ci-ready/puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
tar xvf "puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
pushd "puppet-enterprise-${latest_pe}-el-7-x86_64"
# This will prompt you with the normal installer prompts
./puppet-enterprise-installer
require 'puppet'
require 'puppet/parser'
require 'json'
require 'google/cloud/bigquery'
require 'zlib'
require 'rubygems/package'
require 'pry'
ENV["BIGQUERY_PROJECT"] = "platform-dujour-dev"
ENV["BIGQUERY_CREDENTIALS"] = "/Users/aileen/code/platform-dujour-dev.json"
require 'openssl'
# To use this script to generate a CRL, supply the path to the cert
# PEM file, followed by the key PEM file, followed by the output path
# for the CRL.
#
# Example:
# ruby generate_crl.rb ca_crt.pem ca_key.pem new_crl.pem
#
# The resulting CRL should be concatenated into a file with the other
require 'puppet/server/master'
require 'securerandom'
require 'json'
require 'uri'
class PuppetServerHelper
# alternatively: load 'spec/lib/puppet_spec/handler'; profiler = PuppetSpec::HandlerProfiler.new ????
NullProfiler = Struct.new("Profiler") do
def start(*args); end
@Magisus
Magisus / stacktrace.txt
Last active November 6, 2019 21:03
Hung Catalog compile thread
qtp1022017974-89798
at com.kenai.jffi.Foreign.invokeL3(JJJJJ)J (Native Method)
at com.kenai.jffi.Invoker.invokeL3(Lcom/kenai/jffi/CallContext;JJJJ)J (Invoker.java:407)
at jnr.enxio.channels.Native$LibC$jnr$ffi$1.poll(Ljava/nio/ByteBuffer;II)I (Unknown Source)
at jnr.enxio.channels.PollSelector.poll(J)I (PollSelector.java:226)
at jnr.enxio.channels.PollSelector.select()I (PollSelector.java:205)
at org.jruby.RubyThread.select(Ljava/nio/channels/Channel;Lorg/jruby/util/io/OpenFile;IJ)Z (RubyThread.java:1797)
at org.jruby.RubyThread.select(Ljava/nio/channels/Channel;Lorg/jruby/util/io/OpenFile;I)Z (RubyThread.java:1718)
at org.jruby.util.io.OpenFile.waitReadable(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/util/io/ChannelFD;)Z (OpenFile.java:1414)
at org.jruby.util.io.OpenFile.ioBufread(Lorg/jruby/runtime/ThreadContext;[BII)I (OpenFile.java:1724)
@Magisus
Magisus / enable_code_manager.txt
Last active March 21, 2022 22:48
Enable Code Manager
Steps to enable Code Manager on a VMPooler node
1. Install PE
2. Generate an SSH key to use with Github and add it to your Github
3. Control repo: https://github.com/Magisus/control-repo -> [email protected]:Magisus/control-repo.git
4. Set params of puppet_enterprise::profile::master:
- code_manager_auto_configure: true
- r10k_remote: [email protected]:Magisus/control-repo.git
- r10k_private_key: point at key created above, e.g. "/etc/puppetlabs/puppetserver/ssh/id_rsa-control"
5. Run puppet agent
https://github.com/jruby/jruby/pull/5584/commits/bb90d3b7644316f8ae6b92e02defdf3838854fb5
1. Make changes to JRuby source
2. Update VERSION file to SNAPSHOT version
3. Run `./mvnw` to build jars and install them to local maven repo
4. Update jruby version in `jruby-deps` to new SNAPSHOT.
5. Update `jruby-deps` version in `jruby-utils`.
6. Update `jruby-utils` version in puppetserver.
7. Run repl.