Skip to content

Instantly share code, notes, and snippets.

@binnyrs
binnyrs / self-signed-certificate-with-custom-ca.md
Created December 11, 2019 11:09 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@binnyrs
binnyrs / vault-pod-runner.py
Created September 25, 2019 16:41 — forked from innovia/vault-pod-runner.py
Vault Runner - get secret from vault and replace process
#!/env python
import os
import json
import logging
import tarfile
import requests
import sys
CA_PATH = "/etc/tls/ca.pem"
VAULT_URL = "https://vault.default.svc.cluster.local:8200"
@binnyrs
binnyrs / kubectl-shortcuts.sh
Created June 11, 2019 05:44 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@binnyrs
binnyrs / vhost-reader.py
Created January 1, 2019 07:01 — forked from jakubjedelsky/vhost-reader.py
Simple VirtualHost parser
#!/usr/bin/env python
#
# simle'n'stupid vhost "parser"
#
# Usage: ./vhosts-reader.py FILE
# FILE is a apache config file
import re
import sys
import os.path