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
using System; | |
using System.Collections.Generic; | |
using Newtonsoft.Json.Linq; | |
public static class JTokenExtensions | |
{ | |
public static List<JToken> FindTokens(this JToken containerToken, string name, StringComparison stringComparision = StringComparison.Ordinal) | |
{ | |
var matches = new List<JToken>(); | |
FindTokens(containerToken, name, matches, stringComparision); |
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
#Requires -RunAsAdministrator | |
#Requires -Version 5.1 | |
if (-not(Get-Module IniManager -ErrorAction SilentlyContinue)) { | |
Install-Module -Name IniManager -Force | |
} | |
Import-Module -Name IniManager | |
$webBinary = 'https://dl.bintray.com/apache/couchdb/win/2.1.1/couchdb-2.1.1.msi' | |
$msi = "~\Downloads\couchdb-2.1.1.msi" |
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
$requestheaders = @{ | |
"Origin" = "http://localhost" | |
} | |
$response = Invoke-WebRequest -Uri http://couch/inbox/_all_docs -UseDefaultCredentials -Headers $requestheaders | |
$response | Select -ExpandProperty Headers |
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
$reg = @{ | |
Path = 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments' | |
Name = 'SaveZoneInformation' | |
PropertyType = 'DWORD' | |
Value = 1 | |
} | |
if (-not (Test-Path -Path $reg.Path)) { | |
New-Item $reg.Path | |
} |
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
; CouchDB Configuration Settings | |
; Custom settings should be made in this file. They will override settings | |
; in default.ini, but unlike changes made to default.ini, this file won't be | |
; overwritten on server upgrade. | |
[couchdb] | |
;max_document_size = 4294967296 ; bytes | |
;os_process_timeout = 5000 | |
uuid = a4380b3563aa5c628fa98c5ccc4e160b |
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
#requires -RunAsAdministrator | |
Function InstallNSBPerfCounters { | |
$category = @{Name="NServiceBus"; Description="NServiceBus statistics"} | |
$counters = New-Object System.Diagnostics.CounterCreationDataCollection | |
$counters.AddRange(@( | |
New-Object System.Diagnostics.CounterCreationData "Critical Time", "Age of the oldest message in the queue.", NumberOfItems32 | |
New-Object System.Diagnostics.CounterCreationData "SLA violation countdown", "Seconds until the SLA for this endpoint is breached.", NumberOfItems32 | |
New-Object System.Diagnostics.CounterCreationData "# of msgs successfully processed / sec", "The current number of messages processed successfully by the transport per second.", RateOfCountsPerSecond32 |
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
pushd $Env:TEMP | |
iwr "https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US" -OutFile 'firefox-stub.exe' | |
& .\firefox-stub.exe | |
popd |
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
<# | |
Send Slack Notification in Disk gets below 20% | |
Send Slack Notification in any service that match the service name prefixs are not running (skip of service start is not Automatic) | |
#> | |
Function SlackDiskReport { | |
param( | |
[Parameter(Mandatory, ValueFromPipeLine)] | |
$disk | |
) |
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
#Requires -RunAsAdministrator | |
Add-Type -Assembly "System.Messaging" | |
Function RemoveServiceControlPluginMessagesFromTXDLQ { | |
$filter = New-Object System.Messaging.MessagePropertyFilter | |
$filter.Acknowledgment = $true | |
$filter.LookupId = $true | |
$filter.Extension = $true |
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
(New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Force).SetValue("NoLockScreen", 1) |
NewerOlder