Skip to content

Instantly share code, notes, and snippets.

@thatderek
thatderek / consul.service
Created March 18, 2016 01:10 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
variable "manual_foos_list" {
default = []
}
resource "bar" "n" {
count = "3"
foo = "${length(var.manual_foos_list) > 0 ? element(var.manual_foos_lists, count.index) : element(data.foos.*.id, count.index)}"
}
resource "null_resource" "adminip" {
provisioner "local-exec" {
command = "echo `dig +short myip.opendns.com @resolver1.opendns.com` > /tmp/admin.ip"
}
}
resource "aws_security_group_rule" "allow_all" {
count = "2"
depends_on = ["${null_resource.adminip}"]
@thatderek
thatderek / list_compare.tf
Created March 24, 2017 04:41
showing how to compare lists for terraform logic where the element might not exist
variable "example_list_short" {
default = ["a", "b", "c"]
}
variable "example_list_long" {
default = ["a", "b", "c", "d"]
}
variable "example_list_complex" {
default = ["a", "", "d", "d"]
@thatderek
thatderek / bob changes keys
Created September 4, 2017 19:39
bob changes keys
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@thatderek
thatderek / holder.gcode
Created July 3, 2018 20:26
holder.gocde
This file has been truncated, but you can view the full file.
; generated by Slic3r Prusa Edition 1.40.1-rc+linux64 on 2018-07-03 at 16:24:38
;
; external perimeters extrusion width = 0.45mm
; perimeters extrusion width = 0.45mm
; infill extrusion width = 0.45mm
; solid infill extrusion width = 0.45mm
; top infill extrusion width = 0.40mm
; first layer extrusion width = 0.42mm
@thatderek
thatderek / gist:f0a06d4277153d9e4abc8efa704c0392
Last active March 8, 2020 18:44
why does unicast_hosts.txt end up as a folder?! aaaaaaaak
job "elasticsearch" {
type = "service"
datacenters = ["dc1"]
spread {
attribute = "${node.unique.id}"