Skip to content

Instantly share code, notes, and snippets.

View timmyreilly's full-sized avatar
👨‍🚀
Focusing

Tim Reilly timmyreilly

👨‍🚀
Focusing
View GitHub Profile

1. Git flow

Fork the project, and clone to your machine from the fork.

Get your local main branch up to date with upstream's main branch:

git fetch upstream
git checkout main
@timmyreilly
timmyreilly / .gitignore
Created August 1, 2022 17:42
Giant Git Ignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
@timmyreilly
timmyreilly / service_connection_instructions.md
Last active January 28, 2022 18:21
Getting the most out of service accounts

v 1.0

Setting up a service account for azure devops and kubernetes

Service accounts in Kubernetes allow you to enforce RBAC for all Kubernetes resources in your cluster. Service connections in Azure Devops allow you to use RBAC policies for infrastructure, including Kubernetes clusters.

Asserting RBAC on all systems that have an associated cost to operate is a great start to keeping costs under control.

Service accounts are neat, they allow processes impersonate a user and do things. Kinda like a computer/av system in a conference room. ie: you send a meeting request to an email account to include the conference in your meeting. It has the side effect of keeping people out of the room, but it needs a reference in the system so that it can be addressed accurately. Anyways... let's say we want to accurately address a computer capable of sending 10000000 pods to the cluster. That might get expensive if it can do it willy-nilly and anything with costs associated shouldn't be willy-nilly.

resource "azurerm_template_deployment" "event_grid" {
name = "event-grid-deployment"
resource_group_name = "${var.rg_name}"
template_body = <<DEPLOY
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageName": {
@timmyreilly
timmyreilly / main.tf
Created December 4, 2018 20:43
Terraform Main.tf for Azure Event Grid Subscription from Azure Storage to EventHub.
resource "azurerm_resource_group" "test" {
name = "tempresourceGroup1"
location = "West US"
}
resource "azurerm_eventhub_namespace" "test" {
name = "demo-EventHubNamespace"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
@timmyreilly
timmyreilly / README.md
Created November 21, 2018 00:11
ARM Template for Azure Storage to create an Event Grid Subscription and point it at and Existing EventHub

Event Grid

Event grid from a new storage account to event hub:

az login
az group create --name ExampleGroup --location "West US"
az group deployment create --name exampleDep --resource-group ExampleGroup --template-file .\event-hub\armStorageToEventHubEndpoint.json

"Please provide string value for 'endpoint' eg: 
/subscriptions/1230123-1234-1234-1234-123456789012/resourceGroups/resourceGroup1/providers/Microsoft.EventHub/namespaces/tim-acceptanceTestEventHubNamespace/eventhubs/tim-testeventhub
@timmyreilly
timmyreilly / index.js
Last active October 24, 2018 17:31
A JavaScript Function that uses a cosmos db mongo client to validate and create a document (Thank you Denis K.)
// Method: POST
// Body:
// {
// "userId": "cc20a6fb-a91f-4192-874d-132493685376",
// "productId": "4c25613a-a3c2-4ef3-8e02-9c335eb23204",
// "locationName": "Sample ice cream shop",
// "rating": 5,
// "userNotes": "I love the subtle notes of orange in this ice cream!"
// }
var rp = require('request-promise-native');
#!/usr/bin/env bash
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive
# The only change so far is removing this line: sudo rm /etc/apt/apt.conf.d/*.*
sudo apt update
sudo apt install unzip -y
sudo apt -y upgrade --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
@timmyreilly
timmyreilly / arduinolinks.txt
Last active October 17, 2017 17:56
Arduino Workshop Links
@timmyreilly
timmyreilly / ConnectingToAzureSQLFromPython
Created October 13, 2017 23:02
Using Flask_SQLAlchemy to connect to Azure SQL
#!/usr/bin/env python
import os
import urllib.parse
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
# Configure Database URI:
params = urllib.parse.quote_plus("DRIVER={SQL Server};SERVER=sqlhost.database.windows.net;DATABASE=pythonSQL;UID=username@sqldb;PWD=password56789")