Skip to content

Instantly share code, notes, and snippets.

@petermreid
petermreid / gist:8d2567b4703daff35ae2
Last active August 29, 2015 14:03
SharePoint Online Fiddler trace
Protocol Host Url Bytes
HTTPS kloud1.sharepoint.com /default.aspx 141,882
HTTPS kloud1.sharepoint.com /SiteAssets/Kloud-Logo-Intranet.jpg?rev=37 29,667
HTTPS kloud1.sharepoint.com /_layouts/15/images/loadingcirclests16.gif?rev=37 420
HTTPS cdn.sharepointonline.com /10216/_layouts/15/16.0.2916.1214//online/scripts/sposuitenav.js 5,091
HTTPS cdn.sharepointonline.com /10216/_layouts/15/16.0.2916.1214/1033/strings.js 41,510
HTTPS prod.msocdn.com /3.06.5330.0/en-US/JSC/Shell15Bundle.js 63,492
HTTPS prod.msocdn.com /3.06.5330.0/en-US/css/O365Shell15.css 3,946
HTTPS cdn.sharepointonline.com /10216/_layouts/15/16.0.2916.1214/sp.core.js 15,203
HTTPS prod.msocdn.com /3.06.5330.0/en-US/css/icons/O365Icons.eot? 14,693
@petermreid
petermreid / gist:09f1e4d7b0f7cb9f8f7c
Created June 25, 2014 10:49
Makecert create a certificate authority
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert" -r -pe -n "CN=Petes Root Authority" -ss CA -sr CurrentUser -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer
@petermreid
petermreid / gist:573da2b83ccca9f92be8
Created June 25, 2014 10:52
Makecert create secure certificate from CA
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert" -pe -n "CN=tenant.sharepointonline.com" -a sha1 -sky Exchange -eku 1.3.6.1.5.5.7.3.1 -ic CA.cer -iv CA.pvk -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -sv tenant.sharepointonline.com.pvk tenant.sharepointonline.com.cer
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx" -pvk tenant.sharepointonline.com.pvk -spc tenant.sharepointonline.com.cer -pfx tenant.sharepointonline.com.pfx
@petermreid
petermreid / gist:4a2bee1b3b90dfef39d0
Created June 25, 2014 10:54
Makecert create secure certificate from CA
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert" -pe -n "CN=cdn.sharepointonline.com" -a sha1 -sky Exchange -eku 1.3.6.1.5.5.7.3.1 -ic CA.cer -iv CA.pvk -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -sv cdn.sharepointonline.com.pvk cdn.sharepointonline.com.cer
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx" -pvk cdn.sharepointonline.com.pvk -spc cdn.sharepointonline.com.cer -pfx cdn.sharepointonline.com.pfx
@petermreid
petermreid / gist:086d6e5c912a6dbd71bd
Created June 25, 2014 10:57
URLRewrite straight through router
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
url="(.*)" />
<conditions trackAllCaptures="true">
https?)://" />
<add input="{HTTP_HOST}" pattern="^(.*)" />
</conditions>
<action type="Rewrite" url="{C:1}://{C:2}/{R:1}" />
</rule>
@petermreid
petermreid / gist:816e6a6e4aced5f6d0e8
Last active August 29, 2015 14:07
Add Azure Web Server to farm
$subscriptionName = <subscriptonname>
$storageLocation = <vhdstorage>
Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccountName $storageLocation
Select-AzureSubscription -SubscriptionName $subscriptionName
$username = <username>
$password = <password>
$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
$vmPrefix = “O365Accel”
$vmImageLocation = "http://" $storageLocation ".blob.core.windows.net/vhd"
@petermreid
petermreid / web.config
Last active August 29, 2015 14:12
SharePoint Application Request Router
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions trackAllCaptures="true">
<add input="{CACHE_URL}" pattern="^(https?)://" />
<add input="{HTTP_HOST}" pattern="^(.*sharepoint.*|.*msocdn.*)" />
@petermreid
petermreid / portfolio
Last active August 29, 2015 14:23
Yahoo Quotes Portfolio
let
PortfolioSource = Excel.CurrentWorkbook(){[Name="Portfolio"]}[Content],
#"sParam" = Text.Combine(Table.ToList(Table.SelectColumns(PortfolioSource, "Symbol")),","),
#"Fields" = Excel.CurrentWorkbook(){[Name="FieldLookup"]}[Content],
#"DisplayFields" = Table.SelectRows(#"Fields",each [Display]=true),
#"fParam" = Text.Combine(Table.ToList(Table.SelectColumns(#"DisplayFields", "f")),""),
#"DisplayColumns" = Table.ToList(Table.SelectColumns(#"DisplayFields", "Name")),
#"TypeNames" = Table.SelectRows(Table.SelectColumns(#"DisplayFields", {"Name","Type"}), each [Type]="number"),
@petermreid
petermreid / historical
Created June 24, 2015 10:29
Yahoo Historical Prices
let
Source = Csv.Document(Web.Contents("http://ichart.finance.yahoo.com/table.csv?s=CPU.AX&a=00&b=4&c=2014&d=07&e=01&f=2015&g=d&ignore=.csv"),[Delimiter=",",Encoding=1252]),
#"First Row as Header" = Table.PromoteHeaders(Source),
#"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"Date", type date}, {"Open", type number}, {"High", type number}, {"Low", type number}, {"Close", type number}, {"Volume", Int64.Type}, {"Adj Close", type number}})
in
#"Changed Type"
@petermreid
petermreid / gist:3183e16d56555cc38f53
Last active August 29, 2015 14:24
Titanic Age Group
# Map 1-based optional input ports to variables
dataset1 <- maml.mapInputPort(1) # class: data.frame
# Sample operation
dataset1$AgeGroup <- ifelse(dataset1$Age < 16, "Young", ifelse(dataset1$Age > 60, "Old", "Middle"))
# Select data.frame to be sent to the output Dataset port
maml.mapOutputPort("dataset1");