Skip to content

Instantly share code, notes, and snippets.

Avatar
🍾
Doing something weird with GitHub Actions

Matt Elliott shamsway

🍾
Doing something weird with GitHub Actions
View GitHub Profile
@shamsway
shamsway / network_backup.py
Last active May 1, 2020
Copy oxidized network config backups to a managed volume
View network_backup.py
import rubrik_cdm
import urllib3
import os
import shutil
import logging
urllib3.disable_warnings()
rubrik = rubrik_cdm.Connect()
mvname = 'network-backups'
networkconfigs = '/etc/oxidized/configs'
@shamsway
shamsway / lambda-function.py
Created Jan 21, 2020
YNAB Alert via AWS Lambda
View lambda-function.py
from botocore.vendored import requests
import json
import boto3
def lambda_handler(event, context):
api_key = "[YOUR API KEY]"
category1 = "[YOUR BUDGET CATEGORY ID]"
url = "https://api.youneedabudget.com/v1/budgets/last-used/months/current/categories/{}".format(category1)
@shamsway
shamsway / Refresh-vCD.ps1
Last active Oct 14, 2019
VMworld 2019 HBI3518BUS Examples
View Refresh-vCD.ps1
# Trigger CDM to refresh metadata from vCD
# Updated 10.14.19 to utilize new vCD-specific cmdlets in the PowerShell SDK for Rubrik
Import-Module Rubrik
$Key = "[API key]" # Key must be assigned to a user with Admin credentials to trigger metadata refresh
$vcdid = "[ID of vCD Server] # Ex: Vcd:::f96a2b1b-a06d-4f17-b6be-52141795532e
# Connect to Envoy, or CDM
Connect-Rubrik -Server [Server:Port] -Token $Key | Out-Null
You can’t perform that action at this time.