Skip to content

Instantly share code, notes, and snippets.

View mrjamiebowman's full-sized avatar
🚀
git er' done

Jamie Bowman mrjamiebowman

🚀
git er' done
View GitHub Profile
@mrjamiebowman
mrjamiebowman / logs-errors.sql
Last active March 6, 2021 16:45
SQL Error Logs
CREATE SCHEMA logs AUTHORIZATION dbo
CREATE TABLE [logs].[Errors](
[ErrorId] [int] IDENTITY(1,1) NOT NULL,
[UserName] [varchar](100) NULL,
[ErrorNumber] [int] NULL,
[ErrorState] [int] NULL,
[ErrorSeverity] [int] NULL,
[ErrorLine] [int] NULL,
[ErrorProcedure] [varchar](max) NULL,
# jupyter notebooks
.ipynb_checkpoints
# terraform
terraform/.terraform
terraform/variables.tf
**/*.tfstate
**/*.tfstate.backup
# appsettings
@mrjamiebowman
mrjamiebowman / kube-debug.ps1
Created February 11, 2021 15:29 — forked from pavel-agarkov/kube-debug.sh
Script for starting remote debugging of dotnet app in kubernetes from Visual Studio 2019
$SELECTOR = ""
# searching for the pod to connect to by selector and namespace
$POD=`kubectl get pods -n $NAMESPACE --selector=$SELECTOR -o jsonpath='{.items[0].metadata.name}'`;
Write-Host "POD: " + $POD
# starting remote debugger that we installed earlier inside our docker image
#kubectl exec $POD -n $NAMESPACE -i -- ../vsdbg/vsdbg --interpreter=vscode;
@mrjamiebowman
mrjamiebowman / helm-generate-dockersecret.ps1
Last active February 23, 2021 01:44
Kubernetes Generate Docker Secret with PowerShell
$registry = "docker.io"
$username = "mrjamiebowman"
$password = Read-Host "Enter a Password" -MaskInput
kubectl create secret docker-registry dockercred --docker-server=$registry --docker-username=$username --docker-password=$password -o jsonpath="{.data.\.dockerconfigjson}"
apiVersion: v1
kind: Service
metadata:
name: kubernetes-tutorial
namespace: mrjamiebowman
spec:
type: LoadBalancer
ports:
- port: 80
selector:
@mrjamiebowman
mrjamiebowman / kubernetes-tutorial-deployment-configmap.yaml
Last active January 13, 2021 01:23
Kubernetes Tutorial: ConfigMap Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: kubernetes-tutorial
namespace: mrjamiebowman
labels:
app: kubernetes-tutorial
spec:
replicas: 1
selector:
@mrjamiebowman
mrjamiebowman / kubernetes-tutorial-configmap.yaml
Last active January 13, 2021 01:23
Kubernetes Tutorial: ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: appsettings
namespace: mrjamiebowman
data:
appsettings.json: |-
{
"Logging": {
"LogLevel": {
@mrjamiebowman
mrjamiebowman / SqlPermsHealthCheck.cs
Created September 24, 2020 12:54
.NET Health Check SQL Permissions
public class SqlPermsHealthCheck : IHealthCheck
{
private string sql = @"SELECT
p.name,
p.schema_id,
schema_name = sch.name,
has_perms_by_name(p.name, 'OBJECT', 'EXECUTE') as has_execute,
has_perms_by_name(p.name, 'OBJECT', 'VIEW DEFINITION') as has_view_definition
FROM sys.procedures p
LEFT JOIN sys.schemas sch ON sch.schema_id = p.schema_id
#!/bin/bash
# add sbin to path
export PATH=$PATH:/usr/sbin/
echo $PATH
sudo apt update && sudo apt full-upgrade -y
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
@mrjamiebowman
mrjamiebowman / ApplicationInfoHelper.cs
Created March 28, 2020 19:28
Application Info Helper (Returns Application Name, Version using C# Reflection)
public static class ApplicationInfoHelper
{
public static string ApplicationName
{
get {
var name = (((System.Reflection.Assembly.GetExecutingAssembly().FullName).Split()))[0]);
return item.Substring(0, name.length - 1);
}
}