Skip to content

Instantly share code, notes, and snippets.

@sonodar
sonodar / get_ssm_parameters.js
Last active April 3, 2024 06:24
Get secret parameters from Amazon EC2 Parameter Store
if (process.argv.length < 3) {
throw `Usage: ${process.argv[1]} path_prefix`
}
const PATH_PREFIX = process.argv[2]
const path = require('path')
const AWS = require('aws-sdk')
const ssm = new AWS.SSM()
function getParametersByPath(nextToken, callback) {
@tnolet
tnolet / puppetdb_postgres_hacks.md
Last active June 27, 2024 22:28
PuppetDB is awesome. Here's some tips on accessing the data in the Postgresql database...most of 'm just reminders for myself.

NB: The following examples where done on Puppet Enterprise 3.0 running on Centos 6. Should be similar for open source versions, except for some file locations.

1. Logging into the PuppetDB PostgresQL database on Linux

The easiest way to snoop around in de actual PuppetDB postgres database is using the command prompt. You have to be the peadmin user though. Couldn't get it working just under root.

[root@master bin]# sudo su - pe-postgres -s /bin/bash
-bash-4.1$ /opt/puppet/bin/psql
psql (9.2.4)

Type "help" for help.

@rodjek
rodjek / sync_puppet_plugins.rb
Created December 14, 2011 01:30
Manual puppet pluginsync
#!/usr/bin/env ruby
require 'puppet'
require 'puppet/configurer'
Puppet.settings.parse
c = Puppet::Configurer.new
c.download_plugins
c.download_fact_plugins
@josch
josch / debconf-selections.txt
Created November 11, 2011 09:49
debconf installer preseed
# Services to use:
# Choices: security updates (from security.debian.org), volatile updates (from volatile.debian.org)
apt-setup-udeb apt-setup/services-select multiselect
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Check the integrity of another CD-ROM?
d-i cdrom-checker/nextcd boolean false
# Install GRUB?
grub-installer grub-installer/grub_not_mature_on_this_platform boolean false
@ccaum
ccaum / post-merge.rb
Created August 19, 2011 21:57
Git Post Merge Script
#!/usr/bin/env ruby
require 'rubygems'
require 'puppet'
require 'puppet/face'
require 'puppet/cloudpack'
options = {
:image => 'ami-3d76b754',
:type => 'm1.large',