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
| # Get network connections | |
| $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) | |
| $connections = $networkListManager.GetNetworkConnections() | |
| # Set network location to Private for all networks | |
| $connections | % {$_.GetNetwork().SetCategory(1)} | |
| # this is a must for creating winrm listener of https |
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
| ################################################################################################################################# | |
| # Name : Configure-WinRM.ps1 # | |
| # # | |
| # Description : Configures the WinRM on an Azure machine # | |
| # # | |
| # Arguments : HostName, specifies the FQDN of machine or domain # | |
| ################################################################################################################################# | |
| param | |
| ( |
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
| call winrm set winrm/config/service/auth @{Basic="true"} | |
| call winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname="%1";CertificateThumbprint="%2"} |
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
| { | |
| "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "omniPrefix": { | |
| "type": "string", | |
| "defaultValue": "legacytest" | |
| }, | |
| "vmOS": { | |
| "type": "string", |
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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "vmCount": { | |
| "value": 5 | |
| }, | |
| "adminUsername": { | |
| "value": "" | |
| }, |
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "go/ast" | |
| "go/parser" | |
| "go/printer" | |
| "go/token" | |
| "strings" |
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
| func rotateString(A string, B string) bool { | |
| if len(A) != len(B) { | |
| return false | |
| } | |
| l := len(A) | |
| if l == 0 { | |
| return true | |
| } | |
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
| // NOT completed! | |
| // should consider about non-full count: | |
| // 10, is 2-digi int, but not using fully count(2) | |
| func rotatedDigits(N int) int { | |
| switch { | |
| case N<=10000 && N>=1000: return count(4) | |
| case N<1000 && N>=100: return count(3) | |
| case N<100 && N>=10: return count(2) | |
| case N<10 && N>=1: return count(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
| package main | |
| import ( | |
| "log" | |
| "reflect" | |
| "time" | |
| "github.com/golang/protobuf/jsonpb" | |
| "github.com/golang/protobuf/proto" | |
| "golang.org/x/net/context" |
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
| package jsonsampler | |
| import ( | |
| "encoding/json" | |
| "reflect" | |
| "testing" | |
| ) | |
| type Struct1 struct { | |
| Name string |
OlderNewer