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',
~% netstat -rn -f inet
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.3.1 UGSc 74 144 en1
10.8/24 10.8.0.5 UGSc 1 0 tun0
10.8.0.5 10.8.0.6 UH 5 0 tun0
25 link#10 UC 2 0 ham0
25.255.255.255 ff:ff:ff:ff:ff:ff UHLWbI 0 4 ham0
@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 / Jenkinsfile
Last active July 23, 2018 00:55
Jenkins Pipeline with matrix testing
node {
stage 'Checkout'
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git'
stash "${env.JOB_NAME}"
stage: 'Test'
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
// short SHA, possibly better for chat notifications, etc.
shortCommit = gitCommit.take(6)
sh "echo $shortCommit"
def matrix = [:]
@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