Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View scottslowe's full-sized avatar

Scott S. Lowe scottslowe

View GitHub Profile
function aws-sso-access-token() {
find "$HOME/.aws/sso/cache" -type f ! -name 'botocore*' -exec jq -r '.accessToken' {} \; | head -n1
}
function aws-sso-list-accounts() {
aws sso list-accounts --access-token "$(aws-sso-access-token)" "$@"
}
function aws-sso-list-account-roles() {
aws sso list-account-roles --access-token "$(aws-sso-access-token)" "$@"
@vcabbage
vcabbage / Dockerfile
Last active November 21, 2018 20:06
Multi-stage Dockerfile
FROM golang:alpine AS build
ADD . /go/src/github.com/my/project
WORKDIR /go/src/github.com/my/project
RUN go build -o /mybinary ./cmd/mybinary
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=build /mybinary /mybinary
ENTRYPOINT ["/mybinary"]
@so0k
so0k / kubectl.md
Last active March 22, 2024 13:03
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no

Docker Macvlan and Ipvlan Experimental Driver Examples

  • The build will be vendored into github.com/docker/docker in the next few days. In the meantime here is the binary that will be getting vendored. docker-1.11.0-dev.zip
  • Ipvlan L2 mode network with multiple subnets without a parent specified
  • For a long test that will create 54 networks and 120+ containers, then delete them all and recreate them again try ipvlan-macvlan-it.sh Instructions here Docker Macvlan and Ipvlan Manual IT Test
  • FYI Note: When the parent is empty or the --internal flag is used, a linux type dummy interface is dynamically created by Libnetwork to act as the parent. This network is completely isolated and is the equivalent to a --internal flag. This is a good mode for demoing.
  • The first test requires an interface
@Mierdin
Mierdin / create_swarm_osx_dockertoolbox.sh
Last active February 1, 2016 21:40
A quick script to create a Swarm cluster with Docker Machine on OSX (with configuration for multi-host networking as well)
# Create
docker-machine create -d virtualbox local
eval "$(docker-machine env local)"
TOKEN_SWARM=$(docker run swarm create)
docker-machine create -d virtualbox mh-keystore
docker $(docker-machine config mh-keystore) run -d -p "8500:8500" -h "consul" progrium/consul -server -bootstrap
CREATE_MASTER_NODE="docker-machine create --engine-opt="cluster-advertise=eth1:2376" --engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore):8500" -d virtualbox --swarm --swarm-master --swarm-discovery token://$TOKEN_SWARM swarm-master"
CREATE_NODE_01="docker-machine create --engine-label name=swarm-agent-00 --engine-label storage=ssd --engine-opt="cluster-advertise=eth1:2376" --engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore):8500" -d virtualbox --swarm --swarm-discovery token://$TOKEN_SWARM swarm-agent-00"
CREATE_NODE_02="docker-machine create --engine-label name=swarm-agent-01 --engine-label storage=rust --engine-opt="cluster-advertise=eth1:2376" --engine-opt="cluster-store=consul://$(docker-m