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
#!/bin/bash
if [ "$#" -ne 13 ]; then
printf "Usage: ${0} [csv output file] [client] [client configuration directory] [data directory] [download|upload] [threads] [chunk size] [packet loss] [http|https] [proxy] [storage URL] [storage access key] [storage region]\n"
exit 0
fi
flightgw_bin=/usr/local/bin/flight-gateway
net_dev=eth0
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using MultiStorageProvider.Common.Helpers;
using MultiStorageProvider.Common.Service.Interface;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
$rsgName = "xxxxx"
$appName = "xxxxx"
$slotName = "xxxxxx"
$destination = Get-AzureRmWebApp -ResourceGroupName $rsgName -Name $appName
$destinationAppSettings = $destination.SiteConfig.AppSettings
$destinationConnectionStrings = $destination.SiteConfig.ConnectionStrings
$source = Get-AzureRmWebAppSlot -ResourceGroupName $rsgName -Name $appName -Slot $slotName
$sourceAppSettings = $source.SiteConfig.AppSettings
@sajeetharan
sajeetharan / metaprops
Created November 16, 2019 02:35
Remove meta props from cosmosdb query
function stripMeta(doc) {
var metaProps = ["_rid", "_ts", "_self", "_etag", "_attachments"];
var newDoc = {};
for(var prop in doc) {
if (metaProps.indexOf(prop) == -1) {
newDoc[prop] = doc[prop];
}
}
return newDoc;
@sajeetharan
sajeetharan / Add-UserEntitlement.ps1
Created November 5, 2019 12:25
Add-UserEntitlement.ps1
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
namespace Naos.Foundation.Infrastructure
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Net;
using System.Threading.Tasks;
using EnsureThat;
using Humanizer;
using Microsoft.Azure.Cosmos;
@sajeetharan
sajeetharan / FilesFilter.py
Created September 1, 2019 08:06
Filter the files from datalake based on the parameters
import os
from datetime import *
class FilesFilter():
"""
filter to get file list in a folder, which file modification time between[start_date,end_date]
"""
@staticmethod
def get_files_list(path_to_folder,start_date=None,end_date=None):
file_list = []
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServiceName": {
"type": "string",
"minLength": 1
},
"appServiceSkuName": {
"type": "string",
@sajeetharan
sajeetharan / 6242019_dev_podcasts
Last active June 24, 2019 17:51
List of tech podcasts
General
https://blog.codepen.io/radio/
http://softwareengineeringdaily.com/
http://spec.fm/
https://syntax.fm/
http://www.codingblocks.net/
http://devhell.info/
http://www.fullstackradio.com/
https://www.functionalgeekery.com/
http://reactive.audio/
@sajeetharan
sajeetharan / 6182019_cosmos_scale_client
Last active June 18, 2019 07:21
Creating cosmosdb client
var config = new ConfigurationBuilder().SetBasePath(context.FunctionAppDirectory)
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
//1) initialize the cosmosdb client
using (DocumentClient client = new DocumentClient(new Uri(config["CosmosDB_Uri"]), config["CosmosDB_appKey"]))