Skip to content

Instantly share code, notes, and snippets.

@op-ct
op-ct / firefox-shortcut-keys.html
Created June 17, 2026 17:38
Firefox URL Shortcut Keys (importable Firefox bookmarks file)
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1623447084" LAST_MODIFIED="1781106531">Shortcut Keys</H3>
<DL><p>
<DT><A HREF="https://forge.puppet.com/modules?q=%s" ADD_DATE="1659632114" SHORTCUTURL="pfq" TAGS="forge,keyword search,puppet">https://forge.puppet.com/modules?q=</A>
<DT><A HREF="https://forge.puppet.com/%s" ADD_DATE="1659632245" SHORTCUTURL="pf" TAGS="forge,keyword search,puppet">https://forge.puppet.com/</A>
@op-ct
op-ct / extract_bookmarks_folder.rb
Created June 17, 2026 17:37
Extract a named bookmarks folder from a Firefox backup .json into an importable Firefox bookmarks .html file.
#!/usr/bin/env ruby
# Extract a Firefox bookmark folder by name and write Netscape HTML for import.
require 'json'
require 'cgi'
TYPE_BOOKMARK = 1
TYPE_FOLDER = 2
def find_folder(node, title)
@op-ct
op-ct / .bash_functions
Last active June 24, 2026 15:56
dotfile snippets
# FIXME: substitute UPSTREAM and GITHUB_USER with local values
# clone from UPSTREAM org by bare repo name and UPSTREAM remote (https), add GITHUB_USER remote (ssh) for pushes
UPSTREAMclone() {
local repo="$1" dir="${2:-$1}"
git clone "https://github.com/UPSTREAM/${repo}.git" -o UPSTREAM "$dir" \
&& cd "$dir" \
&& git remote add GITHUB_USER "git@github.com:GITHUB_USER/${repo}.git"
}
@op-ct
op-ct / rpm2metadata_json.rb
Created March 20, 2023 21:47
Quick & dirty RELENG check to fix/check for discrepancies between simp.spec deps and simp/simp_core's metadata.json
#!/opt/puppetlabs/bolt/bin/ruby
def get_rpm_spec_core(rpm_spec)
rpm_spec_core = {
requires: [],
obsoletes: [],
}
rpm_spec.select!{ |x| x =~ /^(Requires:|Obsoletes:|# Core SIMP Requirements|# SIMP Extras)/ }
in_core = false
rpm_spec.each do |x|
@op-ct
op-ct / REMINDER.md
Last active July 28, 2022 02:02
Manually register r10k GitLab runner with custom CA certs

PUSH gitlab_inventory UPDATES!

@op-ct
op-ct / _slim_repos.build-6-6-0-centos-8-x86-64-repo-packages.reposync.sh
Created October 21, 2021 14:50
Reposync experimental EL8 SIMP dev repos
#!/bin/sh
# On EL7, ensure:
# yum install -y dnf dnf-plugins-core
#
set -eu
# Useful EL8-only options: --remote-time --norepopath
PATH_TO_LOCAL_MIRROR="$PWD/_download_path/build-6-6-0-centos-8-x86-64-repo-packages"
mkdir -p "$PATH_TO_LOCAL_MIRROR"
dnf reposync \
@op-ct
op-ct / test_lookup.sh
Last active October 1, 2021 05:08
Test Puppet lookups from a local control repo
#!/bin/bash
/opt/puppetlabs/bolt/bin/puppet lookup \
--compile \
--explain \
--basemodulepath $PWD/site:/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.17.0/modules \
--hiera_config $PWD/spec/hiera.yaml \
--environment production \
--environmentpath .onceover/etc/puppetlabs/code/environments \
--pluginfactdest "$PWD/facts.d" \
--log_level debug \
@op-ct
op-ct / onceover.rake
Created September 14, 2021 17:48
Rake tasks to help set up onceover spec tests
# frozen_string_literal: true
# These tasks help revionics use onceover to validate their manifests and data
#
# To prep and run onceover spec tests, run:
#
# bundler exec rake spec
#
namespace :onceover do
desc 'Install modules from Puppetfile, using private Puppet Forge'
@op-ct
op-ct / RPM-GPG-KEY-SIMP-UNSTABLE-2.gpg.asc
Last active June 25, 2021 16:37
SIMP Unstable GPG Key 2 (TESTING ONLY - NOT FOR PRODUCTION USE)
# SIMP Unstable GPG Key 2 (TESTING ONLY - NOT FOR PRODUCTION USE)
#
# NOTE: key is 3072 bit, but much smaller than previous keys
# because it is for signing ONLY, with no encryption subkeys
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGDTtTEBDAD5IhusLJZQhJ2CzzxXmY36fNEb8OUeahNpy5n8Ho/lyyZsfb2U
gfLYymQAdnIsKUk7AER3p4XRbV+AbxDlb25pbxWs6KaVLzXSgSw4VPyN50fDmVgu
cmTyso/ZFdFlGgdOtM2IoKWRM1/qt0SlaXDI5nTFQRINkFFfYwKci7P45c6L6G2e
@op-ct
op-ct / pupcat.rb
Last active September 29, 2020 20:57 — forked from happymcplaksin/pupcat.rb
pupcat.rb
#!/usr/bin/ruby
require 'rubygems'
require 'json'
require 'yaml'
user = ARGV[0] || %x{id -u -n}.strip
if user == 'root'
dir = '/opt/puppetlabs/puppet/cache/client_data/catalog/'