Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Tellinghuisen mtellin

View GitHub Profile
@mtellin
mtellin / sql-demo.sql
Last active Feb 12, 2020
Workflow for walking through an item level recovery with Rubrik for SQL Server database.
View sql-demo.sql
-- 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;
@mtellin
mtellin / culvers_fotd.py
Last active Mar 19, 2020
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.
View culvers_fotd.py
#!/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 / check_rclone_version.py
Last active Mar 22, 2019
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.
View check_rclone_version.py
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 / Rubrik-Python-Without-SDK.py
Created Mar 9, 2019
Shows getting a list of all VMs using the requests module instead of the Rubrik SDK
View Rubrik-Python-Without-SDK.py
#!/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']
View Get-NSX-SG-Backed-AD.ps1
# 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
View vRealize Network Insight Search Queries.md

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

View NSX Create Universal IP Sets from Local IP Sets.ps1
# --------------------------------------------------
#
# 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.
#
# --------------------------------------------------
You can’t perform that action at this time.