Skip to content

Instantly share code, notes, and snippets.

@ethnchao
ethnchao / kube-pull-images.sh
Last active January 22, 2022 10:33
Kubernetes k8s.gcr.io images pull & retag & remove
#!/bin/bash
K8S_VERSION=v1.15.0
PAUSE_VERSION=3.1
ETCD_VERSION=3.3.10
COREDNS_VERSION=1.3.1
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:${K8S_VERSION} && \
@stopyoukid
stopyoukid / diff2html.sh
Last active August 10, 2024 15:42
Script that takes a git diff and outputs an html file in GitHub style
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color: