Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / docker-cleanup-resources.md
Created August 3, 2017 13:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@avoidik
avoidik / authn_k8s.yml
Created December 5, 2017 13:16 — forked from kgilpin/authn_k8s.yml
authn-k8s
- !policy
id: conjur/authn-k8s/minikube/default
owner: !group /k8s_admin
body:
- !webservice
annotations:
kubernetes/namespace: default
- !host client
@avoidik
avoidik / NOTES.md
Created February 25, 2018 18:38 — forked from DenisIzmaylov/NOTES.md
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

@avoidik
avoidik / README.md
Created February 25, 2018 18:38 — forked from DenisIzmaylov/README.md
Step By Step Guide To Setup Docker Registry

Step By Step Guide To Setup CI/CD With Docker Registry

Step-by-Step Guide how to install CI/CD with Docker Registry On Ubuntu 14.04 LTS from scratch.

  1. Install Docker using Official Manual or just run:
sudo bash
apt-get update
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Execute the following command and make a note of X-Auth-Token. You will need this token to use in all subsequent commands.
curl -v -H 'X-Storage-User: system:root' -H 'X-Storage-Pass: testpass' http://10.80.83.68:8077/auth/v1.0
In the following command examples we are using 'AUTH_tk65840af9f6f74d1aaefac978cb8f0899' as the X-Auth-Token. Replace this with the appropriate token you obtained in the above step.
To create a container:
curl -X PUT -H 'X-Auth-Token: AUTH_tk65840af9f6f74d1aaefac978cb8f0899' http://10.80.83.68:8077/v1/AUTH_system/mycontainer
To list all containers in current account:
@avoidik
avoidik / reuse_agent.sh
Created March 16, 2018 11:55 — forked from MarkRose/reuse_agent.sh
Reuse existing ssh-agent or start a new one
# Reuse an existing ssh-agent on login, or create a new one. Append this to your .bashrc
# I have no idea who the author of the original concept was for reusing agents. This
# version also handles the case where the agent exists but has no keys.
GOT_AGENT=0
for FILE in $(find /tmp/ssh-* -type s -user ${LOGNAME} -name "agent.[0-9]*" 2>/dev/null)
do
SOCK_PID=${FILE##*.}
@avoidik
avoidik / create_kubernetes_cluster.sh
Created March 22, 2018 23:00 — forked from ruzickap/create_kubernetes_cluster.sh
Create Kubernetes Cluster using Kubespray
# Create Virtual env for Kubespray and make it active
virtualenv --system-site-packages kubespray_virtenv
source kubespray_virtenv/bin/activate
# Install Ansible and Kubespray to virtualenv
pip install kubespray
# Create kubespray config file
cat > ~/.kubespray.yml << EOF
kubespray_git_repo: "https://github.com/kubespray/kubespray.git"
@avoidik
avoidik / aws-cfn.sh
Created May 3, 2018 06:08 — forked from cgswong/aws-cfn.sh
Setup CentOS server with AWS CFN bootstrap
#!/bin/bash
# Setup CentOS 7 host as AMI
# Update base OS update, and install EPEL repo and Python Pip
sudo yum -y update
sudo yum –y install epel-release
sudo yum -y install python-pip
# Install Python add-ons:
sudo pip install pystache
@avoidik
avoidik / console.py
Created May 10, 2018 15:23 — forked from weavenet/console.py
Python script to assume STS role and generate AWS console URL.
#!/usr/bin/env python
import getpass
import json
import requests
import sys
import urllib
import boto3
#!/bin/bash
#
# vault-ec2-auth.sh
# Authenticates an EC2 instance to Hashicorp Vault
#
# configuration stored in environment variables in /etc/vault/client.conf
# expected configuration (defaults are selected below if none is specified):
# VAULT_ADDR = url of vault server
# VAULT_ROLE = role name to authenticate as