Skip to content

Instantly share code, notes, and snippets.

View polds's full-sized avatar

Peter Olds polds

View GitHub Profile
@polds
polds / output
Created September 10, 2015 23:03
salt-key --list-all
Accepted Keys:
test-salt-pro
Denied Keys:
test-salt-pro
Unaccepted Keys:
test-salt-pro
{% set regionname = salt['cmd.run']("curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\\" '{print $4}'") %}
@polds
polds / init.sls
Created September 9, 2015 17:00
salt vars from commands
{% set region_name = salt.cmd.run("curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'") %}
{% set bucket_name = {
'us-east-1': 'aws-codedeploy-us-east-1',
'us-west-2': 'aws-codedeploy-us-west-2',
'eu-west-1': 'aws-codedeploy-eu-west-1',
'ap-southeast-2': 'aws-codedeploy-ap-southeast-2',
'ap-northeast-1': 'aws-codedeploy-ap-northeast-1',
}.get(region_name) %}
@polds
polds / output
Last active September 3, 2015 21:20
----------
ID: consul
Function: archive.extracted
Name: /opt/consul
Result: True
Comment: /opt/consul/ already exists
Started: 21:08:54.520311
Duration: 1.295 ms
Changes:
----------
@polds
polds / docker command
Created August 19, 2015 22:43
Unrecognized Import Path
docker run --rm -it \
-v "$(pwd)":/app \
-e "GOPATH=/gopath" \
-w /app \
golang:1.4.2 \
sh -c "go get -u -d ./... && go build -o example"
@polds
polds / haproxy.cfg
Created June 29, 2015 20:33
haproxy.cfg
frontend main
acl S3HelpPage path /help
use_backend s3help if S3HelpPage
backend s3help
reqirep ^([^\ :]*)\ /help([^\/])(.*) \1\ /help/index.html \3
server s3help s3.amazonaws.com:80 check
@polds
polds / index.html
Last active August 29, 2015 14:23
Polymer 1.0 cross bind
...
<link rel="import" href="my-service.html">
</head>
<body>
<my-service my="{{output}}"></my-service>
<h3>[[output.my]]</h3>
</body>
</html>
package a
import (
"fmt"
)
type A string
var AS A = New()
@polds
polds / Dockerfile1
Created April 1, 2015 15:49
Dockerfiles
FROM kyani/modx:latest
RUN apt-get update
RUN apt-get -yqq install wget
RUN apt-get -yqq install python-setuptools
RUN easy_install pip
RUN mkdir -p /opt/newrelic
WORKDIR /opt/newrelic
RUN wget -r -nd --no-parent -Alinux.tar.gz \
http://download.newrelic.com/php_agent/release/ >/dev/null 2>&1 \
@polds
polds / test.go
Last active August 29, 2015 14:14 — forked from ernesto-jimenez/test.go
package main
import (
"fmt"
"net/http"
"sync"
)
type LimitedRoundTripper struct {
inflight chan interface{}