some tools for diagrams in software documentation
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
param([Switch]$Fix, [Switch]$Verbose) | |
<# | |
During our testing of in-place upgrades of BizTalk 2010 to BizTalk 2013 we've seen performance counters disappear (especially the BizTalk:Message Agent and BizTalk:Messaging counters). | |
Inspired by: | |
• http://blogs.msdn.com/b/biztalkperformance/archive/2007/09/30/how-to-manually-recreate-missing-biztalk-performance-counters.aspx | |
• http://blogs.msdn.com/b/biztalkcpr/archive/2010/06/23/have-you-manually-recreated-the-biztalk-performance-counter-using-the-following-link-but-some-of-the-counters-were-still-missing.aspx | |
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
# Add a domain user to a remote server local group, if your current user has admin over the remote machine | |
powershell -c ([ADSI]'WinNT://SERVER/Administrators,group').add('WinNT://DOMAIN/USER,user') | |
# Get all local groups on a remote server | |
powershell -c "([ADSI]'WinNT://SERVER,computer').psbase.children | where { $_.psbase.schemaClassName -eq 'group' } | foreach { ($_.name)[0]}" | |
# Find members of the local Administrators group on a remote server | |
powershell -c "$([ADSI]'WinNT://SERVER/Administrators,group').psbase.Invoke('Members') | foreach { $_.GetType().InvokeMember('ADspath', 'GetProperty', $null, $_, $null).Replace('WinNT://', '') }" | |
# Enable the local Administrator account on a remote server |
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
$type = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert | |
get-childitem -path cert:\LocalMachine\AuthRoot | ForEach-Object { | |
$hash = $_.GetCertHashString() | |
[System.IO.File]::WriteAllBytes("$hash.der", $_.export($type) ) | |
} |
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent
Let's say alice
is a github.com user, with 2 or more private repositories repoN
.
For this example we'll work with just two repositories named repo1
and repo2
https://github.com/alice/repo1
https://github.com/alice/repo2
You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.
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
cls | |
"foo.txt", "bar.txt" | %{ | |
$ScriptBlock = { | |
param($name) | |
Write-Host "[processing '$name' inside the job]" | |
Get-Content "$name" | %{ | |
Write-Host "Content: $_" | |
} | |
Start-Sleep 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
##Install Chocolatey | |
#iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
##Install BoxStarter | |
#choco install boxstarter | |
# | |
#Or simpler: | |
#http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/JohnLBevan/d79a6973509bf5bae425/raw/97b183bbba7946b8992e037e56f7bdb347a930be/BoxStarter_AppServicesTeam.txt | |
#ref: see https://github.com/mwrock/Chocolatey-Packages/blob/master/mwrock-TfsDesktop/tools/ChocolateyInstall.ps1 for a great example script | |
#https://gist.github.com/DavidBoike/11269706/4007b58e122dcb926cc7f0e4f134e51bfaebee78 |
- Create a gist if you haven't already.
- Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone [email protected]:<hash>.git # or with ssh
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
#based on code from this blog: https://mcpmag.com/articles/2015/06/18/reporting-on-local-groups.aspx | |
function Get-AdsiComputer { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
[string]$ComputerName = $env:COMPUTERNAME | |
) | |
process { | |
[ADSI]("WinNT://$ComputerName,computer") |
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 Microsoft.AspNetCore.Identity; | |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | |
using System.Linq; | |
namespace My.App.Data | |
{ | |
public class DbInitializer : IDbInitializer | |
{ | |
private readonly ApplicationDbContext _context; | |
private readonly UserManager<ApplicationUser> _userManager; |