This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Input file | |
FILE="input.csv" | |
# Log file | |
LOGFILE="output.log" | |
# Number of retries | |
RETRIES=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { MongoClient } = require("mongodb"); | |
var ReadPreference = require('mongodb').ReadPreference | |
// Replace the following with your MongoDB deployment's connection | |
// string. | |
const uri = | |
"mongodb://prmongotest:XSXz98HsbkOGyQN1SNnjilJKf5eDWDMXpJIvus8441jiiROq1WO86P84enVHw2izDtRTVndUev2l6hDX4VW6Tw==@prmongotest.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@prmongotest@"; | |
const client = new MongoClient(uri, { monitorCommands:true }); | |
// Replace <event name> with the name of the event you are subscribing to. | |
const eventName = "commandStarted"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { MongoClient } = require("mongodb"); | |
var ReadPreference = require('mongodb').ReadPreference | |
// Replace the following with your MongoDB deployment's connection | |
// string. | |
const uri = | |
"mongodb://cosmomongo13:==@cosmomongo13.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@cosmomongo13@"; | |
const client = new MongoClient(uri, { monitorCommands:true }); | |
// Replace <event name> with the name of the event you are subscribing to. | |
const eventName = "commandStarted"; |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirstName LastName Phone Email DiscountCode | |
Roberto Tamburello 555.123.4567 RTamburello@contoso.com 10 | |
Janice Galvin 555.123.4568 JGalvin@contoso.com.co 5 | |
Shakti Menon 555.123.4570 SMenon@contoso.net 50 | |
Zheng Mu 555.123.4569 ZMu@contoso.net 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MongoClient = require('mongodb').MongoClient | |
var ReadPreference = require('mongodb').ReadPreference | |
, assert = require('assert'); | |
var Logger = require('mongodb').Logger; | |
// Connection URL - Paste your db account connection string from Azure portal | |
var url = 'mongodb://prmultireadmongo:xxxx==@prmultireadmongo.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@prmultireadmongo@'; | |
// readTargetRegion - this will be used to read From while using Tags | |
var readFromRegion = "East US"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
const { CosmosClient } = require("@azure/cosmos"); | |
const endpoint = "https://cosmosdbtestpr.documents.azure.com:443/"; | |
const key = "xxxx=="; | |
const client = new CosmosClient({ endpoint, key }); | |
const databaseName = "testdb2"; | |
const db = null; | |
const initialOffer = 1000; | |
const finalOffer = 600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
s3 = boto3.client('s3') | |
bucket = 'databricks-datasets-virginia' | |
prefix = 'airlines/' | |
objects = s3.list_objects_v2(Bucket=bucket, Prefix=prefix, Delimiter = "/") | |
files = [] | |
for obj in objects['Contents']: | |
files.append(obj) | |
while objects['IsTruncated']: | |
continuation_key = objects['NextContinuationToken'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script adds the logrotate policy for .out files to ensure the logs are compressed, rotated and eventually removed from the VM | |
sudo echo "HealingService action to configure logrotate policy initiated." | logger | |
path="/etc/logrotate.d" | |
sudo mkdir -p $path | |
cat > /tmp/logrotate-policy <<EOF | |
/var/log/ambari-agent/ambari-agent.out | |
/var/log/ambari-metrics-collector/*.out | |
/var/log/ambari-metrics-grafana/grafana.out | |
/var/log/ambari-metrics-monitor/ambari-metrics-monitor.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
import pandas | |
from azure.kusto.data.exceptions import KustoServiceError | |
from azure.kusto.data.helpers import dataframe_from_result_table | |
from azure.kusto.data.request import (ClientRequestProperties, KustoClient, | |
KustoConnectionStringBuilder) | |
from azure.kusto.ingest import (BlobDescriptor, DataFormat, FileDescriptor, | |
IngestionMappingType, IngestionProperties, | |
KustoIngestClient, KustoStreamingIngestClient, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require("request-promise"); | |
module.exports = async function (context, req) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
var options = { | |
uri: 'https://prashanthmadi.github.io/2018/10/10/django-sendgrid.html' | |
}; | |
var result1 = await request(options); |
NewerOlder