Skip to content

Instantly share code, notes, and snippets.

View sjkp's full-sized avatar

Simon J.K. Pedersen sjkp

View GitHub Profile
@sjkp
sjkp / office-groups-connector-webhook.ps1
Created April 1, 2016 12:42
Posts an action card to Office Group using the WebHook Connector
<#
.SYNOPSIS
Posts an action card to Office Group using the WebHook Connector
.DESCRIPTION
.
.PARAMETER url
The url to the web hook connector as registered in the Office 365 Group.
.PARAMETER title
The title to show on the action card.
.PARAMETER message
@sjkp
sjkp / export web part url
Created March 25, 2016 12:07
Export Web Part SharePoint
https://intranet.contoso.com/_vti_bin/exportwp.aspx?pageurl=https://intranet.contoso.com/Pages/default.aspx&guidstring=0c3adfe9-8f5d-4432-918a-42410e4e324d
param
(
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription name. You need to be Subscription Admin to execute the script")]
[string] $subscriptionName,
[Parameter(Mandatory=$true, HelpMessage="Provide a password for SPN application that you would create")]
[string] $password,
[Parameter(Mandatory=$false, HelpMessage="Provide a SPN role assignment")]
[string] $spnRole = "owner"
@sjkp
sjkp / Azure-VM-Extensions
Created August 22, 2015 09:57
Azure VM Extensions Complete list
Id : /Subscriptions/cd0d7179-80a0-47e6-a201-9c12de0bbd37/Providers/Microsoft.Compute/Locations/westeurope
/Publishers/alertlogic/ArtifactTypes/VMExtension/Types/AlertLogicLM/Versions/1.3.0.1
Location : westeurope
PublisherName : alertlogic
Type : AlertLogicLM
Version : 1.3.0.1
FilterExpression :
Id : /Subscriptions/cd0d7179-80a0-47e6-a201-9c12de0bbd37/Providers/Microsoft.Compute/Locations/westeurope
/Publishers/AlertLogic.Extension/ArtifactTypes/VMExtension/Types/AlertLogicLM/Versions/1.3.0.0
@sjkp
sjkp / fake-sp2013-installation.reg
Created July 20, 2015 11:18
Fake SharePoint installation to create WSP solution
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0]
"SharePoint"="Installed"
"Location"="C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\15\\"
@sjkp
sjkp / download-azure-arm-templates
Created June 28, 2015 22:02
Download Azure ARM templates from the gallery
New-Item -path 'C:\Azure\arm-Templates\' -type directory -Force
$microsoftTemplates = Get-AzureResourceGroupGalleryTemplate -Publisher 'Microsoft'
foreach ($item in $microsoftTemplates)
{
$identity = $item.'Identity'
Save-AzureResourceGroupGalleryTemplate -Identity $identity `
-Path C:\Azure\arm-Templates\ `
@sjkp
sjkp / remove-nodemodules
Created June 13, 2015 17:04
Remove node_modules on windows
Install RimRaf:
npm install rimraf -g
And in the project folder delete the node_modules folder with:
rimraf node_modules
Param([string]$publishsettings,
      [string]$storageaccount,
      [string]$subscription,
      [string]$service,
      [string]$containerName="mydeployments",
      [string]$config,
      [string]$package,
      [string]$slot="Staging")
 
Function Get-File($filter){
@sjkp
sjkp / enable-sideloading.ps1
Created April 19, 2015 08:11
Enable Side Loading of Apps
[System.Reflection.Assembly]::LoadFile("C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll")
$ctx = new-object Microsoft.SharePoint.Client.ClientContext("https://<site>")
$pass = "<password>"
$s = ConvertTo-SecureString -String $pass -AsPlainText -Force
@sjkp
sjkp / ffmpeg encoding
Last active December 4, 2016 04:25
Nook HD+ compatible mp4 ffmpeg encode
ffmpeg -i "input.mp4" -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k -vf scale=854:trunc(ow/a/2)*2 -threads 0 -acodec libvo_aacenc -ab 128k "output.mp4"