Skip to content

Instantly share code, notes, and snippets.

View codingoutloud's full-sized avatar

Bill Wilder codingoutloud

View GitHub Profile
$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?
@codingoutloud
codingoutloud / make-aes256-certificate.sh
Created May 29, 2016 18:25
Generate an AES256 certificate for encrypting email, such as with the Outlook client for Mac.
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
@codingoutloud
codingoutloud / HttpClient.md
Last active May 8, 2016 13:49
HttpClient in .NET
(Get-AzureRmSubscription -SubscriptionId (Get-AzureRmContext).Subscription).SubscriptionName

Keybase proof

I hereby claim:

  • I am codingoutloud on github.
  • I am codingoutloud (https://keybase.io/codingoutloud) on keybase.
  • I have a public key whose fingerprint is DE0B 68FC 8EC6 15A6 7E37 D12A B406 C6B3 FB60 5432

To claim this, I am signing this object:

@codingoutloud
codingoutloud / Format-AzureStorageKey.ps1
Last active August 29, 2015 14:03
Formats the output from Get-AzureStorageKey as a connection string.
Function Format-AzureStorageKey {
[CmdletBinding()]
Param (
[parameter(Mandatory=$True,ValueFromPipelineByPropertyName=$True)]
[string[]] $Primary,
[parameter(Mandatory=$True,ValueFromPipelineByPropertyName=$True)]
[string[]] $Secondary,
[parameter(Mandatory=$True,ValueFromPipelineByPropertyName=$True)]
[string[]] $StorageAccountName,
@codingoutloud
codingoutloud / azuremap.geojson
Last active November 15, 2016 04:24
AzureMap map model files -- generated in GeoJSON and TopoJSON formats -- blogged about here: http://blog.codingoutloud.com/2014/02/01/mapping-windows-azure-4-years-after-full-general-availability/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codingoutloud
codingoutloud / 0_reuse_code.js
Created January 23, 2014 20:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@codingoutloud
codingoutloud / python-history.txt
Created October 21, 2013 15:05
Useful Python hacks I've encountered
# 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
@codingoutloud
codingoutloud / azure-service-management.py
Last active December 25, 2015 20:19
Run Windows Azure Service Management operation through Python. This requires access to a certificate. Under Windows this certificate must be in the certificate store. On Mac or Linux, this certificate must accessible in a .pem file. In either case, the specified certificate must be uploaded to the Windows Azure portal as a management certificate…
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)