Skip to content

Instantly share code, notes, and snippets.

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

Tim Reilly timmyreilly

👨‍🚀
Focusing
View GitHub Profile
@timmyreilly
timmyreilly / main.tf
Created May 8, 2024 21:04
Creating azure openai instance with model deployment
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
variable "prefix" {
description = "Prefix for the resources (rock1)"

Let's get it going manually...

First, let's set some parameters

vars

UNIQUE="chi2"
LOCATION=westus2

Network Gismos!

Hello! Thank you for coming! We're going to look at three different tools for inspecting our networks!

The first tool we'll use is called nmap, you can install it for unix environments or windows. It's a command line tool for assessing serviceable ports in networks. It is also helpful for groking network subneting and cidr notation.

Let's see what we get when we query some IP address...

@timmyreilly
timmyreilly / dump_content.py
Created January 24, 2024 22:41
Dump content from python console
"""
you're in the python debug terminal and you need to export some pydantic models for
"""
with open("data_point.json", "w") as file:
file.write(data_point.json())
with open("model_data.json", "w") as file:
file.write(results.json())
@timmyreilly
timmyreilly / cost_estimation.py
Created January 23, 2024 23:40
Get an estimate of GPT token usage and cost 2024
import argparse
import tiktoken
from pydantic import BaseModel, Field, field_validator
pricing = {
"GPT-3.5-Turbo": {"context_limit": 4000, "prompt": 0.0015, "completion": 0.002},
"GPT-3.5-Turbo-16K": {
"context_limit": 16000,
"prompt": 0.003,

Otel Configuration

az iot hub monitor-events -n iothub2-dev-eastus --props all

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": {