Skip to content

Instantly share code, notes, and snippets.

View BrianInAz's full-sized avatar
😁

Brian Charbonneau BrianInAz

😁
  • Arizona, USA
  • 06:11 (UTC -07:00)
View GitHub Profile
@josephspurrier
josephspurrier / values_pointers.go
Last active May 15, 2025 14:43
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@smoser
smoser / .gitignore
Last active April 1, 2024 07:38
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@s3rj1k
s3rj1k / HowTo
Last active May 4, 2025 21:37
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@dbkinghorn
dbkinghorn / user-data-server
Created September 28, 2021 21:49
Ubuntu 20.04 user-data files for autoinstall ISO
#cloud-config
autoinstall:
version: 1
refresh-installer: # start with an up-to-date installer
update: yes
interactive-sections: # Install groups listed here will wait for user input
- storage
storage: # should set the interactive default but doesn't seem to work??
layout:
name: direct
@pwalkr
pwalkr / ansible-docker-swarm-config.yaml
Created February 5, 2023 20:38
Automatic rotation of a docker swarm config using an ansible template
# This set of tasks rotates a swarm config by generating a config name.
# If input contents change, the hash changes, triggering a name change and restart of consuming service(s)
# Tasks should all `run_once` if multiple swarm managers are in play.
- hosts: swarm_manager
tasks:
- set_fact:
config_data: '{{ lookup("template", "templates/my-template.cfg") }}'
- name: create config
@mcucen
mcucen / mysql_minio_backup.sh
Created February 29, 2024 14:30
Backup MySQL data to Minio
#!/bin/bash
################################
# MySQL Backup to Minio Server #
################################
# We will use timestamp to create unique filenames. Also it allows us to know backup time.
TIMESTAMP=$(date +%Y%m%d%H%M%S)
# Source MySQL server connection information.
@mikepayne02
mikepayne02 / Grafana.scriptable
Last active April 1, 2025 08:43
iOS Grafana widgets using Scriptable and grafana-image-renderer
{
"always_run_in_app" : false,
"icon" : {
"color" : "orange",
"glyph" : "chart-area"
},
"name" : "Grafana",
"script" : "\/\/ Configuration\nconst url=\"http:\/\/grafana.example.com\",\ntoken=\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\norgId=1,\ndashboardName=\"widgets\",\ndashboardId=\"xxxxxxxxxxxxxx\",\ntz=\"America\/Chicago\",\ndarkMode=true,\ndeviceSize=\"393x852\";\n\nif(config.runsInWidget)return;\nconst e=config.runsInAccessoryWidget,n={small:\"s\",medium:\"m\",large:\"l\",extraLarge:\"x\",accessoryRectangular:\"r\",accessoryCircular:\"c\"}[config.widgetFamily]||\"m\",i=args.widgetParameter?.split(\",\")||[],w=i[0]||\"1\",S=i[1]||\"now-30m\",z=i[2]||\"now\",x=i[3]||\"Grafana\",t=i[4]||\"c\",c=Font.mediumSystemFont(12),r={s:new Size(474,474),m:new Size(500,210),l:new Size(500,500),x:new Size(500,500),r:new Size(480,216),c:new Size(216,216)},a={\"430x932\":{s:new Size(170,170),m:new Size(364,170),l:new Size(364,382),r:new Size(172,76),c:new Size(76,76)},\"428x926\":{s:new Size(1
@ruvnet
ruvnet / Gemini.md
Last active June 13, 2025 17:41
Free & Secure API Key Rotator for Google Gemini 2.5 Pro (Deno Edge Functions)

Great. I’ll develop a phased implementation plan, edge function code, deployment strategy, user guide, and full documentation for a key rotator using Deno Edge Functions. This will focus on rotating Gemini 2.5 Pro API keys to handle 429 rate limits efficiently.

I’ll return with a clear breakdown of components, including a secure architecture, key storage and cycling logic, usage limits, and guidance for setup and customization.

Secure API Key Rotator for Google Gemini 2.5 Pro (Deno Edge Functions)

Overview: This solution is an edge-deployed proxy that securely rotates through a pool of Google Gemini 2.5 Pro API keys to avoid hitting per-key rate limits (e.g. free-tier limit of ~2 requests/minute (Gemini 2.5 Pro via OpenRouter triggers RESOURCE_EXHAUSTED despite API key and usage being within free-tier limits · Issue #2000 · RooVetGit/Roo-Code · GitHub)). By