Skip to content

Instantly share code, notes, and snippets.

View ranieuwe's full-sized avatar
🌦️

Roeland Nieuwenhuis ranieuwe

🌦️
View GitHub Profile
@ranieuwe
ranieuwe / FetchLogs.ps1
Created February 2, 2024 23:57
Fetches logs from Directory Logs to process them or send elsewhere.
$GetDate = (Get-Date).AddDays((-1))
$dateFormatForQuery = $GetDate.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
# Getting Azure context for the API call
$currentContext = Get-AzContext
# Fetching new token
$azureRmProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = [Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient]::new($azureRmProfile)
@ranieuwe
ranieuwe / DeleteRegs.ps1
Last active February 1, 2021 18:47
Delete all AAD service principals and enterprise app registrations
# This is a quick way to delete all enterprise applications when you want to delete
# an AAD tenant in some cases some of the Enterprise Apps have dangling service principals
# that are hard to see.
# This script iterates over all the principals and tries delete what it can so that that
# the tenant can be deleted. You will see warnings as some service principals can not
# be deleted. This is fine.
## WARNING --- WARNING -- MAKE SURE TO RUN THIS ON THE CORRECT TENANT --- WARNING --- WARNING
curl https://api.github.com/repos/MicrosoftDocs/dynamics-365-customer-engagement/contents/ce | jq -r '.[] | select(.type | contains("dir")) | "https://docs.microsoft.com/en-us/dynamics365/customer-engagement/opbuildpdf/\(.name)/TOC.pdf?branch=live \(.name).pdf"'| while read -r url name tail; do wget -O $name $url; done
{
"fileUris": ["https://gist.githubusercontent.com/ranieuwe/3eded982188389f8128af2f5da719d21/raw/b76611249412aa332d9e666eb27dbf71ed95f80e/dlvm-cntk-conv3d-prep.sh"],
"commandToExecute": "./dlvm-cntk-conv3d-prep.sh"
}
#!/bin/bash
# export DEBIAN_FRONTEND=noninteractive
whoami
# Update APT and packages
sudo apt-get -y update
sudo apt-get -y upgrade
sudo /anaconda/envs/py35/bin/pip install https://cntk.ai/PythonWheel/GPU-1bit-SGD/cntk-2.4-cp35-cp35m-linux_x86_64.whl
sudo /anaconda/envs/py35/bin/pip install --upgrade imageio
#!/bin/bash
@ranieuwe
ranieuwe / configuration.xml
Last active October 31, 2017 20:42
Office 365 configuration
<Configuration>
<Add OfficeClientEdition="64" Channel="Monthly">
<Product ID="O365ProPlusRetail">
<Language ID="en-us"/>
<Language ID="nl-nl"/>
</Product>
<Product ID="VisioProRetail">
<Language ID="en-us"/>
</Product>
<Product ID="LanguagePack">
@ranieuwe
ranieuwe / boxstarter.ps1
Last active January 19, 2023 07:23
Boxstarter bootstrap
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
#
@ranieuwe
ranieuwe / grab-azure-docs.sh
Last active March 28, 2020 16:31
Grabs a PDF copy of all Azure docs
for row in $(curl https://api.github.com/repositories/72685026/contents/articles | jq -c -r '.[] | select(.type | contains("dir")) | "\(.name)"'); do wget -O "${row}.pdf" "https://docs.microsoft.com/en-us/azure/opbuildpdf/${row}/toc.pdf?branch=live"; done