Skip to content

Instantly share code, notes, and snippets.


Bill Wilder codingoutloud

View GitHub Profile
codingoutloud / Fail75.js
Created Sep 7, 2017
Code for an Azure Function that sometimes returns failure (on purposes, 75% of the time, useful for testing)
View Fail75.js
module.exports = function (context, req) {
if (Math.random() > 0.75) {
context.log('Azure Function "Fail75" is randomly (25%) returning 200 OK.');
context.res = {
body: "Randomly (25%) returning 200 OK."
else {
context.log('Azure Function "Fail75" is randomly (75%) returning 500 as a transient error.');
context.res = {
View geo-ip-services.txt
FORMAT: URL - LOWEST ACCESS TIER - NOTES - 1,000/day free - $50/m for 10,000/day with support - 15,000/hour free - open source - - NO API - interactive only - NO API - interactive only - NO API - interactive only - not looking promising - attributed my Boston-area IP as being in LA with Verizon - free API, but need API key and single IP address to source requests from - also has a commercial DB dowload ("The has a goal of providing high-quality geolocation service to all users for free.")
codingoutloud /
Last active Mar 13, 2017
Using Azure CLI 2, show all the resources in a resource group
if [ $1 ]
echo "Resources in Azure Resource Group $1"
az resource list --query "[?resourceGroup=='$1'].{ name: name, flavor: kind, resourceType: type, region: location }" --output table
echo "usage: $0 [name-of-azure-resource-group]"
from azure import *
from azure.servicemanagement import *
subscription_id = '<your_subscription_id>'
certificate_path = '<path_to_.pem_certificate>'
sms = ServiceManagementService(subscription_id, certificate_path)
name = 'myvm'
from azure.servicemanagement import *
import platform
import os
plat = platform.system()
print("Platform == " + plat)
if plat != 'Windows':
certificate_path = './azquota.pem' # other than Windows
View make-azure-sql-database.ps1
$subName = 'my azure subscription name here'
$rgName = 'nesql-june24-demo2'
$region = "East US"
$serverName = 'billwilder911'
$myIp = "" #### 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 /
Created May 29, 2016
Generate an AES256 certificate for encrypting email, such as with the Outlook client for Mac.
# 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 /
Last active May 8, 2016
HttpClient in .NET
View Get-AzureRmSubscription-Default
(Get-AzureRmSubscription -SubscriptionId (Get-AzureRmContext).Subscription).SubscriptionName

Keybase proof

I hereby claim:

  • I am codingoutloud on github.
  • I am 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: