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
terraform { | |
required_providers { | |
azuread = { | |
source = "hashicorp/azuread" | |
} | |
} | |
} | |
# Authenticated via the Azure CLI | |
data "azuread_application_published_app_ids" "well_known" {} |
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
# Calls a Python script. The output of the print statement is saved in a Variable. | |
$pythonProgramPath = ".venv/bin/python" # location of the Python executable | |
$pythonScriptPath = "/python/powershell-call-python/main.py" # location of script file. | |
$arg = "hello" | |
$pythonOutput = & $pythonProgramPath $pythonScriptPath $arg | |
$pythonOutput |
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
# Print out input text from command line argument and exit. | |
# Used as demo to get data from Python Script in PowerShell. | |
import argparse | |
import sys | |
parser = argparse.ArgumentParser() | |
parser.add_argument("text") | |
args = parser.parse_args() | |
print(f"{args.text} From Python script.") | |
sys.exit() |
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
# Authenticate to the Airthings API and get the latest data from a particular device. | |
# Requires an API client created in the web gui: https://dashboard.airthings.com/integrations/api-integration | |
# Update script with client id and device id which can be retrieved from the devices page: https://dashboard.airthings.com/devices | |
# export the api secret to an environment variable called secret (Bash export secret="secret-key" | |
# Requires the requests package (pip install requests into the virutal environment of container). | |
# Python version 3.6 or above needed for f strings. | |
# Matthew Davis July 2022 | |
import os | |
import logging | |
import pprint |
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
# Python script to create JWKS public and private keys. | |
# Can be used when creating an Okta Oauth application. | |
# Requires https://github.com/latchset/jwcrypto | |
# https://developer.okta.com/docs/guides/implement-oauth-for-okta-serviceapp/main/ | |
# Warning: These key are being produced for automation which doesn't work well when there are password protected keys. | |
# Private keys without passwords provide an extreme security risk and should be handled securely and always encrypted at rest after generation. | |
# Please move the keys created in the keys directory to a secure location for use ASAP. | |
#%% | |
import os | |
import subprocess |
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
# Check remote | |
git remote -v | |
# Configuration | |
git config --global --list | |
git config --global user.name | |
git config --global user.email | |
git config --list | |
# for PowerShell set function to see graph |
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
# Unlock Western digital passport on linux | |
# https://github.com/0-duke/wdpassport-utils | |
# Need to run as sudo. | |
# May need to install sudo pip3 install pyudev | |
cd ~/Documents/western-digital | |
sudo ./wdpassport-utils.py --device /dev/sdb -u |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBGFZ+IsBEAC92IH/s5fpK9Um0tRrxP3QpLowc7hXSjpY4yv6l6H6cLzAZM7h | |
R9m+Wg2FPHg3/zLSblTXT1jNXQXj4CUJjhKve7YFRut1crsk7zMPmwlLgThHFqNp | |
BamcAZduLLQxDeS/OvSE7WV3FjZ5MbL80GDIQy+x7yh+CR2CWNXYM5El2ZzlEiO6 | |
uGKwJ1UkGeAz11nVr/iWQd8Un0B8D7NkpyIBPOWUgDAOcbm5anJrqbPDOfiecURE | |
73fNy/ZF/TZB0qMN5bad8m6SPSDt1yxBZUf+lZVdA3BsynqbXcAMjZt+/gm3iMGO | |
GDq3l27SZpU1xv3ynhZQvTgwbo7kH0rOkTWE1g/42wSRtqa8KGNnTdPNywsHwaah | |
63DhodsZaqv4buwN0dHSyaFXKxPSWEcE8iI2Te32heSD3lLPW4/T5kySYZVdZJIm | |
jemWmmAbgVJKhmorOrVsBmjVSh0DH9k9G4Bsm4Mc0ncJgoFtz3iJ8RjvC2olMaFX |
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
Error: Plugin did not respond | |
│ | |
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details. | |
╵ | |
Stack trace from the terraform-provider-okta_v3.13.8 plugin: | |
panic: runtime error: invalid memory address or nil pointer dereference | |
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xad46f5] |
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
''' | |
Query the Workday API using the Zeep package to return the details of the specified worker from their employee ID. | |
Details of the user and their password should be set in environment variables, like so in bash: | |
export user='' | |
export password='' | |
''' | |
import zeep, os | |
from zeep import Client | |
from zeep.wsse.username import UsernameToken |
NewerOlder