Skip to content

Instantly share code, notes, and snippets.

View m-richo's full-sized avatar

Michael Richardson m-richo

View GitHub Profile
@m-richo
m-richo / cf-app-audit.sh
Last active December 12, 2017 22:15
query Cloud Foundry environment for all running applications and dump them into a CSV file
#!/bin/bash
set -eu
set -o pipefail
API_ENDPOINT=$(cf api |grep "endpoint" |awk -F "https://" '{print $2}')
rm -f $API_ENDPOINT.csv
echo "Running audit for $API_ENDPOINT"
echo "Output is in $API_ENDPOINT.csv"
@m-richo
m-richo / bumpme
Last active November 14, 2016 01:06
bumpme
Mon Nov 14 01:06:50 UTC 2016

Keybase proof

I hereby claim:

  • I am m-richo on github.
  • I am m_richo (https://keybase.io/m_richo) on keybase.
  • I have a public key whose fingerprint is 7167 42CF 5636 9B2D 64F9 160C 6DE9 B6B0 D4C8 2358

To claim this, I am signing this object:

@m-richo
m-richo / gist:5b2f3b5318e0f48f80bb
Created August 20, 2015 05:37
advanced confd template
upstream backend_hosts {
{{ $nodes := split (getenv "app_servers") ":" }}{{range $nodes}}
server {{.}};{{end}}
}
@m-richo
m-richo / gist:1b20c7aa8ec2c7e9c60e
Created August 20, 2015 05:07
Set bootstrap script to be run when containers start
CMD ["/start.sh"]
@m-richo
m-richo / gist:63a8b17098084282ec47
Last active August 29, 2015 14:27
Docker bootstrap script
#!/bin/bash
set -e
# if $proxy_domain is not set, then default to $HOSTNAME
export proxy_domain=${proxy_domain:-$HOSTNAME}
# ensure the following environment variables are set. exit script and container if not set.
test $backend_host
/usr/local/bin/confd -onetime -backend env
@m-richo
m-richo / gist:4a88f2ee6e6b59d23c4e
Created August 20, 2015 05:03
Add confd templates to Docker image
ADD files/confd /etc/confd
@m-richo
m-richo / gist:d2d74563de82f808c62c
Created August 20, 2015 04:58
simple confd template for nginx
server {
server_name {{ getenv "proxy_domain" }};
location / {
proxy_pass http://{{ getenv "backend_host" }};
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
@m-richo
m-richo / gist:2876118aae50cff8f471
Created August 20, 2015 04:55
installing confd to a docker image
ADD https://github.com/kelseyhightower/confd/releases/download/v0.10.0/confd-0.10.0-linux-amd64 /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd
@m-richo
m-richo / gist:6153792
Created August 5, 2013 06:01
help me puppet
[root@michaelr ~]# puppet help help help help help
%%%%
%%%%-(
_%%%%%_/ \ ' /
_%%%%%%%% - (_) -
_%%%%%%%/ \% / , \
%%%%%%%%%\\ \_
%%%%%% \ \\
) /\_/