Skip to content

Instantly share code, notes, and snippets.

View sajeetharan's full-sized avatar
💭
Debugging "Object reference not set to an instance of an object." 😬

Sajeetharan sajeetharan

💭
Debugging "Object reference not set to an instance of an object." 😬
View GitHub Profile
@sajeetharan
sajeetharan / azurecosmosdb-linux-emulator
Last active August 14, 2023 10:33
Deploy emulator linux
version: '2.4'
networks:
default:
external: false
ipam:
driver: default
config:
- subnet: "172.16.238.0/24"
@sajeetharan
sajeetharan / gist:3d1c53bdd450f6c74dbe696860bc1943
Created May 24, 2023 16:27
Azure synapse change data capture
import com.microsoft.azure.cosmos.analytics.spark.connector.datasource.CosmosOlapCDC
val configuration = Map(
"spark.cosmos.accountEndpoint" -> "https://spark-perf.documents.azure.com:443/",
"spark.cosmos.accountKey" -> "xxx",
"spark.cosmos.database" -> "cdc",
"spark.cosmos.container" -> "product",
"spark.cosmos.cdc" -> "true",
"spark.cosmos.cdc.initialRun" -> "true",
"spark.cosmos.cdc.fullFidelity" -> "false",
@description('The location to deploy the Cosmos DB account to. Default value is the location of the resource group.')
param location string = resourceGroup().location
@description('Name of our application')
param applicationName string = uniqueString((resourceGroup().id))
@description('The secondary replica region for the Cosmos DB account')
param secondaryRegion string = 'australiasoutheast'
@description('Name of our Cosmos DB account that will be deployed')
$ipath1 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$ipath2 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$IncludedPath = New-AzCosmosDBSqlIncludedPath -Path "/*" -Index $ipath1, $ipath2
$SpatialSpec = New-AzCosmosDBSqlSpatialSpec -Path "/mySpatialPath/*" -Type "Point", "LineString", "Polygon", "MultiPolygon"
$cp1 = New-AzCosmosDBSqlCompositePath -Path "/abc" -Order Ascending
FUNCTION GenerateMasterKeyAuthorizationSignature
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][String] $verb, # HTTP verb, such as GET, POST, or PUT
[Parameter(Mandatory=$true)][String] $resourceLink, # Case SeNsItIvE!!! (this is the parent path for the $resourceType)
[Parameter(Mandatory=$true)][String] $resourceType, # type of resource that the request is for, Eg. "dbs", "colls", "docs"
[Parameter(Mandatory=$true)][String] $dateTime, # Must exactly match x-ms-date in header (and be lower case)
[Parameter(Mandatory=$true)][String] $key, #
//lets import the necessary packages
var docdb = require("documentdb");
var async = require("async");
// Get the host link which is the documentdb/cosmosdb url from the portal and masterkey is the authentication key
var config = {
host: "https://identityshareddocdb.documents.azure.com:443/",
auth: {
masterKey: "2XEDLvGfedNBDZMAv+EXnZ0SFR4a4MuVt1Fi6WmrRwH7SLcHrr0MvCFm9v+W83qfcJBJXedWjxT47PnNyB1DwA=="
}
// store our master key for documentdb
var mastKey = postman.getEnvironmentVariable("CosmosDBMasterKey");
console.log("mastKey = " + mastKey);
// store our date as RFC1123 format for the request
var today = new Date();
var UTCstring = today.toUTCString();
postman.setEnvironmentVariable("RFC1123time", UTCstring);
// Grab the request url
@sajeetharan
sajeetharan / gist:8213f9c160ab5bc53111bc7047ca81c6
Created May 24, 2021 17:50
Kubelet_identity for AKS cluster
locals {
global_resource_group = "stackover"
resource_group = "stackover-${var.env_prefix}"
cluster_name = "stackover-${var.env_prefix}-cluster"
ingress_address_res_name = "stackover-${var.env_prefix}-ingress-ip"
}
# --- Existing resources -----------------------------------------------------
data "azurerm_container_registry" "container_registry" {
@sajeetharan
sajeetharan / README.md
Created July 11, 2020 15:57
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@sajeetharan
sajeetharan / Install tye
Created December 20, 2020 14:17
Install Project Tye
dotnet tool install -g Microsoft.Tye --version "0.2.0-alpha.20258.3"