Skip to content

Instantly share code, notes, and snippets.

View dorkmatt's full-sized avatar
🏳️‍🌈

Matt Peterson dorkmatt

🏳️‍🌈
View GitHub Profile
@dorkmatt
dorkmatt / 1wire_text_collector.py
Created December 29, 2018 19:16
prometheus node_exporter digitemp text_collector
#!/usr/bin/env python
# from 35c3 event, dump digitemp 1wire sensor data in prometheus text collector format
# Inspired by SuperQ's node_exporter/text_collector_examples/ntpd_metrics.py
# Author: Matt Peterson <matt@peterson.org>
import subprocess
import sys
digitemp_command = ['digitemp_DS9097U','-q','-a','-o%R %C','-c','/root/.digitemprc']
@dorkmatt
dorkmatt / netbox_optics_audit.py
Last active June 28, 2022 11:32
Netbox Juniper/Arista optics audit
#!/usr/bin/env python
#
# Fetch list of Juniper/Arista devices via Netbox, query optics info via Netconf, write to CSV file
#
# Written at 34c4 in Leipzig, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@dorkmatt
dorkmatt / gist:e728a6f50372d710186c2b75e3b10477
Created September 22, 2016 01:04
Ansible DNSMadeEasy example
---
- name: "DNSMadeEasy example"
hosts: localhost
vars:
dnsmadeeasy_api_key: "YOUR API KEY" # https://cp.dnsmadeeasy.com/account/info
dnsmadeeasy_api_secret: "YOUR API SECRET"
dns_entries:
- { record_name: '10', record_type: 'PTR', record_value: 'xe-2-0-1.sfo01.example.net.', domain: '2.0.192.in-addr.arpa' }