This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Pull/Fetch remote branches and prune local branches that have been deleted | |
# Usage: prune_branches.sh [remote] | |
# If remote is not specified, it defaults to origin | |
# If remote is specified, it must be a valid remote name | |
set -e | |
# Get the remote name | |
if [ -z "$1" ]; then | |
remote="origin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Setup Docker engine with specific configuration and secure TCP socket | |
hosts: all | |
become: yes | |
vars: | |
ca_key: /etc/docker/ssl/ca-key.pem | |
ca_cert: /etc/docker/ssl/ca.pem | |
server_key: /etc/docker/ssl/server-key.pem | |
server_cert: /etc/docker/ssl/server-cert.pem | |
client_key: /etc/docker/ssl/client-key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
install_deps_windows() { | |
echo "Installing Build Dependencies (Windows)..." | |
choco install -y make visualstudio2019buildtools visualstudio2019-workload-vctools | |
} | |
install_deps_darwin() { | |
echo "Installing Build Dependencies (Darwin)..." | |
xcode-select --install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
import pathlib | |
from typing import Optional, Union, List, Tuple | |
logger = logging.getLogger(__name__) | |
def get_user_data_dir(appending_paths: Union[str, List[str], Tuple[str, ...]] = None) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: etcd-backup | |
namespace: kube-system | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
volumeMode: Filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple shell script to initialize the first k8s master. | |
# This was needed, because of some networking discrepancies with minikube testing in relation to a production cluster. | |
# This allows you to fire up a single node master/worker, single master multiple workers, or HA k8s via kubeadm. | |
# Installs Flannel and MetalLB (cause layer2 for local devel) | |
# Pardon my terrible shell coding skills. Whipped this up on a late night. | |
### Settings ### | |
FLANNEL_MANIFEST="https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import base64 | |
from getpass import getpass | |
def create_secret_yaml(secret_name, **kwargs): | |
""" | |
Create k8s Secret Yaml with key: value | |
Value must already be base64 encoded and in utf-8 encoded bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import zipfile | |
import logging | |
import requests | |
import xml.etree.ElementTree as ET | |
from io import BytesIO | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from io import BytesIO | |
from flask import send_file | |
from urllib.request import urlopen | |
from tempfile import NamedTemporaryFile | |
from urllib.error import URLError, HTTPError, ContentTooShortError | |
@web.route('/snapshot') | |
def snapshot(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import ntpath | |
import argparse | |
from ftplib import FTP | |
def upload_file(host, port, | |
username, password, | |
file_path, remote_path): |
NewerOlder