Skip to content

Instantly share code, notes, and snippets.

View ChrisRomp's full-sized avatar
:shipit:
I :octocat: Codespaces.

Chris Romp ChrisRomp

:shipit:
I :octocat: Codespaces.
View GitHub Profile
@ChrisRomp
ChrisRomp / JSLink_NewLinkOverride.js
Last active June 26, 2017 16:24
SharePoint JSLink/CSR to Override New Item Toolbar Link

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@ChrisRomp
ChrisRomp / main.tf
Last active September 3, 2021 22:41
Terraform Function App with Encrypted Storage and VNet Isolation
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.74.0"
}
}
}
# data "azurerm_client_config" "current" {}
@ChrisRomp
ChrisRomp / script.sh
Created October 7, 2021 23:34
Create Service SAS Token for Azure Storage REST API with Service Principal
# Using Service Principal
tenantid=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
clientid=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
clientsecret=xxx....xxxx
# Reqeust Bearer Token
token=$(curl -s -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
-d "grant_type=client_credentials&resource=https%3A%2F%2Fmanagement.azure.com%2F&client_id=$clientid&client_secret=$clientsecret" \
"https://login.microsoftonline.com/$tenantid/oauth2/token" | jq -r .access_token)
@ChrisRomp
ChrisRomp / bouncie.json
Last active October 12, 2021 19:05
Script to pull data from the Bouncie API - https://www.bouncie.dev
{
"client_id": "",
"client_secret": "",
"grant_type": "authorization_code",
"code": "",
"redirect_uri": ""
}
@ChrisRomp
ChrisRomp / app.py
Created October 14, 2021 18:02
Example of authenticating to Azure Storage Blob service with AD-delegated SAS key using the machine/service managed identity
import xml.dom.minidom
import html
from datetime import datetime, timedelta
import requests
from azure.identity import ClientSecretCredential, ManagedIdentityCredential
from azure.storage.blob import BlobServiceClient, generate_container_sas, AccountSasPermissions
from flask import Flask
app = Flask(__name__)
@ChrisRomp
ChrisRomp / azure-pipelines.yml
Created May 24, 2022 18:09
Azure Pipelines - OpenSSL Add ISRG Root X1 Cert
trigger:
- main
pool:
vmImage: windows-latest
steps:
# Get OpenSSL Version
- powershell: openssl version -a
displayName: Get OpenSSL Version
@ChrisRomp
ChrisRomp / 01-upload-akv-gpg-keys.ps1
Last active August 4, 2022 19:35
Azure Key Vault GPG Key Management
# Export and upload GPG keys to Azure Key Vault
$UserId = "" # GPG email address
$SecretKeyName = "github-gpg-secret-key"
$PublicKeyName = "github-gpg-public-key"
$KeyVaultName = "" # Key Vault Name
$SecretKeyFile = ".\sk.asc"
$PublicKeyFile = ".\pk.asc"
# Send Private Key
$(gpg --armor --export-secret-keys --with-fingerprint $UserId) | Out-File $SecretKeyFile
@ChrisRomp
ChrisRomp / builds.http.txt
Created September 2, 2022 18:37
ADO Get Build Changes API workaround for 200 item limitation
@adoUser = {{$dotenv ADO_USER}}
@adoPat = {{$dotenv ADO_PAT}}
@adoOrg = YourAdoOrg
@adoProject = YourAdoProject
@buildId = 123
### Get Build Properties
# @name buildProps
GET https://{{adoUser}}:{{adoPat}}@dev.azure.com/{{adoOrg}}/{{adoProject}}/_apis/build/builds/{{buildId}}?api-version=7.1-preview.7
@ChrisRomp
ChrisRomp / asb1.http.txt
Last active September 13, 2022 15:17
Azure Service Bus AD Auth
@tenantId = {{$dotenv TENANTID}}
@subId = {{$dotenv SUBID}}
@clientId = {{$dotenv CLIENTID}}
@clientSecret = {{$dotenv CLIENTSECRET}}
@sbName = {{$dotenv SBNAME}}
@sbUrl = https://{{sbName}}.servicebus.windows.net
###
# Get OAuth Token
# @name getToken