Skip to content

Instantly share code, notes, and snippets.

View PatrickLang's full-sized avatar

Patrick Lang PatrickLang

  • Washington, USA
View GitHub Profile
@PatrickLang
PatrickLang / README.md
Last active February 24, 2023 20:05
Yubikey + Windows

Using a Yubikey 4 on Windows

These are my notes on how to set up GPG with the private key stored on the hardware Yubikey. This will reduce the chances of your GPG private key from being stolen, and also allow you to protect other secrets such as SSH private keys.

It's just some notes and a partial worklog for now, but I may turn it into a full blog post later.

@PatrickLang
PatrickLang / keybase.md
Created November 19, 2018 07:02
keybase.md

Keybase proof

I hereby claim:

  • I am patricklang on github.
  • I am patricklang (https://keybase.io/patricklang) on keybase.
  • I have a public key ASAdO5y1E-8KsfWIVGlxU_JB4iStpfs53NGmv79Urw8xsQo

To claim this, I am signing this object:

@PatrickLang
PatrickLang / README.md
Created September 9, 2018 02:30
Designing a web-based "Roon Bridge"
@PatrickLang
PatrickLang / README.md
Last active August 13, 2018 19:03
Get a shell to a Windows host in acs-engine deployments

Assuming WinRM already enabled

kubectl run psh --image=mcr.microsoft.com/powershell -i -t --overrides='{ "apiVersion": "extensions/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'


# or maybe
kubectl run psh --image=mcr.microsoft.com/powershell -i -t --overrides='{ "apiVersion": "apps/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'
@PatrickLang
PatrickLang / 4amdl.ps1
Last active July 30, 2018 16:38
PowerShell script to scrape Apple 2 "4am" collection
$feedUrl = "https://archive.org/services/collection-rss.php?collection=apple_ii_library_4am"
# Issue - this only seems to get latest 50 entries
$feedContents = ([xml](Invoke-WebRequest -UseBasicParsing -Uri $feedUrl).Content).rss.channel.item
Write-Host Found $feedContents.Count items
$r = [regex]"([^/]+)/?$" # Thanks https://stackoverflow.com/a/8798550
$feedContents | ForEach-Object {
$identifier = $r.Match($_.link).Value
$fileList = [xml](Invoke-WebRequest -UseBasicParsing -Uri "https://archive.org/download/$($identifier)/$($identifier)_files.xml")
@PatrickLang
PatrickLang / iis-1709-healthcheck.yaml
Last active July 13, 2018 22:30
IIS sample with health check
apiVersion: apps/v1
kind: Deployment
metadata:
name: iis-1709
labels:
app: iis-1709
spec:
replicas: 1
template:
metadata:
@PatrickLang
PatrickLang / README.md
Last active June 7, 2018 18:27
Kubernetes v1.11 SIG-Windows release notes

This release supports more of Kubernetes API for pods and containers on Windows:

  • Metrics: Pod, Container, Log filesystem
  • Security contexts: run_as_user #64009
  • Storage: Local persistent volumes #62012 and fstype for Azure disk #61267

Improvements in Windows Server version 1803 also bring new storage functionality to Kubernetes v1.11

  • Volume mounts for ConfigMap and Secret
  • Flexvolume plugins for SMB and iSCSI storage are also available out-of-tree at Microsoft/K8s-Storage-Plugins
This file has been truncated, but you can view the full file.
Version: 18.04.0-ce-win62 (17153)
Channel: microsoft-build-2018
Sha1: f2294279c791c16440ab36c50d9bd7b1c439ad83
Started on: 2018/04/18 00:23:17.362
Resources: C:\Program Files\Docker\Docker\Resources
OS: Windows 10 Pro
Edition: Professional
Id: 1709
Build: 16299
BuildLabName: 16299.15.amd64fre.rs3_release.170928-1534
@PatrickLang
PatrickLang / .gitignore
Last active July 13, 2018 00:21
Steps for setting up a Kubernetes 1.9 cluster on Azure with acs-engine
# vim giblets
*.swp
*.swo
*~
# if you run the sample step by step, these will contain secrets
*secret.json
# output from acs-engine
_output/
translations/
@PatrickLang
PatrickLang / README.md
Last active February 6, 2018 20:27
Terraforming a Windows Server Insider VM to Azure

Convert VHD

From an admin powershell prompt: Convert-VHD .\Windows_InsiderPreview_Server_VHDX_17079.vhdx .\Windows_InsiderPreview_Server_VHDX_17079.vhd

Remaining steps are done with Windows Subsystem for Linux