Skip to content

Instantly share code, notes, and snippets.

View luthermonson's full-sized avatar

Luther Monson luthermonson

View GitHub Profile
apiVersion: v1
kind: ServiceAccount
metadata:
name: ccm-linode
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:ccm-linode
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: capi-quickstart
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
@luthermonson
luthermonson / main.js
Created February 7, 2022 04:53
xterm/main.js from proxmox ve 7.1-8
console.log('xtermjs: starting');
var states = {
start: 1,
connecting: 2,
connected: 3,
disconnecting: 4,
disconnected: 5,
reconnecting: 6,
};
New-Item -ItemType Directory -Path "$Env:ProgramFiles\containerd" -Force > $null
curl.exe -L https://github.com/luthermonson/containerd/releases/download/win-bins/containerd-shim-runhcs-v1.exe -o "$Env:ProgramFiles\containerd\containerd-shim-runhcs-v1.exe"
curl.exe -L https://github.com/luthermonson/containerd/releases/download/win-bins/containerd.exe -o "$Env:ProgramFiles\containerd\containerd.exe"
curl.exe -L https://github.com/luthermonson/containerd/releases/download/win-bins/ctr.exe -o "$Env:ProgramFiles\containerd\ctr.exe"
# Set containerd config.toml
$ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo
$ProcessInfo.FileName = "$Env:ProgramFiles\containerd\containerd.exe"
$ProcessInfo.RedirectStandardError = $true
$ProcessInfo.RedirectStandardOutput = $true
@luthermonson
luthermonson / gist:b3ac6659dcef70fdb48b9423ba122944
Created February 19, 2021 00:29
powershell tail service logs
function taill([string]$service) {
$idx = (Get-EventLog -LogName Application -Source $service -Newest 1).Index
while ($True)
{
Start-Sleep -MilliSeconds 100
$idx2 = (Get-EventLog -LogName Application -Source $service -Newest 1).index
if (-NOT($idx -eq $idx2)) {
Get-EventLog -logname Application -Source $service -Newest ($idx2 - $idx) | Sort index | Select-Object Message
}
@luthermonson
luthermonson / gist:3cd749e67792dae3b299d192fe71672a
Created January 21, 2021 14:57
Powershell Prompt() with Git Branch
function prompt() {
$host.ui.RawUI.WindowTitle = $pwd
$p = $pwd
if ($p -Match [regex]::Escape($HOME)) {
$p = $p -Replace [regex]::Escape($HOME), "~"
}
Write-Host -NoNewline $p
if (Test-Path -Path $pwd/.git) {
$branch = $(git rev-parse --abbrev-ref HEAD)
@luthermonson
luthermonson / gist:da860d3fc1e3f06abfe56c45da13ded9
Created November 5, 2020 23:13
Powershell Turn On GIT_TRACE
$Env:GIT_TRACE="true"
$Env:GIT_CURL_VERBOSE="true"
$Env:GIT_SSH_COMMAND="ssh -vvv"
$Env:GIT_TRACE_PACK_ACCESS="true"
$Env:GIT_TRACE_PACKET="true"
$Env:GIT_TRACE_PACKFILE="true"
$Env:GIT_TRACE_PERFORMANCE="true"
$Env:GIT_TRACE_SETUP="true"
$Env:GIT_TRACE_SHALLOW="true"
@luthermonson
luthermonson / gist:08589cc189690870ac2df594d57d2236
Last active September 11, 2020 22:31
Powershell to Tail Docker Logs
# Make sure you setup c:\ProgramData\docker\config\daemon.json to contain log-level: debug and debug: true
$idx = (Get-EventLog -LogName Application -Source Docker -Newest 1).Index
while ($True)
{
Start-Sleep -MilliSeconds 100
$idx2 = (Get-EventLog -LogName Application -Source Docker -Newest 1).index
if (-NOT($idx -eq $idx2)) {
Get-EventLog -logname Application -Source Docker -Newest ($idx2 - $idx) | Sort index | Select-Object Message
}
@luthermonson
luthermonson / gist:8faa5d4eac64f893a34e42bcf15e610b
Last active August 28, 2020 22:40
One Liner Windows Server Docker EE Installer
Powershell -NoLogo -NonInteractive -Command "Install-PackageProvider -Name NuGet -Force; Install-Module DockerMsftProvider -Force; Install-Package Docker -ProviderName DockerMsftProvider -Force; Restart-Computer;"
@luthermonson
luthermonson / build-and-push.yml
Last active June 12, 2020 07:58
Github Action to Build a Docker Image and push it to Github Packages
# Have a ./Dockerfile in your projecft and put in .github/workflows/build-and-push.yml
name: Build Docker Image and Push to Github Packages
on:
push:
tags:
- '*'
jobs:
build-and-push: