h3. Reusing a single HttpClient instance
h4. Can I use a single HttpClient instance to make multiple calls?
h3. Cookie Links (for later digestion)
<# | |
Implements the Unix shell 'which' command using PowerShell. | |
original: https://gist.github.com/codingoutloud/6782961 | |
#> | |
function WhichOnes | |
{ | |
if ($args.Count -eq 0) | |
{ | |
# obviously use of 'which' in usage text is a hack (since it is chosen to match the alias) |
from azure.servicemanagement import * | |
import platform | |
import os | |
### | |
print("CHANGE THE VALUE of 'subscription_id' and create the correct certificate or this will NOT WORK") | |
### | |
plat = platform.system() | |
print("Platform == " + plat) |
# http://stackoverflow.com/questions/192109/is-there-a-function-in-python-to-print-all-the-current-properties-and-values-of | |
dir(somevariable) -- shows the properties available | |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
(Get-AzureRmSubscription -SubscriptionId (Get-AzureRmContext).Subscription).SubscriptionName |
h3. Reusing a single HttpClient instance
h4. Can I use a single HttpClient instance to make multiple calls?
h3. Cookie Links (for later digestion)
// Iterates through all of the X.509 digital certificates installed in the certificate store | |
// on a Windows operating system, dumping out some metadata about each. Each certificate, in | |
// each Certificate Store, from each Certificate Location is included. | |
// | |
// Bill Wilder | @codingoutloud | Oct 2012 | |
// Original: https://gist.github.com/4005661 | |
using System; | |
using System.Linq; | |
using System.Security.Cryptography.X509Certificates; |
// Bill Wilder | @codingoutloud | http://www.cloudarchitecturepatterns.com | Nov 2012 | |
// Original: https://gist.github.com/4121999 | |
// Similar GenerateUrlSafeRandomToken.cs, except upgraded to use crypto-strength RNG | |
// Add reference to System.Web.dll | |
public static string GenerateUrlSafeCryptographicallyStrongRandomToken(int strength = 16) | |
{ | |
using (var rng = new RNGCryptoServiceProvider()) | |
{ | |
var randomBytes = new byte[strength]; | |
rng.GetBytes(randomBytes); |
password="SomeTopSecretPassword" | |
email="bill.wilder@example.com" | |
# openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=DevPartners/emailAddress=$email" | |
# generate .pem (full public/private certificate) | |
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/emailAddress=$email" | |
# generate .pfx (full public/private certificate) from .pem | |
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:$password | |
# generate .cer (public key) from .pem | |
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer |
$subName = 'my azure subscription name here' | |
$rgName = 'nesql-june24-demo2' | |
$region = "East US" | |
$serverName = 'billwilder911' | |
$myIp = "107.92.120.203" #### CHANGES A LOT! | |
Add-AzureRmAccount # then log in interactively, including with 2FA | |
Select-AzureRmSubscription -SubscriptionName $subName | |
# How many regions am I allowed to deploy SQL to? |