Skip to content

Instantly share code, notes, and snippets.

View hairyhenderson's full-sized avatar

Dave Henderson hairyhenderson

View GitHub Profile
<?xml version="1.0"?>
<installation>
<keymap>us</keymap>
<primary-disk>sda</primary-disk>
<guest-disk>sda</guest-disk>
<root-password>tototo2</root-password>
<source type="local"></source>
<admin-interface name="eth0" proto="dhcp" />
<timezone>America/Toronto</timezone>
<ui-confirmation-prompt>True</ui-confirmation-prompt>
@hairyhenderson
hairyhenderson / dstest.go
Created May 7, 2019 01:33
Using gomplate datasources programatically
package main
import (
"fmt"
"github.com/hairyhenderson/gomplate/data"
)
func main() {
d, err := data.NewData([]string{"ip=https://ipinfo.io"}, nil)
@hairyhenderson
hairyhenderson / deletion_policies.diff
Last active February 8, 2018 20:06
files for post
--- Docker.tmpl.orig 2018-02-07 22:31:45.000000000 -0500
+++ Docker.tmpl 2018-02-07 22:31:37.000000000 -0500
@@ -900,6 +900,7 @@
"Ref": "Vpc"
}
},
+ "DeletionPolicy": "Retain",
"Type": "AWS::EC2::VPCGatewayAttachment"
},
"CloudstorEBSPolicy": {
This file has been truncated, but you can view the full file.
/
/init
/var
/var/run
/var/tmp
/var/spool
/var/opt
/var/log
/var/log/rngd.err.log
/var/log/rngd.out.log
@hairyhenderson
hairyhenderson / console.log
Created April 25, 2017 00:46
result of build caches
$ docker build -f foo .
Sending build context to Docker daemon 968.2 kB
Step 1/2 : FROM scratch
--->
Step 2/2 : ENTRYPOINT foo
---> Running in 6ff458f299fc
---> 9bd53a17eb65
Removing intermediate container 6ff458f299fc
Successfully built 9bd53a17eb65
$ docker build -f foo .
version: '3.1'
services:
one:
image: nginx
networks:
- one
two:
image: nginx
networks:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hairyhenderson
hairyhenderson / d4aws_connect.sh
Last active April 19, 2019 15:09
A helper script to connect to a Docker for AWS manager node for running `docker` commands
#!/bin/bash
#
# A helper script to connect to a Docker for AWS manager node for running `docker` commands
#
# There's a few things going on here:
# 1. it figures out a swarm manager's address using the AWS API
# 2. it controls an SSH tunnel to Docker's API socket on that manager node, so that `docker` commands (such as `docker stack deploy`)
# can be directed at that node
#
# Prerequisites:
rancher:
image: rancher/server
restart: always
environment:
- CATTLE_DB_CATTLE_MYSQL_HOST=dave-rancher-db.c6rqbjezfojf.us-east-1.rds.amazonaws.com
- CATTLE_DB_CATTLE_MYSQL_PORT=3306
- CATTLE_DB_CATTLE_MYSQL_NAME=rancher
- CATTLE_DB_CATTLE_USERNAME=rancherdb
- CATTLE_DB_CATTLE_PASSWORD=rancherdb
ports:
const async = require('async')
function waitForUpdate (appId, updatedInitial) {
var updated = updatedInitial
return new Promise((resolve, reject) => {
async.whilst(
() => updated === updatedInitial,
(callback) => {
getLastUpdated(appId, (err, lastUpdated) => {
if (err) {