Skip to content

Instantly share code, notes, and snippets.

🔮
Magic

David Corbin davidcorbin

🔮
Magic
View GitHub Profile
@davidcorbin
davidcorbin / gist:c9fbed62b4f1e2a554547b1a1f6bb2ba
Created Jul 11, 2020
Helm install promtail with external Loki for RKE
View gist:c9fbed62b4f1e2a554547b1a1f6bb2ba
helm upgrade --install promtail loki/promtail -n promtail \
--set volumes\[0\].name=docker \
--set volumes\[0\].hostPath.path=/var/lib/rancher/rke/log \
--set volumes\[1\].name=pods \
--set volumes\[1\].hostPath.path=/var/log/containers \
--set volumes\[2\].name=dockersym \
--set volumes\[2\].hostPath.path=/apps/docker/containers \
--set volumes\[3\].name=podssym \
--set volumes\[3\].hostPath.path=/var/log/pods\
--set volumeMounts\[0\].name=docker \
@davidcorbin
davidcorbin / gist:0f4f5a8eef15de8320bf839066d5002b
Created Jun 4, 2020
IPTables log dropped (logs go to /var/logs/kern.log)
View gist:0f4f5a8eef15de8320bf839066d5002b
sudo iptables -N LOGGING
sudo iptables -A INPUT -j LOGGING
sudo iptables -A OUTPUT -j LOGGING
sudo iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables-Dropped: " --log-level 4
sudo iptables -A LOGGING -j DROP
@davidcorbin
davidcorbin / docker.yml
Created May 24, 2020
Push to Google Container Registry (GCR) from GitHub Actions
View docker.yml
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
@davidcorbin
davidcorbin / s.sh
Created Mar 24, 2020
Get host IP from minikube
View s.sh
minikube ssh "route -n | grep ^0.0.0.0 | awk '{ print \$2 }'"
@davidcorbin
davidcorbin / script.sh
Last active Feb 19, 2020
Remove Rancher from Cluster - Force Delete CRDs
View script.sh
# Manually remove finalizers
kubectl edit -n cattle-system secret tls-rancher
kubectl patch secret tls-rancher -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl patch namespace cattle-system -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-system --grace-period=0 --force
kubectl patch namespace cattle-global-data -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-global-data --grace-period=0 --force
@davidcorbin
davidcorbin / run.sh
Created Jan 27, 2020
Install Docker
View run.sh
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
@davidcorbin
davidcorbin / validate.escript
Created Oct 24, 2019
Validate Erlang config files
View validate.escript
#!/usr/bin/env escript
main([ConfigFile]) ->
{ok, Terms} = file:consult(ConfigFile),
io:format("~p~n",[Terms]).
@davidcorbin
davidcorbin / example.py
Created Sep 5, 2019
Interactive Plots in Jupyter
View example.py
%matplotlib widget
from ipywidgets import *
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2 * np.pi)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
line, = ax.plot(x, np.sin(x))
@davidcorbin
davidcorbin / test.py
Last active Aug 3, 2019
Setup Jupyter for graphing
View test.py
## Plot theme
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('Solarize_Light2')
#plt.style.available
## High quality plot
%config InlineBackend.figure_format = 'svg'
View keybase.md

Keybase proof

I hereby claim:

  • I am davidcorbin on github.
  • I am davidcorbin (https://keybase.io/davidcorbin) on keybase.
  • I have a public key ASADhybRsZZZVCRrKA0hT2fbk3C1kkycwnlvUTSbVumScQo

To claim this, I am signing this object:

You can’t perform that action at this time.