Skip to content

Instantly share code, notes, and snippets.

Chris Denneen cdenneen

  • New York
Block or report user

Report or block cdenneen

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
View elasticsearch.pp
# @summary
# elasticsearch profile
#
# @param es_instances
# @param instance_ports
#
class profile::elasticsearch(
Array[String] $es_instances = ['master', 'data'],
Array[Integer] $instance_ports = [9200, 9300, 9201, 9301],
) {
@cdenneen
cdenneen / fact_spec.rb
Last active Jun 26, 2018 — forked from rodjek/fact_spec.rb
Facter stubbing examples
View fact_spec.rb
require 'rspec'
require 'facter'
describe 'facter_value' do
context 'when stubbing Facter::Util::Collection#fact' do
before(:each) do
stub_fact = instance_double(Facter::Util::Fact, :value => 'foo')
allow(Facter.collection).to receive(:fact).with(:test_fact).and_return(stub_fact)
end
@cdenneen
cdenneen / master.pp
Created Jun 8, 2018
RSpec stubbing out a file
View master.pp
class profile::master {
file { '/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa':
ensure => file,
owner => 'pe-puppet',
mode => '0600',
content => file('/etc/puppetlabs/id-control_repo.rsa'),
}
}
@cdenneen
cdenneen / sensu.pp
Created May 24, 2018
Ordering issue
View sensu.pp
# @summary
# Private class for configuring sensu
#
# @api public
#
# @param server
# @param rabbitmq_host
# @param rabbitmq_password
# @param rabbitmq_vhost
# @param subscriptions
View .gitlab-ci.yml
---
.cache_bundler: &cache_bundler
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- '.vendor'
- 'vendor'
.setup_bundler_env: &setup_bundler_env
@cdenneen
cdenneen / WSL-ssh-server.md
Created Mar 1, 2018 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux
View WSL-ssh-server.md

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Uninstall and reinstall the ssh server using the following commands:
    1. sudo apt remove openssh-server
    2. sudo apt install openssh-server
  2. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change UsePrivilegeSeparation to no
@cdenneen
cdenneen / jenkinsjob.groovy
Last active Feb 23, 2018
Jenkins parse json
View jenkinsjob.groovy
//@NonCPS
def parseText(txt){
return new groovy.json.JsonSlurperClassic().parseText(txt)
}
node ('master') {
variables = parseText(new File('/tmp/test.json').text)
// this works
def out = variables.dne.prod.dashboard.stacknameprefix
View output.txt
BEAKER_RUN_IN_PARALLEL=configure,install BEAKER_debug=yes BEAKER_set="docker" PUPPET_INSTALL_TYPE="agent" PUPPET_INSTALL_VERSION="1.10.1" BEAKER_destroy="yes" BEAKER_provision="yes" bundle exec rake beaker
Warning: Puppet's internal vendored libraries are Private APIs and can change without warning. The 'semantic' library has been replaced with 'semantic_puppet'.
/opt/rubies/2.1.8/bin/ruby -I/Users/cdenneen/src/gitlab/zipiapi-puppet/.bundle/gems/rspec-core-3.6.0/lib:/Users/cdenneen/src/gitlab/zipiapi-puppet/.bundle/gems/rspec-support-3.6.0/lib /Users/cdenneen/src/gitlab/zipiapi-puppet/.bundle/gems/rspec-core-3.6.0/exe/rspec spec/acceptance --color
/Users/cdenneen/src/gitlab/zipiapi-puppet/.bundle/gems/beaker-rspec-6.1.0/lib/beaker-rspec/helpers/serverspec.rb:43: warning: already initialized constant Module::VALID_OPTIONS_KEYS
/Users/cdenneen/src/gitlab/zipiapi-puppet/.bundle/gems/specinfra-2.68.0/lib/specinfra/configuration.rb:4: warning: previous definition of VALID_OPTIONS_KEYS was here
Hypervisor for cento
@cdenneen
cdenneen / Jenkinsfile
Created May 8, 2017
Nested Pipeline Matrix
View Jenkinsfile
#!/usr/bin/groovy
@Library('github.com/cdenneen/jenkins-shared@master') _
node {
deleteDir()
stage 'Checkout'
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git'
def stashName = "${env.JOB_NAME}_${env.BUILD_NUMBER}"
stash stashName
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
// short SHA, possibly better for chat notifications, etc.
@cdenneen
cdenneen / Jenkinsfile
Last active May 5, 2017
Pipeline testing
View Jenkinsfile
node {
deleteDir()
stage 'Checkout'
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git'
// def stashName = "${env.JOB_NAME}_${env.BUILD_NUMBER}"
// stash stashName
// stage 'Test'
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
// short SHA, possibly better for chat notifications, etc.
shortCommit = gitCommit.take(6)
You can’t perform that action at this time.