Skip to content

Instantly share code, notes, and snippets.

@billdeitrick
billdeitrick / sqsretrieve.py
Created February 13, 2019 16:47
Retrieve SQS Messages with Python and Boto3
import json
import boto3
import pickle
import sys
region_name = 'REGION'
queue_name = 'QUEUE-NAME'
aws_access_key_id = 'ACCESS-KEY-ID'
aws_secret_access_key = 'SECRET-ACCESS-KEY'
delete_messages = True
@billdeitrick
billdeitrick / giving_fund_from_list_example.py
Last active March 12, 2019 02:05
Example scripts using PyPCO.
"""
This sample script demonstrates how to iterate through the people
objects in a list and pull their giving records for a specific fund.
"""
import pypco
### Constants (change these for your environment) ###
# App IDs and Secrets
@billdeitrick
billdeitrick / teams_deploy.ps1
Last active October 18, 2019 03:22
This script deploys Microsoft Teams with "autoStart" set to false. This means that Teams won't start large and in charge automatically when the user logs in, until they've run the app for the first time. Works great pushed from Intune.
if ((Test-Path -Path "C:\Program Files (x86)\Teams Installer\setup.json") -eq $false) {
if ((Test-Path -Path "C:\IntunePSTeamsInstall") -eq $true) {
Remove-Item -Path "C:\IntunePSTeamsInstall" -Recurse -Force
}
New-Item -Path "C:\IntunePSTeamsInstall" -ItemType Directory -Force > $null
Set-Location -Path "C:\IntunePSTeamsInstall"
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Downloading installer file.")
Invoke-WebRequest -Uri "https://aka.ms/teams64bitmsi" -OutFile "Teams_windows_x64.msi" -UseBasicParsing
$found_file = Test-Path -Path "Teams_windows_x64.msi"
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Done downloading installer file. Files is present: $found_file")
@billdeitrick
billdeitrick / examview_install.ps1
Created October 18, 2019 03:47
An ExamView installation PowerShell script. Demonstrates symlinking data directories in %ProgramFiles(x86)% to user's OneDrive, and a few other workarounds.
# Script Variables
$LOGGING_SUBDIR = "custom_deploy\logs"
# Setup logging environment
## Make directory if it doesn't exist
$log_dir = ($env:ProgramData + "\" + $LOGGING_SUBDIR)
$log_path = ($log_dir + "\examview_install.log")
if (! (Test-Path -Path $log_dir)) {
@billdeitrick
billdeitrick / ir_ab_import.py
Created March 9, 2020 15:28
Canon ImageRunner Address Book Entry Automation with Python and Selenium WebDriver
import csv
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
DEPT_ID = '12345'
PASSWD = '12345'
HOST = 'example.com'
@billdeitrick
billdeitrick / Program.cs
Created February 28, 2021 19:14
Get Secret from Azure KeyVault Using Managed Identity - C#
using System;
using Azure.Security.KeyVault.Secrets;
using Azure.Identity;
namespace kvtest
{
class Program
{
static void Main(string[] args)
{