This file contains hidden or 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
using System; | |
using System.IdentityModel; | |
using System.Reflection; | |
using System.Text; | |
using System.Web; | |
namespace Samples | |
{ | |
/// <summary> | |
/// A "DeflatedSaml" token header encoder. DeflatedSaml is a semi-standard, in that the encoding/compression steps are described in the SAML standards. |
This file contains hidden or 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
using System; | |
using System.IdentityModel.Protocols.WSTrust; | |
using System.IdentityModel.Tokens; | |
using System.Reflection; | |
using System.Security.Claims; | |
using System.Security.Cryptography.X509Certificates; | |
using System.ServiceModel; | |
using System.ServiceModel.Security; | |
using System.Text.RegularExpressions; | |
using System.Threading; |
This file contains hidden or 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 wsTrustClient = new WsTrustClient("devtest-idp.vfltest.dk"); | |
var audience = "https://devtest-ws-dli.vfltest.dk/UserServices/"; | |
var token = (GenericXmlSecurityToken)wsTrustClient.GetSecurityToken(audience, "<service account>", "<service account password>"); | |
var tokenXml = token.TokenXml.OuterXml; | |
var encodedToken = new DeflatedSamlTokenHeaderEncoder().Encode(tokenXml); | |
Console.WriteLine(tokenXml); | |
Console.WriteLine(encodedToken); | |
using (var client = new HttpClient()) | |
{ |
This file contains hidden or 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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[string]$csprojInFile, | |
[Parameter(Mandatory=$True,Position=2)] | |
[string]$csprojOutFile | |
) | |
$csproj = [xml](get-content $csprojInFile) | |
$xmlns = $csproj.Project.xmlns |
This file contains hidden or 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
# Invoke using following syntax: | |
# http://boxstarter.org/package/url?[input url to this gists] | |
# Boxstarter options | |
$Boxstarter.RebootOk=$true # Allow reboots? | |
$Boxstarter.NoPassword=$false # Is this a machine with no login password? | |
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot | |
# Basic setup | |
Update-ExecutionPolicy Unrestricted |
This file contains hidden or 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
# wget tinyurl.com/enablerdp -outfile .\rdp.ps1 | |
# .\rdp.ps1 | |
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 | |
Enable-NetFirewallRule -DisplayGroup "Remote Desktop" | |
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 |
This file contains hidden or 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
Import-Module Azure | |
Set-StrictMode -version 4 | |
$location = "North Europe" | |
$resourceGroupName = 'Default-Web-' + $location.Replace(' ', ''); | |
$webHostingPlanName = "StandardSmall"; | |
$websiteResourceType = "Microsoft.Web/sites"; | |
$stagingSlotResourceType = "Microsoft.Web/sites/slots"; | |
function New-AzureWebHostingPlan($hostingPlanName) | |
{ |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<PortableRelyingParty xmlns="http://schemas.datacontract.org/2004/07/Dlbr.CommonLogin.AdfsSnapIn" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<AutoUpdateEnabled>false</AutoUpdateEnabled> | |
<ClaimsAccepted /> | |
<ConflictWithPublishedPolicy>false</ConflictWithPublishedPolicy> | |
<DelegationAuthorizationRules /> | |
<Enabled>true</Enabled> | |
<EncryptClaims>true</EncryptClaims> | |
<EncryptedNameIdRequired>false</EncryptedNameIdRequired> | |
<EncryptionCertificateRevocationCheck>CheckChainExcludeRoot</EncryptionCertificateRevocationCheck> |
This file contains hidden or 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
using System; | |
using System.Configuration; | |
using System.IdentityModel.Tokens; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using Dlbr.CommonLogin.Owin; | |
using Microsoft.IdentityModel.Extensions; | |
using Microsoft.IdentityModel.Protocols; | |
using Microsoft.Owin.Logging; |
This file contains hidden or 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
import sublime, sublime_plugin, random, string, os | |
class saveunnamedbuffersCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
print("Init") | |
for window in sublime.windows() : | |
for view in window.views() : | |
dirty = view.is_dirty() | |
filename = str(view.file_name()) | |
print(str(dirty) + " " + filename) |
OlderNewer