Skip to content

Instantly share code, notes, and snippets.

@larryebaum
larryebaum / Chef Port Requirements
Created February 20, 2015 18:09
Chef: Ports Requirements for Training
22 (SSH/SCP)
80 (HTTP)
81 (HTTP ALT)
443 (HTTPS)
5985 (WINRM)
5986 (WINRM)
3389 (RDP)
8080 (HTTP ALT)
8081 (HTTP ALT)
#WINDOWS Knife Example Content
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "chef_user_here"
client_key "#{ENV['HOME']}/.chef/chef_client_here.pem"
validation_client_name "organization_here-validator"
validation_key "#{ENV['HOME']}/.chef/organization_here-validator.pem"
chef_server_url "https://api.opscode.com/organizations/organization_here"
@larryebaum
larryebaum / chef_local_development_workflow.md
Created November 30, 2016 22:19 — forked from smford22/chef_local_development_workflow.md
Chef Local Development Workflow - ChefDK, Vagrant, VirtualBox, Test Kitchen

Chef Local Development Workflow with ChefDK, Vagrant, VirtualBox, and Test Kitchen

Overview

The following document is intended to be a quick guide to getting you setup for doing local development with Chef. This guide was created on my MacBook, but should work fine with Linux, and Windows workstations as well.

Quick review on fundamental tenets of Chef

  • Workstation - A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery
  • Node - A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.
  • Chef Server- The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered
@larryebaum
larryebaum / AuditConfig.html
Last active June 9, 2017 18:17
Audit Cookbook Configuration Cheatsheet
<!-- Sourced from http://htmlpreview.github.io/?https://github.com/jeremymv2/audit-docs/blob/master/grid.html-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
@larryebaum
larryebaum / README.md
Last active September 26, 2017 20:55 — forked from afiune/README.md
Automate LDAP Bulking User Creation

LDAP Bulking User Creation Process

This is temporal automation to create/update multiple LDAP users in Chef Automate. If a user appears in the input file and already exists as a user, the user roles will be updated as specified within the input file. If the user does not exist, it will be created with the specified roles.

Prerequisites

The minimum prerequisites to be able to use this automation are:

@larryebaum
larryebaum / gist:e02262ba850a724bd612f3406d94e88a
Created October 3, 2017 14:44
Chef Automate Supermarket Cert Append for SSL Issue with Self Signed Cert
# on Supermarket server
sudo su -
echo "\nSelf-Signed Chef Server Cert (you should feel bad about this)\n=====================" >> /opt/supermarket/embedded/ssl/certs/cacert.pem
openssl s_client -showcerts -connect phl-du-cfbc1.devfwh.lan:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >> /opt/supermarket/embedded/ssl/certs/cacert.pem
# on Chef Server
sudo su -
echo "\nSelf-Signed Supermarket Cert (you should feel bad about this)\n=====================" >> /opt/opscode/embedded/ssl/certs/cacert.pem
openssl s_client -showcerts -connect phl-du-cfsm1.devfwh.lan:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >> /opt/opscode/embedded/ssl/certs/cacert.pem
chef-run chef@node1 file '/etc/motd'
content='Welcome to Chef’ --password Cod3Can!
chef-run chef@node1 motd.rb --password Cod3Can!
chef-run winrm://Administrator@winnode1
file_experiment.rb --password Cod3Can!
chef generate cookbook -P setup
chef generate template motd
kitchen converge
kitchen verify
kitchen destroy

Keybase proof

I hereby claim:

  • I am larryebaum on github.
  • I am larryebaum (https://keybase.io/larryebaum) on keybase.
  • I have a public key ASDKS1XowbLAWmlCQpItjOBvy5C4ZtiEBzhKCsWRqay83go

To claim this, I am signing this object:

@larryebaum
larryebaum / upload-key-aws-regions
Created July 20, 2020 19:12
Upload SSH Key to AWS Regions
#!/bin/bash
## Specify as the 1st parameter the keyname to display in AWS;
## use 1st param or current user
aws_keypair_name="${1:-$USER}"
## Specify as the 2nd parameter the full path to ssh public key file name to upload to AWS;
## use 2nd param or default id_rsa.pub will be used.
publickeyfile="${2:-$HOME/.ssh/id_rsa.pub}"
keydata=$(cat $publickeyfile | base64)
regions=$(aws ec2 describe-regions \

Jupyter Lab Notebooks

Setups

Install Jupyter Lab to your laptop/workstation. Brew is a OSX package manager and makes it super easy if you follow these steps. Jupyter Lab documentation describes the installation steps for non-Brew users.

Many of the Jupyter Lab notebooks contain graphic images as headers. You can easily add/change these graphics to suit your needs using the base Google document Demo Headers. To change a header, create a new slide in the deck, arrange the image as you'd like, and use a screen grab tool (or on OSX, press CMD-CTRL-OPT-4) to select the image boundaries and 'copy'. Then highlight the intended cell in your Jupyter notebook and 'paste'.

Library of Vault Demo Use Cases

| Use Case | Description / Repo Link | Author |