Skip to content

Instantly share code, notes, and snippets.

View mtellin's full-sized avatar

Mike Tellinghuisen mtellin

View GitHub Profile
# --------------------------------------------------
#
# Mike Tellinghuisen
# 2017-04-10
# Loop through NSX non-Universal IP Sets and create
# Universal IP sets from them. Non-Universal IP sets
# are not removed during this script.
#
# --------------------------------------------------

Infrastructure Queries

  • Show current problems within the monitored environment
    problem

  • Show list of changes within the monitored environment
    change

  • See which Controller is responsible for each VNI
    controller of vxlan group by controller

# This will return the list of NSX Security Groups that are backed by Active Directory Groups for you to review
Get-NsxSecurityGroup | Where {$_.InnerXml -like "*DirectoryGroup*"}
# Alternatively, to also remove the security groups as part of the command
# Note: you will be prompted to confirm the group(s) it finds
Get-NsxSecurityGroup | Where {$_.InnerXml -like "*DirectoryGroup*"} | Remove-NsxSecurityGroup
@mtellin
mtellin / Rubrik-Python-Without-SDK.py
Created March 9, 2019 02:32
Shows getting a list of all VMs using the requests module instead of the Rubrik SDK
#!/usr/bin/env python3
rubrik_server = "10.0.11.14"
rubrik_user = "admin"
rubrik_pass = "password"
import requests
session = requests.post('https://{}/api/v1/session'.format(rubrik_server), verify = False, auth =(rubrik_user,rubrik_pass))
session_token = session.json()
authorization = 'Bearer ' + session_token['token']
@mtellin
mtellin / check_rclone_version.py
Last active March 22, 2019 19:40
Post to my home Slack channel when a new version of rclone is released. Uses kvdb.io as the key/value store for current version.
import requests
import os
from bs4 import BeautifulSoup
# Set environment variables for the following items
slackToken = os.environ['SLACK_TOKEN']
kvdbId = os.environ['KVDB_ID']
rcloneLogo = os.environ['RCLONE_LOGO']
# Pull the rClone page and use BeautifulSoup to parse
@mtellin
mtellin / culvers_fotd.py
Last active December 16, 2020 16:42
My most pathetic script yet. Checks local Culver's for the Flavor of the Day ice cream and sends a message to Slack when it is Bonfire S'mores.
#!/usr/bin/env python3
# Script to check Culver's and alert when it's bonfire smores
import requests
import os
from bs4 import BeautifulSoup
# Set environment variables for the following items
slackToken = os.environ['SLACK_TOKEN']
culversLogo = os.environ['CULVERS_LOGO']
city = os.environ['CULVERS_CITY']
@mtellin
mtellin / sql-demo.sql
Last active February 12, 2020 15:05
Workflow for walking through an item level recovery with Rubrik for SQL Server database.
-- Show files
SELECT name, physical_name AS current_file_location,(size *8) /1024 AS size_MB
FROM sys.master_files
-- Good data
SELECT * FROM AdventureWorks2014.Sales.SalesPersonQuotaHistory;
-- Uh oh....
DELETE FROM AdventureWorks2014.Sales.SalesPersonQuotaHistory;