Skip to content

Instantly share code, notes, and snippets.

View bbrandys's full-sized avatar

Brandy Smith bbrandys

  • Grafana Labs
  • Dallas, TX
  • 21:56 (UTC -05:00)
View GitHub Profile
@Lowess
Lowess / DatabricksPushgatewayExporter.py
Last active December 13, 2024 07:21
Databricks Prometheus Integration
import os
import threading
import urllib.request
import logging
from time import sleep
__author__ = "Florian Dambrine <[email protected]>"
class DatabricksPushgatewayExporter:
"""
@fl64
fl64 / main.go
Created December 24, 2020 07:18
golang prometheus exporter example
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"math/rand"
"net/http"
"time"
@nivleshc
nivleshc / ansible-aws-inventory-main-05.yml
Created April 16, 2019 01:39
Part 5 of ansible-aws-inventory-main.yml file
tasks:
- name: initialise output files with headers
lineinfile:
state: present
create: yes
path: "{{ lookup('vars', item + outputfile_variablename_suffix) }}"
line: "{{ lookup('vars', item + outputfileheader_variablename_suffix) }}"
insertbefore: BOF
with_items:
- vpc
@nivleshc
nivleshc / ansible-aws-inventory-worker.yml
Created April 12, 2019 03:46
Ansible Inventory Worker file. This is the file which actually carries out all the inventory tasks. It is called by the main file
# Name: ansible-aws-inventory-worker.yml
# Description: this is the worker file that called the main file (ansible-aws-inventory-main.yml) to to create an inventory of all the
# specific aws resources. This file, the worker file and the ansible inventory file must be placed in the same folder
# Prerequisites:
# - the worker file (ansible-aws-inventory-worker.yml) and the ansible hosts file must be present in the same folder as this file (ansible-aws-inventory-main.yml)
# - this script requires read access to all resources it will be querying. An AWS IAM user account must be created with the necessary permissions and with access keys enabled.
# At a minimum, to query all the resources mentioned above, the following permissions are required
# - AmazonVPCReadOnlyAccess
# - AmazonEC2ReadOnlyAccess
# - ElasticLoadBalancingReadOnly
@nivleshc
nivleshc / ansible-aws-inventory-main.yml
Created April 12, 2019 03:43
The main inventory file - declare variables here. This calls the worker file (which must be prese
---
# Name: ansible-aws-inventory-main.yml
# Description: this is the main file that calls the worker file (ansible-aws-inventory-worker.yml) to create an inventory of all the
# specific aws resources.
# Below are the resources that will be inventoried
# - vpc
# - subnet
# - igw
# - cgw
# - vgw
@joaoferrao
joaoferrao / caws_part_part_1.go
Last active July 25, 2022 16:33
caws_part_1
// TraceableRegions is a list of AWS regions we want to crawl
var TraceableRegions = [...]string{"us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1"}
// SingleResource defines how we want to describe each AWS resource
type SingleResource struct {
Region *string
Service *string
Product *string
Details *string
ID *string