Python
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
/usr/bin/anaconda/bin/conda create --prefix /usr/bin/anaconda/envs/py37 python=3.7 |
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 pymongo import MongoClient | |
client = MongoClient('mongodb://testmongoapr:xx==@testmongoapr.documents.azure.com:10255/?ssl=true&replicaSet=globaldb') | |
# Creating Database | |
db = client.testdb | |
db.command({ 'customAction': "CreateDatabase" }) | |
#creates Fixed Storage Collection | |
db.command({'customAction': "CreateCollection", 'collection': "testCol1", 'offerThroughput': 1000}) | |
#creates Unlimited Storage Collection | |
db.command({'customAction': "CreateCollection", 'collection': "testCol2", 'offerThroughput': 1000,'shardKey':'country'}) |
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 cassandra.cluster import Cluster | |
from cassandra.auth import PlainTextAuthProvider | |
import config as cfg | |
from ssl import PROTOCOL_TLSv1_2 | |
from requests.utils import DEFAULT_CA_BUNDLE_PATH | |
ssl_opts = { | |
'ca_certs': DEFAULT_CA_BUNDLE_PATH, | |
'ssl_version': PROTOCOL_TLSv1_2, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 mongoose = require('mongoose') | |
const db = mongoose.connect('mongodb://mongo1234:Shrk6VZMbwCjEV0Fwmz2m3qHx3qhdQMAaLw52pKOrWCji2NhOOHEJVM6W51SKiDLv5a5pQRUybwABnGKRwDy4A==@mongo1234.documents.azure.com:10255/d1?ssl=true&replicaSet=globaldb',{useNewUrlParser: true}); | |
var Schema = mongoose.Schema; | |
var schema = new Schema({ name: String },{ shardKey: { name: 1 }}); | |
const Cat = mongoose.model('Cat',schema); | |
//Cat.create({name: 'Zildjian'}); | |
const kitty = new Cat({ name: 'Zildjian' }); | |
kitty.save().then(() => console.log('meow')); |
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
using System; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using Microsoft.Azure.Documents.Client; | |
using Microsoft.Azure.Documents; | |
using Microsoft.Azure; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; |
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
"use strict"; | |
const cassandra = require('cassandra-driver'); | |
const async = require('async'); | |
const assert = require('assert'); | |
var tls = require('tls'); | |
var fs = require('fs'); | |
var config = require('./config'); | |
var ssl_option = { |
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
sudo apt-get -y install unixodbc-dev | |
python -m pip install pyodbc |