Skip to content

Instantly share code, notes, and snippets.

View smallsam's full-sized avatar
🏠
Working from home

Sam Richards smallsam

🏠
Working from home
  • talktosam
  • Brisbane, Australia
View GitHub Profile
@smallsam
smallsam / unimus.py
Created January 18, 2022 03:43
Unimus python API devices config backups
import requests
import base64
from datetime import datetime
from time import sleep
from urllib.parse import urljoin
class Unimus:
def __init__(self, url, token):
self.url = url
self.token = token
@smallsam
smallsam / puppet_csr_oid.py
Last active March 22, 2021 10:14
csr with puppet oid extension using cryptography
PUPPET_OIDS = {
 "ppCertExt": "1.3.6.1.4.1.34380.1",
 "ppRegCertExt": "1.3.6.1.4.1.34380.1.1",
 "pp_uuid": "1.3.6.1.4.1.34380.1.1.1",
 "pp_instance_id": "1.3.6.1.4.1.34380.1.1.2",
 "pp_image_name": "1.3.6.1.4.1.34380.1.1.3",
 "pp_preshared_key": "1.3.6.1.4.1.34380.1.1.4",
 "pp_cost_center": "1.3.6.1.4.1.34380.1.1.5",
 "pp_product": "1.3.6.1.4.1.34380.1.1.6",
 "pp_project": "1.3.6.1.4.1.34380.1.1.7",

Keybase proof

I hereby claim:

  • I am smallsam on github.
  • I am smallsam (https://keybase.io/smallsam) on keybase.
  • I have a public key ASAk4D3eVm9cID_ggs7qfIz8Dae2kwQ9nDOMipGa948dpgo

To claim this, I am signing this object:

@smallsam
smallsam / iperfd
Created April 6, 2018 01:51
iperf3 init script
#!/bin/sh
#
# iperf3 Iperf Server
#
# chkconfig: - 90 60
# description: iperf is an advanced bandwidth test tool
# processname: iperf3
# pidfile: /var/run/iperf3.pid
@smallsam
smallsam / esx_io_path_latency.ps1
Created January 5, 2018 06:06
Find ESX hosts with high storage path latency
add-pssnapin vmware*
connect-viserver vcenter
$start = (get-date).AddMinutes(-60)
$metric = "storagePath.totalWriteLatency.average"
$report = @()
$vmhosts = Get-VMHost