Skip to content

Instantly share code, notes, and snippets.

Brett brettswift

Block or report user

Report or block brettswift

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brettswift
brettswift / partial_code_for_construct.ts
Created Oct 7, 2019
CDK 1.10.1 - ASG Cloudformation Init example
View partial_code_for_construct.ts
const ASG_NAME = "TestAsg"
const asg = new autoscaling.AutoScalingGroup(this, ASG_NAME, {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
keyName: keypairSsm.stringValue, // cdk ssm.StringParameter, optionally replace with the keypair name as a string
vpc: vpc, //defined outside this gist
machineImage: new ec2.AmazonLinuxImage({
generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
}),
cooldown: cdk.Duration.seconds(300),
@brettswift
brettswift / hieradata.yaml
Last active Mar 22, 2016
nested hiera lookup
View hieradata.yaml
group_allocation:
devcoreoeml030.matrix.sjrb.ad: smokestack
devcorebrml030.matrix.sjrb.ad: smokestack
devcoreesbl030.matrix.sjrb.ad: smokestack
devcoreoeml091.matrix.sjrb.ad: the091
devcorebrml091.matrix.sjrb.ad: the091
devcoreesbl091.matrix.sjrb.ad: the091
devcorepptl003.matrix.sjrb.ad: dev_master
tstcorepptl003.matrix.sjrb.ad: tst_master
devcorepptl918.matrix.sjrb.ad: brett_sandbox
@brettswift
brettswift / ec2box.info
Created Feb 12, 2016
beaker ec2 module not found
View ec2box.info
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/
total 8
drwxr-xr-x. 7 root root 4096 Feb 12 15:57 shaw_firewall
drwxr-xr-x. 6 root root 4096 Feb 12 15:56 stdlib
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/shaw_firewall/
total 32
-rw-r--r--. 1 root root 210 Feb 12 15:57 beaker_docker_tips
-rw-r--r--. 1 root root 265 Feb 12 15:57 CHANGELOG
drwxr-xr-x. 2 root root 4096 Feb 12 15:58 ci
View r10k result
INFO -> Deploying environment /etc/puppetlabs/code/hostdata/hotfix_matrix037
INFO -> Deploying environment /etc/puppetlabs/code/hostdata/live
ERROR -> wrong argument type nil (expected String)
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/rugged-0.21.4/lib/rugged/repository.rb:33:in `[]'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/rugged-0.21.4/lib/rugged/repository.rb:33:in `checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/working_repository.rb:69:in `block in checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/base_repository.rb:46:in `with_repo'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/working_repository.rb:68:in `checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/thin_repository.rb:51:in `checkout'
@brettswift
brettswift / accounts::init.pp
Created Oct 16, 2015
Puppet Accounts module
View accounts::init.pp
class accounts (
$virtual_accounts = {},
$defaults = {},
) {
$realize = hiera_array('accounts')
group { 'sudo-dev':
ensure => present,
gid => 514,
@brettswift
brettswift / pe_migration_3-3_to_3-8.sh
Created Jun 11, 2015
Puppet cert migration from 3.3 to 3.8
View pe_migration_3-3_to_3-8.sh
#Note: those with a gap between, run them individually (ie you may not want to copy multiple lines if there are spaces. Prompts will prevent subsequent lines from being pasted)
#Part 1 - Allow remote ssh commands to old puppet master
# comment out "Defaults requiretty" in /etc/sudoers on the 'old' puppet master to enable remote scripting. :)
#Part 2 follow this walkthrough: http://docs.puppetlabs.com/pe/latest/trouble_regenerate_certs_monolithic.html
#Walkthrough Step 1: Shut down all PE-related services
puppet resource service pe-puppet ensure=stopped
puppet resource service pe-puppetserver ensure=stopped
@brettswift
brettswift / Vagrantfile
Created Jul 5, 2014
vagrant rackspace error: "No host IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug."
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define :suite_brettswift_com do |nodeserver|
config.vm.provider :rackspace do |rs, override|
override.vm.box = "rackspace"
override.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
rs.username = "#{ENV['RACKSPACE_USERNAME']}"
@brettswift
brettswift / gist:2002200
Created Mar 8, 2012
brew install gource bug
View gist:2002200
bash local $ brew install -v gource
==> Cloning https://github.com/acaudwell/Gource.git
Updating /Users/bswift/Library/Caches/Homebrew/gource--git
git remote set-url origin https://github.com/acaudwell/Gource.git
git fetch origin
git fetch --tags
==> Checking out tag gource-0.37
git checkout gource-0.37
HEAD is now at 1e12d58... Check for unsetenv.
You can’t perform that action at this time.