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
#r "Newtonsoft.Json" | |
using System.Net; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
#r "Newtonsoft.Json" | |
using System.Net; |
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
#r "Newtonsoft.Json" | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Primitives; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; |
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
# put this in some shared module folder, such as /usr/local/share/powershell/Modules | |
Function Get-IpCountry { | |
param([String]$ip="9.9.9.9") | |
$country = Invoke-RestMethod -Method GET -Uri https://ipinfo.io/$ip/country | |
return $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
git add --all | |
git commit --all -m "Update" | |
git push |
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
Login-AzureRmAccount | |
Select-AzureRmSubscription -SubscriptionName AzureFAQ # subscription where the Web App resides | |
$webAppName = "pageofphotos" # Web App resource Name, (Get-AzureRmWebApp)[0].Name | |
$fqdn = "pageofphotos.com" # what is the DNS address? could be admin.pageofphotos.com if that's what's mapped | |
$vaultName = "GlobalOpsVault" | |
$certificateName = "MySSL" | |
$passwordLength = 50 |
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 request = require('request'); | |
module.exports = function (context, req) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
var html = "<html><body><h1>didn't work</h1></body></html>" | |
var movieApiUrl = 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies&count=10'; | |
// go get your own API key: https://market.mashape.com/andruxnet/random-famous-quotes#get-endpoint | |
var movieApiKey = process.env['MOVIE_API_KEY']; | |
// context.log('MOVIE API KEY = ' + movieApiKey); |
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 | |
URL="https://prod-24.southcentralus.logic.azure.com:443/workflows/62d71dadbb0b451bb8de9f27c9e51f93/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=8HpJbLEcF078jtVgBZoMpWA65sZDI8_nowFVINX8HK0" | |
for i in `seq 1 $1`; | |
do | |
echo $i | |
curl "$URL" | |
done |
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
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 = { |
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
GEO IP SERVICES | |
FORMAT: URL - LOWEST ACCESS TIER - NOTES | |
https://ipinfo.io/pricing - 1,000/day free - $50/m for 10,000/day with support | |
https://freegeoip.net/?q=23.196.102.76 - 15,000/hour free - open source https://github.com/fiorix/freegeoip | |
https://www.maxmind.com/en/geoip2-precision-demo - | |
http://geoiplookup.net/ - NO API - interactive only | |
https://www.ultratools.com/tools/ipWhoisLookupResult - NO API - interactive only | |
https://geoiptool.com/en/?ip=23.196.102.76 - NO API - interactive only | |
http://www.hostip.info/index.html - not looking promising - attributed my Boston-area IP as being in LA with Verizon | |
http://ipinfodb.com/ip_location_api.php - free API, but need API key and single IP address to source requests from - also has a commercial DB dowload ("The IPInfoDB.com has a goal of providing high-quality geolocation service to all users for free.") |
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 | |
if [ $1 ] | |
then | |
echo "Resources in Azure Resource Group $1" | |
az resource list --query "[?resourceGroup=='$1'].{ name: name, flavor: kind, resourceType: type, region: location }" --output table | |
else | |
echo "usage: $0 [name-of-azure-resource-group]" | |
fi |