Skip to content

Instantly share code, notes, and snippets.

@agileguy
agileguy / kubeadm-reset.sh
Created November 16, 2019 22:08
Proper kubeadm reset - to be run under su
kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /etc/cni/
ifconfig cni0 down
ifconfig flannel.1 down
ifconfig docker0 down
ip link delete cni0
@agileguy
agileguy / quinsam.ps1
Created November 4, 2019 15:17
PowerShell script to scrape the location of the MV Quinsam
$url = 'https://www.vesselfinder.com/vessels/QUINSAM-IMO-8111386-MMSI-316001266'
$ie = New-Object -com internetexplorer.application
$ie.navigate($url)
while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 100; }
$tables = $ie.Document.body.getElementsByClassName('tparams')
foreach ($table in $tables) {
if ($table.innerHtml -like '*Coordinates*'){
Write-Output $table.rows[$table.rows.length -1].lastChild.innerText
Write-Output $table.rows[$table.rows.length -2].lastChild.innerText
Write-Output $table.rows[$table.rows.length -3].lastChild.innerText
@agileguy
agileguy / ingress.yaml
Created November 3, 2019 16:07
Ingress for blog
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: blog-devopsculture
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: blog-letsencrypt
spec:
tls:
@agileguy
agileguy / service.yaml
Created November 3, 2019 16:06
Service to expose blog
apiVersion: v1
kind: Service
metadata:
name: blog-devopsculture
spec:
selector:
app: blog
ports:
- protocol: TCP
port: 80
@agileguy
agileguy / deployment.yaml
Created November 3, 2019 16:00
Deployment of Ghost
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: blog
labels:
app: blog
spec:
replicas: 1
selector:
matchLabels:
@agileguy
agileguy / certificate.yaml
Last active November 3, 2019 23:39
Certificate for blog (Lets Encrypt)
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: blog-devopsculture
spec:
secretName: blog-devopsculture
issuerRef:
name: blog-letsencrypt
kind: ClusterIssuer
commonName: 'blog.devopsculture.ca'
@agileguy
agileguy / certificate-issuer.yaml
Last active November 3, 2019 15:39
Certificate issuer for blog (Lets Encrypt)
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: blog-letsencrypt
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: something@hotmail.com
privateKeySecretRef:
name: blog-devopsculture
@agileguy
agileguy / volume.yaml
Created November 3, 2019 15:26
Blog content persistent volume claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: blog-content
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
@agileguy
agileguy / sandbox.ino
Created September 13, 2012 00:05
First Milestone of Arduino Sandbox
#include <LiquidCrystal.h>
int greenPin = 8;
int redPin = 9;
LiquidCrystal lcd(12, 11, 5, 7, 3, 2);
void setup()
{
pinMode(greenPin, OUTPUT);
pinMode(redPin, OUTPUT);
@using website.Properties
@{
ViewBag.Title = @Resources.SiteName;
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="paragraphs">
<p>@Resources.Bio</p>
<p>@Resources.History</p>
<p>@Resources.Services</p>