Skip to content

Instantly share code, notes, and snippets.

@damonmaria
damonmaria / cognitoAwsCredentials.js
Last active May 31, 2021 10:13
Keeping Cognito user pool and AWS tokens refreshed in browser, symptoms if you need this is the error: "Invalid login token. Token expired: 1446742058 >= 1446727732"
import AWS from 'aws-sdk/global'
import eventEmitter from 'event-emitter'
import differenceInMilliseconds from 'date-fns/difference_in_milliseconds'
import minDate from 'date-fns/min'
// Set this to match your setup
const env = {
awsRegion: XXXX,
identityPoolId: XXXX,
userPoolId: XXXX,
$ sudo puppet agent --test --debug
Debug: Applying settings catalog for sections main, agent, ssl
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:path=>"/etc/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
@damonmaria
damonmaria / foreman-install.sh
Last active September 6, 2019 18:02
Foreman 1.23 install with separate puppet server
# Start with puppet-install.sh first
export PUPPET_FQDN=puppet.example.com
sudo groupadd puppet # Otherwise error during install
sudo foreman-installer \
--no-enable-foreman-proxy \
--puppet-server false \
--puppet-puppetmaster ${PUPPET_FQDN}