Skip to content

Instantly share code, notes, and snippets.

View lancewf's full-sized avatar
🏠
Working from home

Lance Finfrock lancewf

🏠
Working from home
View GitHub Profile
@lancewf
lancewf / chef-server-ctl_reconfigure.log
Created June 16, 2017 21:23
A chef-server-ctl run with an external elasticsearch that is behind a redirect
================================================================================
Error executing action `create` on resource 'template[/var/opt/opscode/opscode-erchef/sys.config]'
================================================================================
JSON::ParserError
-----------------
743: unexpected token at '<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
version: '2'
services:
database:
image: lancewf/automate-elasticsearch
command: "start lancewf/automate-elasticsearch --group automate-elasticsearch"
volumes:
data-volume: {}
#!/bin/bash
#
# This file contains all personal edits and should not be commited.
GO_FAST=true
# This removes the visual mode when select text with the mouse in vim.
echo "set mouse-=a" >> ~/.vimrc
function auto_run() {
{
"chef_server_fqdn":"hostname",
"end_time":"0001-01-01T00:14:00Z",
"entity_uuid":"d92fbcb5-9ccf-3fed-997f-1f77c2e988b3",
"expanded_run_list":{
"id":"_default",
"run_list":[
{
"name":"chef-vault::default",
"skipped":false,
#!/bin/bash
eval "$(curl -s -L https://gist.githubusercontent.com/lancewf/6b58d3accb36c2ae5681a40bd574b124/raw/4c8a9e6dc725b9b4fa62a96f5770e3946dde8437/hab_studio_addition)"
export MYSQL_PORT=3306
export MMSN_PORT=8080
export PHP_PORT=9000
export MONEY_CHECKER_SERVER_PORT=8081
export WIKI_PORT=8082
export WHALEDISENTANGLEMENT_HOME_PORT=8083
#!/bin/bash
hab pkg install chef/ci-studio-common >/dev/null
source "$(hab pkg path chef/ci-studio-common)/bin/studio-common"
# This removes the visual mode when select text with the mouse in vim.
echo "set mouse-=a" >> ~/.vimrc
function auto_run() {
[[ "$WATCH" == "" ]] && WATCH="./"
curl https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | bash
adduser --group hab
useradd -g hab hab
Add the below to the systemd file: /lib/systemd/system/hab.service
```
[Unit]
@lancewf
lancewf / gist:19a1735bbfe27ab9180af0ea738b75df
Created March 29, 2019 18:37
Chef client run failure webhook notification
{
"type":"converge_failure",
"start_time_utc":"2016-06-28T20:05:29.000000Z",
"node_name":"insights.chef.co",
"failure_snippet":"Chef client run failure on [example.com] insights.chef.co : https://a2-dev.test/client-runs/0271e125-97dd-498a-b026-8448ee60aafe/runs/ba6acb91-1eaa-4c84-8d68-f19ee641e606\nError executing action `create` on resource 'file[/failed/file/resource]'\nfile[/failed/file/resource] (insights-test::default line 26) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /failed/file does not exist. \n",
"exception_title":"Error executing action `create` on resource 'file[/failed/file/resource]'",
"exception_message":"file[/failed/file/resource] (insights-test::default line 26) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /failed/file does not exist.",
"exception_backtrace":[
"/Users/bob/projects/chef/lib/chef/mixin/why_run.rb:240:in `run'",
"/Users/bob/projects/chef/lib/chef/mixin/why_run.rb:321:in `
@lancewf
lancewf / gist:4cfb32094c91e09413f43c74dd975d9b
Created March 29, 2019 18:53
InSpec report failure webhook notification
{
"type":"compliance_failure",
"total_number_of_tests":18,
"total_number_of_skipped_tests":14,
"total_number_of_passed_tests":2,
"total_number_of_failed_tests":2,
"number_of_failed_critical_tests":1,
"number_of_critical_tests":16,
"node_uuid":"9b9f4e51-b049-4b10-9555-10578916e112",
"node_name":"redhat(2)-alpha-nginx(f)-apache(f)-failed",
@lancewf
lancewf / aws-env
Created April 29, 2019 19:05
Export aws environment variable from creds
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import configparser
import os
import sys
CREDENTIALS_PATH = "~/.aws/credentials"