Skip to content

Instantly share code, notes, and snippets.

@kenyon
kenyon / packages.rb
Last active February 9, 2023 14:12
# Puppet Facter custom fact. Return a list of packages installed on
# the system as a hash, mapping the package name to the version.
# © 2018 Kenyon Ralph
# SPDX-License-Identifier: GPL-3.0-or-later
Facter.add(:packages) do
setcode do
packages = {}
case Facter.value(:os)['family']
@natemccurdy
natemccurdy / PE_API_Reference.md
Last active October 9, 2023 20:25
PE API Reference and Notes
@mortenson
mortenson / composelist.sh
Last active November 5, 2023 13:38
List all Docker Compose projects currently running
#!/bin/bash
docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| sort | uniq
@Cinderhaze
Cinderhaze / output
Created October 15, 2016 15:43
How to pretty-print hashes and arrays for puppet debugging
ubuntu@ubuntu:~$ puppet apply pretty.pp [12/46]
Notice: Scope(Class[main]): {one => 1, two => [dos, 2]}
Notice: Scope(Class[main]):
{
"one": "1",
"two": [
"dos",
"2"
]
}
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@natemccurdy
natemccurdy / manual_code_deploy.sh
Last active April 19, 2024 13:21
Manually trigger code-manager and file-sync
#!/bin/bash
# GIST_URL: https://gist.github.com/natemccurdy/797fa9128b7eef1f07be
# This script can be run to manually trigger Code Manager to deploy code from your control-repo. This sort of
# thing is neccesary when, for example:
# - You've turned on Code Manager but have not yet made an RBAC token.
# - You want to pull down the latest version of a Puppetfile module without pushing to your GMS.
# - Something has broken the post-receive hook on your GMS that would've triggered Code Manager.
# - Syntax errors in your Puppetfile prevent you from retrieving those fixes to that Puppetfile.
# - Puppetserver has crashed due to file-sync issues between code and code-staging.
# - Code Manager can't deploy your code for various reasons that are hard to track down.

Keybase proof

I hereby claim:

  • I am kenyon on github.
  • I am kenyon (https://keybase.io/kenyon) on keybase.
  • I have a public key whose fingerprint is 6166 B557 BF04 3923 AC22 6183 98FF 3EF9 C9B9 12D5

To claim this, I am signing this object:

@zxteloiv
zxteloiv / fix-right-alt.reg
Created February 28, 2013 14:39
fix right alt to the same as left alt, under putty
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00