Skip to content

Instantly share code, notes, and snippets.

@dahlsailrunner
dahlsailrunner / vscode.md
Last active June 18, 2023 05:16
VS Code Notes

VS Code Notes

The following are some notes regarding my setup within VS Code for anyone that is curious.

Settings

  • Font: Cascadia Code (with ligatures)
  • Theme: Dracula -- see Extensions below
  • Workbench->Tree:Indent: 20. I like a little more indentation than is default -- it's easier to see diferrent levels / folders
  • Files->Exclude: I omit certain things from the VS Code Explorer to make focusing on the code easier:
 **/.git

Central Code within a Library or other location

You can create the following code in some central library or folder if desired:

public static IApplicationBuilder UseCustomSerilogRequestLogging(this IApplicationBuilder app, bool includeHealthChecks = false)
{
    return app.UseSerilogRequestLogging(options =>
    {
        if (!includeHealthChecks)
@dahlsailrunner
dahlsailrunner / Hugo-Notes.md
Last active June 18, 2023 05:17
Notes for working with Hugo on static websites

Hugo is a great platform for static website creation based on Markdown (or HTML) files.

Getting Started

First, install Hugo:

Creating a site

Just run the following command (a directory called quickstart will be created holding your site - replace the name with whatever you want):

@dahlsailrunner
dahlsailrunner / Local-Kubernetes.md
Last active August 13, 2024 10:48
Helpful tips and snippets for Kubernetes within Docker Desktop

Using the K8s Dashboard Locally

Actual repo is here: https://github.com/kubernetes/dashboard

1. Install the Dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml

2. Create a Sample User Account that can Access the Dashboard via Token

kubectl apply -f https://gist.githubusercontent.com/dahlsailrunner/bbd453f3bb6259b66c08a70d0908283f/raw/5727723217e2df4b65d8933adf04d009cfb0fe3f/local-dashboard-account.yml
@dahlsailrunner
dahlsailrunner / local-dashboard-account.yml
Created January 5, 2021 22:03
Local User Account for Kubernetes Dashboard
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
@dahlsailrunner
dahlsailrunner / WindowsTerminal.md
Last active August 16, 2024 08:06
Customization and Setup notes for Windows Terminal
@dahlsailrunner
dahlsailrunner / SSL-nginx-Docker.md
Last active November 21, 2024 19:07
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

@dahlsailrunner
dahlsailrunner / gist:217d10a5bcc3f0adb631062038547366
Created April 30, 2020 18:52
Kafka consumer for log entries
class Program
{
static void Main(string[] args)
{
Console.WriteLine($"Started consumer, Ctrl-C to stop consuming");
var cts = new CancellationTokenSource();
Console.CancelKeyPress += (_, e) => {
e.Cancel = true; // prevent the process from terminating.
cts.Cancel();
@dahlsailrunner
dahlsailrunner / SelfSignedCerts-IIS.md
Last active August 13, 2024 10:50
Selfsigned certs in IIS from PowerShell

Create Authority

New-SelfSignedCertificate -DnsName "KnowYourToolset Cert Authority" -CertStoreLocation "Cert:\LocalMachine\My" -KeyUsage CertSign,CRLSign

Creates root authority with permission to sign stuff

Export-Certificate -Cert Cert:\LocalMachine\My\<CERTHUMB> -FilePath kytroot.cer

Trust Authority

Import-Certificate -FilePath .\kytroot.cer -CertStoreLocation Cert:\LocalMachine\Root