View Create-Administrator.ps1
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
$Username = "su" | |
$Password = "password" | |
$group = "Administrators" | |
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" | |
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } | |
if ($existing -eq $null) { |
View increase-replication-factor.js
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
/* | |
* This script reads the existing partition assignments in JSON (exported using kafka-reassign-partitions.sh) and generates | |
* the appropriate reassignment JSON file for input to kafka-reassign-partitions.sh. | |
* | |
*/ | |
var usage = ` | |
Usage: node increase-replication-factory.js (brokers) (replication factor) (current assignment file) (output file) [-f] | |
* brokers: comma separated list of brokers | |
* replication factor: the new replication factor to use |
View Configure-UrlRewriteRules.ps1
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
$SiteName = "Default Web Site" | |
Import-Module WebAdministration | |
Write-Host "Getting allowed server variables..." | |
$allowedServerVariables = Get-WebConfigurationProperty -PSPath "MACHINE/WEBROOT/APPHOST" -filter "system.webServer/rewrite/allowedServerVariables/add" -Name name | |
Write-Host "Found $($allowedServerVariables.Length)..." | |
if ( ($allowedServerVariables -eq $null) -or ( $allowedServerVariables | ?{ $_.Value -eq "HTTPS" } ).Length -eq 0 ) { | |
#Configure IIS To Allow 'HTTPS' as a server variable - Must be done at a applicationhosts.config level |
View curl-check.yaml
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
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: curl-check | |
labels: | |
app: curl-check | |
spec: | |
template: | |
metadata: | |
labels: |
View upgrade-rancher.sh
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
#!/bin/bash | |
old_id=$1 | |
old_version=$2 | |
new_version=$3 | |
now=`date +%Y%m%d-%H%M%S` | |
echo "Stop $2 ($1)" | |
docker stop $1 | |
echo "Create new volume" |
View purge.json
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { }, | |
"variables": { }, | |
"resources": [ ], | |
"outputs": { } | |
} |
View TodoApiController.cs
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.Collections.Generic; | |
using System.Linq; | |
using System.Web.Http; | |
using System.Data; | |
public class TodoApiController : ApiController | |
{ | |
private BetterMobileSpaContext db = new BetterMobileSpaContext(); | |
// GET /api/todoapi |
View Set-LocalAccountPassword.ps1
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
$Username = "su" | |
$Password = "password" | |
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" | |
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } | |
if ($existing -eq $null) { | |
Write-Error "User $Username does not exist" | |
return | |
} |
View Setup-VstsAgent.ps1
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
$agentUrl = 'https://github.com/Microsoft/vsts-agent/releases/download/v2.112.0/vsts-agent-win7-x64-2.112.0.zip' | |
$vstsUrl = '' # TODO: Set URL - e.g. https://mytenant.visualstudio.com | |
$pat = '' # TODO: set PAT generated using these instructions - https://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windows | |
$pool = 'default' | |
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex | |
# change this or add more steps below to install any other prerequisites | |
choco install -y ` | |
visualstudio2017community ` |
View kafka-run-class.bat
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
@echo off | |
rem Licensed to the Apache Software Foundation (ASF) under one or more | |
rem contributor license agreements. See the NOTICE file distributed with | |
rem this work for additional information regarding copyright ownership. | |
rem The ASF licenses this file to You under the Apache License, Version 2.0 | |
rem (the "License"); you may not use this file except in compliance with | |
rem the License. You may obtain a copy of the License at | |
rem | |
rem http://www.apache.org/licenses/LICENSE-2.0 | |
rem |
NewerOlder