Skip to content

Instantly share code, notes, and snippets.

@noelbundick
noelbundick / LICENSE
Created Apr 22, 2020
WSL2 clock skew hack
View LICENSE
MIT License
Copyright (c) 2020 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
View README.md

This was an experiment in WSL interop from way back in May 2018. My goal was to be able to type noel-pc123 from a bash terminal and immediately launch into an RDP session. Should still work!

msrdp-template.rdp

  • This file is used with mstsc.exe to launch a remote desktop session
  • This file must be encoded as UTF-16
  • Replace the following values with your own:
    • DOMAIN\user: the credentials you will use for your connection
    • mygateway.example.com: the gateway server used for your connection (if unused - just remove the whole line)
@noelbundick
noelbundick / README.md
Created Sep 19, 2019
Quick notes - subscription vs resource groups
View README.md

Some quick thoughts on using many Azure subscriptions vs many resource groups in one subscription

  • Limits are applied at the subscription (+ sometimes region) level. If one RG uses 500 cores, other business units may be blocked until you open a support request.
  • Preview features are applied at the subscription level - other RG's can't opt-in/out. Ex: if you wanted to use the AKS + VMSS preview, you need to be sure that all teams want (and can support) the feature
  • This is really hit & miss, but there are some actions that can't be performed based on other resources being present in the same subscription

https://docs.microsoft.com/bs-latn-ba/azure/storage/common/storage-auth-aad-rbac-portal

If your subscription includes an Azure DataBricks namespace, roles assigned at the subscription scope will be blocked from granting access to blob and queue data.
@noelbundick
noelbundick / Dockerfile
Created Jun 28, 2019
How to use Docker build secrets
View Dockerfile
# syntax = docker/dockerfile:1.0-experimental
FROM python:3.7-alpine AS builder
WORKDIR /app
COPY . .
# mount the secret in the correct location, then run pip install
RUN --mount=type=secret,id=pipconfig,dst=/etc/pip.conf \
pip install -r requirements.txt
@noelbundick
noelbundick / Dockerfile
Last active Jun 23, 2020
Consuming packages from a private Azure Pipelines Python artifact feed
View Dockerfile
# We set an environment variable in this phase so it gets picked up by pip, but we don't want to bake secrets into our container image
FROM python:3.6-alpine AS builder
ARG INDEX_URL
ENV PIP_EXTRA_INDEX_URL=$INDEX_URL
COPY requirements.txt .
RUN pip install -U pip \
&& pip install --user -r requirements.txt
@noelbundick
noelbundick / README.md
Created May 17, 2019
Azure CLI Extensions
View README.md
@noelbundick
noelbundick / azuredeploy.json
Created Apr 15, 2019
Do as I say, not as I do
View azuredeploy.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "noelbundick"
},
"customHostname": {
"type": "string",
@noelbundick
noelbundick / azuredeploy.json
Created Feb 4, 2019
Subscription role assignment
View azuredeploy.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"utilityIdentityId": {
"type": "string"
}
},
"variables": {
"contributorRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
@noelbundick
noelbundick / LICENSE
Created Jan 13, 2019
Gists as a content management system
View LICENSE
MIT License
Copyright (c) 2019 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@noelbundick
noelbundick / LICENSE
Last active Jan 12, 2019
Azure Function w/ User Assigned Identity
View LICENSE
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
You can’t perform that action at this time.