Skip to content

Instantly share code, notes, and snippets.

View mattray's full-sized avatar
🇦🇺
in Sydney

Matt Ray mattray

🇦🇺
in Sydney
View GitHub Profile

Habitat On-Prem-Builder Depot authentication setup with Chef Automate

Step 1: create a new OAuth Application in Chef Automate

Login into your Automate server and create a file called oauth.toml

bldr_signin_url Is your builder FQDN. The URL should be http if you have SSL disabled which may be the case for an evaluation.

IMPORTANT: don't forget the / at the end of the URL you set for bldr_signin_url

@bitsurgeon
bitsurgeon / youtube.md
Last active November 4, 2024 14:16
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">
$ bundle exec bin/iggy cfn generate -t test/bjc-demo-aws-4.5.4.json
# encoding: utf-8
#
title '/Users/mray/ws/iggy/test/bjc-demo-aws-4.5.4.json controls generated by Iggy v0.1.0'
control 'aws_vpc::VPC' do
title 'Iggy bjc-demo-aws-4.5.4.json aws_vpc::VPC'
desc 'aws_vpc::VPC from the source file /Users/mray/ws/iggy/test/bjc-demo-aws-4.5.4.json
Generated by Iggy v0.1.0'
@MattMencel
MattMencel / pi_chef-client_omnibus.rb
Last active November 17, 2016 15:44
Upgrade Chef Client with Omnibus_Updater Cookbook on Raspberry Pi
# base chef-client has already been installed via package mgmt or git
package 'libgmp3-dev' do
# required for libyajl gem which is required for chef gem
action :upgrade
end
# Pull chef repo so we can build the omnibus packages
git '/usr/local/src/chef' do

ChefDK, Test Kitchen Driven NTP Cookbook

This gist uses TK+Berkshelf to drive creating a vagrant virts and converging a simple recipe to install and configure NTPd. This is a simple cookbook that has one recipe, one template (for ntp.conf) and one attribute file. It works on Ubuntu 12.04 and CentOS 6.4 (and derviatives) and the attribute file is used to support both distros.

This should work on Mac (where I developed it) and any chef-supported Linux that you can get Vagrant onto (Ubuntu/CentOS).

Because I use ChefDK and Test Kitchen, I can largely ignore setting up Vagrant and Berkshelf and can get right to work on writing recipe code.

NOTE: Modern (7/6/2014) Recipe Generation

@spheromak
spheromak / cook-scm-ver
Created October 30, 2013 16:49
wrap thor-scm-ver
#!/usr/bin/env ruby
#
# Wrap thor-scmver to build metadata
#
require 'thor-scmversion'
module ThorSCMVersion
class Tasks < Thor
namespace "version"
@craigtracey
craigtracey / gist:6941922
Created October 11, 2013 20:57
Preseed partitioning example
# Keyboard and locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
# Network
d-i netcfg/choose_interface select eth0
d-i hw-detect/load_firmware boolean true
# Mirror
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now