This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
This is a fairly simple one-time upload with no options, etc. Consider using this as a base to create a New-GDriveItem type function | |
Modified code, in response to: https://monteledwards.com/2017/03/05/powershell-oauth-downloadinguploading-to-google-drive-via-drive-api/ | |
You should follow the above link to set $accessToken to your access token and understand what is happening here | |
#> | |
# Change this to the file you want to upload | |
$SourceFile = 'C:\Path\To\File' | |
# Get the source file contents and details, encode in base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Schedule Nessus scans based around the Microsoft patch cycle | |
#> | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)][String]$ComputerName, | |
[Int]$Port = 8834, | |
[Parameter(Mandatory=$true)][String]$ScanFolder, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Edit nessus scan details, including schedule, name, and policy data | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a list of posts from reddit.com/r/sysadmin front page | |
$posts = Invoke-RestMethod 'https://www.reddit.com/r/sysadmin/.json' | |
# Get the URL for the patch tuesday megathread | |
$megathread = $posts.data.children.data.Where{$_.title -like '*Patch Tuesday Megathread*'} | |
$megathreadUrl = $megathread.Url | |
# Get the comments of the megathread | |
$comments = Invoke-RestMethod "$megathreadUrl.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var homeStatus = msg.payload.data.state | |
var homeStatusMinutes = Math.floor((msg.payload.timeSinceChangedMs/1000)/60) | |
var notHome = (homeStatus == "not_home" && homeStatusMinutes >= 10) | |
var ecobeeStatus = flow.get("ecobeeStatus") | |
var holdMode = ecobeeStatus.data.attributes.hold_mode | |
var climateMode = ecobeeStatus.data.attributes.climate_mode | |
var operationMode = ecobeeStatus.data.attributes.operation_mode | |
// Set the holdMatch criteria based on whether we're home or not, this is so we don't cancel temp or vacation holds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set our options | |
$RefreshToken = '' | |
$ClientID = '' | |
$ClientSecret = '' | |
$spreadsheetId = '' # Get this from the URL: https://docs.google.com/spreadsheets/d/{spreadsheetId} | |
$sheetId = '' # Get this from gid= in the URL | |
# Set the Google Auth parameters | |
$params = @{ | |
Uri = 'https://accounts.google.com/o/oauth2/token' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[general] | |
cfg_schema = 1 | |
ColumnCount = 3 | |
UseWorkarea = True | |
ModMask = <Mod4> | |
MovementsWrap = True | |
[keys] | |
C = move-to-center | |
H = horizontal-maximize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertFrom-Hsl { | |
param( | |
$Hue, | |
$Saturation, | |
$Lightness, | |
# Return in ConEmu.xml ABGR hex format | |
[Switch]$ABGR | |
) | |
function ToHex ($c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateYnabHomeZestimate() { | |
var accessToken = 'YNAB token goes here' // Your YNAB Personal Access Token | |
var zwsid = 'zwsid goes here' // Your Zillow ZWSID | |
var budgetName = 'budget name goes here' // The name of your budget | |
var accountName = 'home value account name goes here' // The name of your home value tracking account | |
var address = '1657 Notrealaddress Drive, Redding, CA 96001' // Home address | |
// YNAB API settings | |
var url = 'https://api.youneedabudget.com/v1' | |
var headers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// YNAB Weekly Spending Report sending script | |
function sendYnabReport() { | |
// Set our options | |
var accessToken = 'token goes here' // Your YNAB Personal Access Token | |
var budgetName = "Connor's Budget" // Budget name to use, in case you have multiple budgets | |
var categories = ['Sports & Wellness', 'Food & Drink', 'Housing'] // Your desired category groups to monitor, in Javascript array syntax | |
var recipient = 'test@example.com, test2@example.com' // Email recipients, comma separated | |
// API stuff | |
var url = 'https://api.youneedabudget.com/v1' |
OlderNewer