Skip to content

Instantly share code, notes, and snippets.

View teknofire's full-sized avatar

Will teknofire

View GitHub Profile
@teknofire
teknofire / index.html
Last active October 28, 2016 22:03
Example map template for AAEM community output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AAEM Template map</title>
<!-- NEEDED LIBS FOR DISPLAYING MAP -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
<!-- END OF LIB INCLUDES -->
<!-- Set some styling on the map to make sure it has a height -->
@teknofire
teknofire / gist:858dc84708a3724bf46cf81c99823102
Created February 22, 2017 21:53
influxdb converge error with chef-client 12.19.33
================================================================================
Error executing action `install` on resource 'influxdb_install[influxdb]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
apt_package[influxdb] (/tmp/kitchen/cache/cookbooks/influxdb/resources/install.rb line 47) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of ["apt-get", "-q", "-y", "--force-yes", "-o", "Dpkg::Options::=\"--force-confdef\"", "-o", "Dpkg::Options::=\"--force-confold\"", "install", "influxdb=1.2.0-1"] ----
STDOUT: Reading package lists...
Building dependency tree...
@teknofire
teknofire / config_2_acl_try1
Last active April 27, 2017 22:47
haproxy_acl usage thoughts
# frozen_string_literal: true
haproxy_install 'package'
directory '/etc/haproxy/errors' do
user 'haproxy'
group 'haproxy'
end
file '/etc/haproxy/errors/403.http' do
content '<h1>Error: 403</h1>'
hs.hotkey.bind({"cmd", "ctrl"}, "[", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x
f.y = max.y
f.w = max.w / 2
f.h = max.h
---
driver:
name: vagrant
gui: false
provisioner:
name: chef_zero
verifier:
name: inspec

Notes

ssl testing

Even with ssl.verify off, berks install or berks vendor will fail when supermarket is using a self-signed certificate. So, how do we get around that?

Get the CERT

knife ssl fetch supermarket-0.c.cheffian-supermarket.internal

concatenate all your pems

@teknofire
teknofire / hammerspoon.js
Created March 14, 2018 18:51
Hammerspoon config
-- Copyright (c) 2016 Miro Mannino
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this
-- software and associated documentation files (the "Software"), to deal in the Software
-- without restriction, including without limitation the rights to use, copy, modify, merge,
-- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
-- to whom the Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all copies
-- or substantial portions of the Software.
--

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "USERNAME"
client_key "#{current_dir}/USERNAME.pem"
chef_server_url "https://CHEF_SERVER_FQDN/organizations/default"
cookbook_path ["#{current_dir}/../cookbooks"]
ssl_verify_mode :verify_none
# add this near the top of the /var/opt//delivery/nginx/etc/server.d/elasticsearch_proxy.conf
# before the server { line but after the initial comment block
map $status $loggable {
~^[3] 0;
default 1;
}
# inside the server { block modify the access_log line to have the ` if=$loggable;` at the end