Skip to content

Instantly share code, notes, and snippets.

Jon Gallant jongio

Block or report user

Report or block jongio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aksmanagedclusterfreesku.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"clusterName": {
"type": "string",
"defaultValue": "aks101cluster",
"metadata": {
"description": "The name of the Managed Cluster resource."
}
View temp.cs
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using Azure.Core;
using Azure.Core.Diagnostics;
using Azure.Identity;
using DotNetEnv;
namespace azid
{
View adfauth.cs
using System;
using System.Threading.Tasks;
using Microsoft.Identity.Client;
using System.Text;
using System.Globalization;
using Microsoft.Azure.Management.DataFactory;
using Microsoft.Rest;
using Azure.Security.KeyVault.Secrets;
using Azure.Identity;
using Azure.Core;
View GraphAPIAuthTest.cs
using System;
using Azure.Identity;
namespace graphapitest
{
class Program
{
static void Main(string[] args)
{
var cred = new DefaultAzureCredential(new DefaultAzureCredentialOptions() { SharedTokenCacheUsername = "email@email.com" });
View pbiviz-pbiviz.json
{
"visual": {
"name": "liquidFillGauge",
"displayName": "liquidFillGauge",
"guid": "liquidFillGaugeCA6D0134FC6446EF90CC6934C9812269",
"visualClassName": "Visual",
"version": "1.0.0",
"description": "",
"supportUrl": "",
"gitHubUrl": ""
View postman-azure-iot-sas-token-pre-request-script.js
var iotHubName = pm.environment.get("iotHubName");
var iotHubKey = pm.environment.get("iotHubKey");
var iotHubTokenExpiration = pm.environment.get("iotHubTokenExpiration");
var iotHubPolicyName = pm.environment.get("iotHubPolicyName");
pm.globals.clear("iotHubSasToken"); // clear out token on first run.
// See this doc for details: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security
var resourceUri = encodeURIComponent(iotHubName + '.azure-devices.net'); // The resource uri
var expiry = Math.ceil((Date.now() / 1000) + iotHubTokenExpiration * 60); // Expire the token 60 minutes from now
View Postman-Azure-Active-Directory-Bearer-Token-Pre-Request-Script.js
pm.sendRequest({
url: 'https://login.microsoftonline.com/' + pm.environment.get("tenantId") + '/oauth2/token',
method: 'POST',
header: 'Content-Type: application/x-www-form-urlencoded',
body: {
mode: 'urlencoded',
urlencoded: [
{key: "grant_type", value: "client_credentials", disabled: false},
{key: "client_id", value: pm.environment.get("clientId"), disabled: false},
{key: "client_secret", value: pm.environment.get("clientSecret"), disabled: false},
@jongio
jongio / ssh-info-docker-vm-windows.sh
Last active Feb 4, 2020
It's not technically SSH, but here's how you can get root access to the VM that runs Docker on your Windows host.
View ssh-info-docker-vm-windows.sh
docker run --privileged -it -v /var/run/docker.sock:/var/run/docker.sock jongallant/ubuntu-docker-client
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh
chroot /host
View AzureIoTPostmanEnvironmentTemplate
subscriptionId:
clientId:
clientSecret:
tenantId:
deviceStorageAccountName:
deviceStorageAccountKey:
resourceGroupName:
resourceName:
resourceKey:
iotHubCreateDeleteName:
@jongio
jongio / visual.ts
Created Mar 7, 2017
radio slicer gists visual.ts
View visual.ts
module powerbi.extensibility.visual {
export class Visual implements IVisual {
private target: HTMLElement;
private selectionManager: ISelectionManager;
private selectionIds: any = {};
private host: IVisualHost;
private isEventUpdate: boolean = false;
constructor(options: VisualConstructorOptions) {
this.target = options.element;
You can’t perform that action at this time.