Skip to content

Instantly share code, notes, and snippets.

View cdenneen's full-sized avatar

Chris Denneen cdenneen

  • New York
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cdenneen on github.
  • I am cdenneen (https://keybase.io/cdenneen) on keybase.
  • I have a public key ASArhsWECjTdFLaIZ-RT1wEl2O--tMHg3T1oUAI3ImiAhgo

To claim this, I am signing this object:

@cdenneen
cdenneen / hyper.js
Created January 28, 2020 20:35
Hyper 3.0.2 config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@cdenneen
cdenneen / elasticsearch.pp
Created October 19, 2018 15:12
ES testing
# @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 June 26, 2018 03:19 — forked from rodjek/fact_spec.rb
Facter stubbing examples
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 June 8, 2018 15:07
RSpec stubbing out a file
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 18:41
Ordering issue
# @summary
# Private class for configuring sensu
#
# @api public
#
# @param server
# @param rabbitmq_host
# @param rabbitmq_password
# @param rabbitmq_vhost
# @param subscriptions
---
.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 March 1, 2018 15:47 — 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

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)
  3. Change UsePrivilegeSeparation to no
@cdenneen
cdenneen / jenkinsjob.groovy
Last active February 23, 2018 18:44
Jenkins parse json
//@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
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