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 | |
<# | |
.SYNOPSIS | |
Enabled Powershell Remoting Over SSH. | |
.NOTES | |
Currently assumes you have installed openssh and powershell core, preferably via chocolatey as such: | |
choco install powershell-core -y | |
choco install openssh -y -params '"/SSHServerFeature /PathSpecsToProbeForShellEXEString:$env:programfiles\PowerShell\*\pwsh.exe"' | |
#> | |
[CmdletBinding()] |
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
#!/usr/bin/env powershell | |
if ($args -contains '--list') { | |
$output = @{ | |
'all' = @('server1.domain.com', 'server2.domain.com') | |
'webservers' = @('server1.domain.com') | |
'_meta' = @{ | |
'hostvars' = @{ | |
'server1.domain.com' = @{ | |
myvar = 'metavariable' |
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
Question: | |
. How to run Ansible without specifying the inventory but the host directly? | |
. Run a playbook or command with arbitrary host not in the inventory hosts list? | |
. run ansible with arbitrary host/ip without inventory? | |
Answer: | |
Surprisingly, the trick is to append a , | |
The host parameter preceding the , can be either a hostname or an IPv4/v6 address. | |
ansible all -i example.com, |
How to Become a Microsoft MVP (https://timw.info/mvp)
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 | |
# Check if the version argument is provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <go_version>" | |
exit 1 | |
fi | |
# Version number provided as an argument | |
version="$1" |
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
# Based on the format described at http://podcast411.com/howto_1.html | |
function createRssElement{ | |
param( | |
[string]$elementName, | |
[string]$value, | |
$parent | |
) | |
$thisNode = $rss.CreateElement($elementName) |
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
# Download latest dotnet/codeformatter release from github | |
$repo = "dotnet/codeformatter" | |
$file = "CodeFormatter.zip" | |
$releases = "https://api.github.com/repos/$repo/releases" | |
Write-Host Determining latest release | |
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name |
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
CREATE TABLE books ( | |
isbn char(14) NOT NULL, | |
title varchar(255), | |
author varchar(255), | |
price decimal(5,2) | |
); | |
INSERT INTO books (isbn, title, author, price) VALUES | |
('978-1503261969', 'Emma', 'Jayne Austen', 9.44), | |
('978-1514274873', 'Journal of a Soldier', NULL, 5.49), |
OlderNewer