We want to install OpenSSH on a Windows Server 2019, so we can remote access it with ssh myuser@win2019.
We want also to turn on PowerShell Remoting over SSH, so we can create PSSession objects from PowerShell Core on Linux/MacOs/Windows.
| #!/bin/bash | |
| TMP=`mktemp` | |
| trap ctrlC INT | |
| removeTempFiles() { | |
| rm -f $TMP | |
| } | |
| ctrlC() { | 
| using System.Data.Entity.Validation; | |
| using System.Linq; | |
| using Microsoft.ApplicationInsights.Channel; | |
| using Microsoft.ApplicationInsights.DataContracts; | |
| using Microsoft.ApplicationInsights.Extensibility; | |
| public class EntityFrameworkExceptionTelemetryInitializer : ITelemetryInitializer | |
| { | |
| public void Initialize(ITelemetry telemetry) | 
| <h2> Hello World! </h2> | |
| <script> | |
| function iframeResize() { | |
| var body = document.body, html = document.documentElement; | |
| var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
| var location = document.location.href; | |
| window.parent.postMessage(["setHeight", height, location], "*"); | |
| } | |
| iframeResize(); | |
| $(window).resize(iframeResize); | 
| // Usage: | |
| // Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
| // then use as follows: | |
| // | |
| // query(term | [term, term, ...], term | [term, term, ...], ...) | |
| // | |
| // When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
| // | |
| // Term is of the format: | |
| // ((-)text/RegExp) ( '-' means negation ) | 
| #!/bin/sh | |
| #To make use of this just copy it to your path, +x it, and do git sync | |
| MAIN_BRANCH="develop" | |
| CURRENT_CHANGES=`git status --porcelain` | |
| CURRENT_BRANCH=`git symbolic-ref -q --short HEAD` | |
| if [ "$CURRENT_CHANGES" != "" ]; then | |
| git stash --include-untracked | |
| fi | 
| <?xml version="1.0" encoding="utf-8" ?> | |
| <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <targets> | |
| <target name="coloredConsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false" | |
| layout="${longdate}|${pad:padding=5:inner=${level:uppercase=true}}|${message}" > | |
| <highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" /> | |
| <highlight-row condition="level == LogLevel.Info" foregroundColor="Gray" /> | |
| <highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" /> | 
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> | |
| </configSections> | |
| <nlog> | |
| <targets> | |
| <target name="console" type="Console" layout="${message}" /> | |
| <target name="debugger" type="Debugger" layout="${message}"/> | |
| </targets> | 
| Powershell HTTP Request | |
| $r = [System.Net.WebRequest]::Create("http://url/") | |
| $resp = $r.GetResponse() | |
| $reqstream = $resp.GetResponseStream() | |
| $sr = new-object System.IO.StreamReader $reqstream | |
| $result = $sr.ReadToEnd() | |
| write-host $result | |
| Username and passwords |